From eee6031ae5840de5830760959202f2771d5d55fc Mon Sep 17 00:00:00 2001 From: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Date: Thu, 2 Jun 2022 07:32:43 +0200 Subject: [PATCH 001/240] docs(readme): highlight good first issues (#15834) --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index ef29e0bbb08436..d41b8993769eb5 100644 --- a/readme.md +++ b/readme.md @@ -106,6 +106,7 @@ To run your own instance of Renovate you have several options: ## Contributing If you want to contribute to Renovate or get a local copy running, please read the instructions in [.github/contributing.md](.github/contributing.md). +To get started look at the [list of good first issues](https://github.com/renovatebot/renovate/contribute). ## Security / Disclosure From b201029842fe88c3ea8a654a94445587d82ad11e Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Thu, 2 Jun 2022 07:34:18 +0200 Subject: [PATCH 002/240] docs(behavior): bug reports (#15832) --- docs/development/behavior.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/development/behavior.md b/docs/development/behavior.md index 878d5c5046015b..846f40b32b5029 100644 --- a/docs/development/behavior.md +++ b/docs/development/behavior.md @@ -69,3 +69,12 @@ A full log dump takes a lot of time to scroll through, and it is next to impossi Instead, please select the logs relevant to your problem and paste just those. If it turns out there's a need for the full dump, someone can ask you for it later. + +## Avoid unjustified bug reports + +Don't raise a bug report unless it's definitely a bug. +"I don't like this" or "I didn't expect this to happen" is not the same thing as a bug. + +Many unjustified bug reports are filed because people they think it will get them more attention. +Instead, you may be just wasting maintainer time because we have to reclassify your invalid bug report or convert it to a discussion, and you are much less likely to get the attention you're hoping for. +If in doubt, start a discussion instead. From 6257604ec8e8d5880831023a99bc3b27a98246d0 Mon Sep 17 00:00:00 2001 From: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Date: Thu, 2 Jun 2022 07:35:22 +0200 Subject: [PATCH 003/240] docs(self-hosted configuration): rewrite sections (#15824) --- docs/usage/self-hosted-configuration.md | 83 +++++++++++++------------ 1 file changed, 44 insertions(+), 39 deletions(-) diff --git a/docs/usage/self-hosted-configuration.md b/docs/usage/self-hosted-configuration.md index e7962087369000..12c31085c6e8eb 100644 --- a/docs/usage/self-hosted-configuration.md +++ b/docs/usage/self-hosted-configuration.md @@ -5,7 +5,7 @@ description: Self-Hosted configuration usable in config file, CLI or environment # Self-Hosted configuration options -The configuration options listed in this document are applicable to self-hosted instances of Renovate ("the bot"). +You can only use these configuration options when you're self-hosting Renovate. Please also see [Self-Hosted Experimental Options](./self-hosted-experimental.md). @@ -34,7 +34,7 @@ module.exports = { In the `renovate.json` file, define the commands and files to be included in the final commit. -The command to install dependencies (`npm ci --ignore-scripts`) is necessary because, by default, the installation of dependencies is skipped (see the `skipInstalls` global option). +The command to install dependencies (`npm ci --ignore-scripts`) is needed because, by default, the installation of dependencies is skipped (see the `skipInstalls` global option). ```json { @@ -64,10 +64,10 @@ npx ng update @angular/core --from=10.0.0 --to=11.0.0 --migrate-only --allow-dir ## allowedPostUpgradeCommands -A list of regular expressions that determine which commands in `postUpgradeTasks` are allowed to be executed. +A list of regular expressions that decide which commands in `postUpgradeTasks` are allowed to run. If this list is empty then no tasks will be executed. -e.g. +For example: ```json { @@ -77,8 +77,8 @@ e.g. ## autodiscover -When you enable `autodiscover`, by default, Renovate will run on _every_ repository that the bot account can access. -If you want Renovate to run on only a subset of those, use the `autodiscoverFilter` option to limit the bot to only the wanted repositories. +When you enable `autodiscover`, by default, Renovate runs on _every_ repository that the bot account can access. +You can limit which repositories Renovate can access by using the `autodiscoverFilter` config option. ## autodiscoverFilter @@ -116,7 +116,7 @@ You can negate the regex by putting a `!` in front: By default Renovate uses a temporary directory like `/tmp/renovate` to store its data. You can override this default with the `baseDir` option. -e.g. +For example: ```json { @@ -126,12 +126,15 @@ e.g. ## binarySource -Renovate often needs to use third-party binaries in its PRs, e.g. `npm` to update `package-lock.json` or `go` to update `go.sum`. -By default, Renovate will use a child process to run such tools, so they need to be pre-installed before running Renovate and available in the path. +Renovate often needs to use third-party binaries in its PRs, like `npm` to update `package-lock.json` or `go` to update `go.sum`. +By default, Renovate uses a child process to run such tools, so they must be: -Renovate can instead use "sidecar" containers for third-party tools when `binarySource=docker`. -If configured, Renovate will use `docker run` to create containers such as Node.js or Python to run tools within as-needed. +- installed before running Renovate +- available in the path + +But you can tell Renovate to use "sidecar" containers for third-party tools by setting `binarySource=docker`. For this to work, `docker` needs to be installed and the Docker socket available to Renovate. +Now Renovate uses `docker run` to create containers like Node.js or Python to run tools in as-needed. Additionally, when Renovate is run inside a container built using [`containerbase/buildpack`](https://github.com/containerbase/buildpack), such as the official Renovate images on Docker Hub, then `binarySource=install` can be used. This mode means that Renovate will dynamically install the version of tools available, if supported. @@ -143,7 +146,7 @@ Supported tools for dynamic install are: - `jb` - `npm` -Unsupported tools will fall back to `binarySource=global`. +Tools not on this list fall back to `binarySource=global`. ## cacheDir @@ -164,16 +167,16 @@ For example: ## customEnvVariables -This configuration will be applied after all other environment variables so that it can be used to override defaults. +This configuration will be applied after all other environment variables so you can use it to override defaults. ## detectGlobalManagerConfig -The purpose of this capability is to allow a bot admin to configure manager-specific files such as a global `.npmrc` file, instead of configuring it in Renovate config. +The purpose of this config option is to allow you (as a bot admin) to configure manager-specific files such as a global `.npmrc` file, instead of configuring it in Renovate config. -This feature is disabled by default because it may prove surprising or undesirable for some users who don't expect Renovate to go into their home directory and import registry or credential information. +This config option is disabled by default because it may prove surprising or undesirable for some users who don't expect Renovate to go into their home directory and import registry or credential information. -Currently this capability is supported for the `npm` manager only - specifically the `~/.npmrc` file. -If found, it will be imported into `config.npmrc` with `config.npmrcMerge` will be set to `true`. +Currently this config option is supported for the `npm` manager only - specifically the `~/.npmrc` file. +If found, it will be imported into `config.npmrc` with `config.npmrcMerge` set to `true`. ## detectHostRulesFromEnv @@ -190,7 +193,7 @@ Periods (`.`) in host names must be replaced with a single underscore (`_`). !!! note - The following prefixes cannot be supported for this functionality: `npm_config_`, `npm_lifecycle_`, `npm_package_`. + You can't use these prefixes with the `detectHostRulesFromEnv` config option: `npm_config_`, `npm_lifecycle_`, `npm_package_`. ### npmjs registry token example @@ -247,19 +250,22 @@ You can skip the host part, and use just the datasource and credentials. Adds a custom prefix to the default Renovate sidecar Docker containers name and label. -If this is set to `myprefix_` the final container created from `renovate/node` image would be named `myprefix_node` instead of currently used `renovate_node` and be labeled `myprefix_child` instead of `renovate_child`. +For example, if you set `dockerChildPrefix=myprefix_` then the final container created from the `renovate/node` is: + +- called `myprefix_node` instead of `renovate_node` +- labeled `myprefix_child` instead of `renovate_child` !!! note - Dangling containers will only be removed when Renovate runs again with the same prefix. + Dangling containers are only removed when Renovate runs again with the same prefix. ## dockerImagePrefix By default Renovate pulls the sidecar Docker containers from `docker.io/renovate`. You can use the `dockerImagePrefix` option to override this default. -Say you want to pull your images from `ghcr.io/renovatebot` instead of `docker.io/renovate`. -You would use put this in your configuration file: +Say you want to pull your images from `ghcr.io/renovatebot`. +You would put this in your configuration file: ```json { @@ -272,11 +278,11 @@ If you pulled a new `node` image, the final image would be `ghcr.io/renovatebot/ ## dockerUser Override default user and group used by Docker-based binaries. -The user-id (UID) and group-id (GID) should match the user that executes Renovate. +The user-id (UID) and group-id (GID) must match the user that executes Renovate. Read the [Docker run reference](https://docs.docker.com/engine/reference/run/#user) for more information on user and group syntax. Set this to `1001:1002` to use UID 1001 and GID 1002. -e.g. +For example: ```json { @@ -287,7 +293,6 @@ e.g. If you use `binarySource=docker|install` read the section below. If you need to change the Docker user please make sure to use the root (`0`) group, otherwise you'll get in trouble with missing file and directory permissions. - Like this: ``` @@ -316,11 +321,11 @@ If this option is not set, Renovate will fallback to 15 minutes. ## exposeAllEnv -By default, Renovate only passes a limited set of environment variables to package managers. +To keep you safe, Renovate only passes a limited set of environment variables to package managers. Confidential data can be leaked if a malicious script enumerates all environment variables. -Set `exposeAllEnv` to `true` only if you have reviewed (and trust) the repositories which Renovate bot runs against. +Set `exposeAllEnv` to `true` only if you have reviewed, and trust, the repositories which Renovate bot runs against. -Setting this to `true` will also allow for variable substitution in `.npmrc` files. +Setting this to `true` also allows for variable substitution in `.npmrc` files. ## force @@ -331,7 +336,7 @@ In practice, it is implemented by converting the `force` configuration into a `p ## forceCli -This is set to true by default, meaning that any settings (such as `schedule`) take maximum priority even against custom settings existing inside individual repositories. +This is set to `true` by default, meaning that any settings (such as `schedule`) take maximum priority even against custom settings existing inside individual repositories. It will also override any settings in `packageRules`. ## forkMode @@ -341,7 +346,7 @@ If this is set to `true` then Renovate will fork the repository into the persona ## forkToken -You probably have no need for this option - it is an experimental setting for the Renovate hosted GitHub App. +You probably don't need this option - it is an experimental setting for the Renovate hosted GitHub App. This should be set to a Personal Access Token (GitHub only) when `forkMode` is set to `true`. Renovate will use this token to fork the repository into the personal space of the person owning the Personal Access Token. Renovate will then create branches on the fork and opens Pull Requests on the parent repository. @@ -355,13 +360,13 @@ To learn more about Git hooks, read the [Pro Git 2 book, section on Git Hooks](h ## gitPrivateKey -This should be an armored private key, e.g. the type you get from running `gpg --export-secret-keys --armor 92066A17F0D1707B4E96863955FEF5171C45FAE5 > private.key`. +This should be an armored private key, so the type you get from running `gpg --export-secret-keys --armor 92066A17F0D1707B4E96863955FEF5171C45FAE5 > private.key`. Replace the newlines with `\n` before adding the resulting single-line value to your bot's config. It will be loaded _lazily_. Before the first commit in a repository, Renovate will: -1. Run `gpg import` (if it hasn't been run before) +1. Run `gpg import` (if you haven't before) 1. Run `git config user.signingkey` and `git config commit.gpgsign true` The `git` commands are run locally in the cloned repo instead of globally. @@ -424,7 +429,7 @@ In the above example any reference to the `@company` preset will be replaced wit ## onboarding -Set this to `false` only if all three statements are true: +Only set this to `false` if all three statements are true: - You've configured Renovate entirely on the bot side (e.g. empty `renovate.json` in repositories) - You want to run Renovate on every repository the bot has access to @@ -441,7 +446,7 @@ If you have an existing Renovate installation and you change `onboardingBranch` ## onboardingCommitMessage -If `commitMessagePrefix` or `semanticCommits` values are defined then they will be prepended to the commit message using the same logic that is used for adding them to non-onboarding commit messages. +If `commitMessagePrefix` or `semanticCommits` values are set then they will be prepended to the commit message using the same logic that is used for adding them to non-onboarding commit messages. ## onboardingConfig @@ -452,7 +457,7 @@ Falls back to `renovate.json` if the name provided is not valid. ## onboardingNoDeps -Set this to true if you want Renovate to create an onboarding PR even if no dependencies are found. +Set this to `true` if you want Renovate to create an onboarding PR even if no dependencies are found. Otherwise, Renovate skips onboarding a repository if it finds no dependencies in it. ## onboardingPrTitle @@ -465,7 +470,7 @@ Similarly to `onboardingBranch`, if you have an existing Renovate installation a ## persistRepoData -Set this to true if you want Renovate to persist repo data between runs. +Set this to `true` if you want Renovate to persist repo data between runs. The intention is that this allows Renovate to do a faster `git fetch` between runs rather than `git clone`. It also may mean that ignored directories like `node_modules` can be preserved and save time on operations like `npm install`. @@ -686,12 +691,12 @@ If enabled emoji shortcodes (`:warning:`) are replaced with their Unicode equiva ## username -You might need to set a `username` if you use: +You may need to set a `username` if you: -- The Bitbucket platform, or +- use the Bitbucket platform, or - use the GitHub App with CLI (required) -If you're using a Personal Access Token (PAT) to authenticate then you should not specify `username`. +If you're using a Personal Access Token (PAT) to authenticate then you should not set a `username`. ## writeDiscoveredRepos From 82295805afd1848fdab11b1a02dffc87b495602e Mon Sep 17 00:00:00 2001 From: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Date: Thu, 2 Jun 2022 12:22:01 +0200 Subject: [PATCH 004/240] docs(configuration options): rewrite regexManagers (#15844) --- docs/usage/configuration-options.md | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index a365744612291e..8bea41783359bc 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -2186,19 +2186,28 @@ Typically you shouldn't need to modify this setting. ## regexManagers -`regexManagers` entries are used to configure the `regex` Manager in Renovate. +Use `regexManagers` entries to configure the `regex` manager in Renovate. -Users can define custom managers for cases such as: +You can define custom managers for cases such as: - Proprietary file formats or conventions - Popular file formats not yet supported as a manager by Renovate The custom manager concept is based on using Regular Expression named capture groups. -For the fields `datasource`, `depName` and `currentValue`, it's mandatory to have either a named capture group matching them (e.g. `(?.*)`) or to configure it's corresponding template (e.g. `depNameTemplate`). -It's not recommended to do both, due to the potential for confusion. -It is recommended to also include `versioning` but if it is missing then it will default to `semver`. -For more details and examples, see the documentation page the for the regex manager [here](/modules/manager/regex/). +You must have a named capture group matching (e.g. `(?.*)`) _or_ configure it's corresponding template (e.g. `depNameTemplate`) for these fields: + +- `datasource` +- `depName` +- `currentValue` + +Use named capture group matching _or_ set a corresponding template. +We recommend you use only one of these methods, or you'll get confused. + +We recommend that you also tell Renovate what `versioning` to use. +If the `versioning` field is missing, then Renovate defaults to using `semver` versioning. + +For more details and examples, see our [documentation for the `regex` manager](/modules/manager/regex/). For template fields, use the triple brace `{{{ }}}` notation to avoid Handlebars escaping any special characters. ### matchStrings From 5495ab6394eb34f6a77d289e16d452d153823163 Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Thu, 2 Jun 2022 14:56:14 +0300 Subject: [PATCH 005/240] refactor: Enable strict null checks for lookup-related functionality (#15848) --- lib/config/types.ts | 4 +- lib/modules/manager/types.ts | 5 +- .../repository/process/lookup/bucket.ts | 2 +- .../process/lookup/filter-checks.ts | 28 ++++-- .../repository/process/lookup/filter.ts | 5 +- .../repository/process/lookup/generate.ts | 42 ++++---- .../repository/process/lookup/index.ts | 98 ++++++++++++------- .../repository/process/lookup/rollback.ts | 13 ++- .../repository/process/lookup/types.ts | 4 +- .../repository/process/lookup/update-type.ts | 4 +- tsconfig.strict.json | 9 -- 11 files changed, 128 insertions(+), 86 deletions(-) diff --git a/lib/config/types.ts b/lib/config/types.ts index e8dfa83833826d..739c606e32a555 100644 --- a/lib/config/types.ts +++ b/lib/config/types.ts @@ -410,10 +410,10 @@ export interface PackageRuleInputConfig extends Record { lockedVersion?: string; updateType?: UpdateType; isBump?: boolean; - sourceUrl?: string; + sourceUrl?: string | null; language?: string; baseBranch?: string; - manager?: string; + manager?: string | null; datasource?: string; packageRules?: (PackageRule & PackageRuleInputConfig)[]; } diff --git a/lib/modules/manager/types.ts b/lib/modules/manager/types.ts index ec0331a20ce5a5..1f1f542c39fcae 100644 --- a/lib/modules/manager/types.ts +++ b/lib/modules/manager/types.ts @@ -58,7 +58,7 @@ export interface RangeConfig> extends ManagerData { currentValue?: string; depName?: string; depType?: string; - manager?: string; + manager?: string | null; packageJsonType?: 'app' | 'library'; rangeStrategy: RangeStrategy; } @@ -145,6 +145,9 @@ export interface LookupUpdate { newVersion?: string; updateType?: UpdateType; userStrings?: Record; + checksumUrl?: string; + downloadUrl?: string; + releaseTimestamp?: any; } export interface PackageDependency> extends Package { diff --git a/lib/workers/repository/process/lookup/bucket.ts b/lib/workers/repository/process/lookup/bucket.ts index 8c951a050ef373..3c50a95f67ec43 100644 --- a/lib/workers/repository/process/lookup/bucket.ts +++ b/lib/workers/repository/process/lookup/bucket.ts @@ -11,7 +11,7 @@ export function getBucket( currentVersion: string, newVersion: string, versioning: VersioningApi -): string { +): string | null { const { separateMajorMinor, separateMultipleMajor, separateMinorPatch } = config; if (!separateMajorMinor) { diff --git a/lib/workers/repository/process/lookup/filter-checks.ts b/lib/workers/repository/process/lookup/filter-checks.ts index e76c6f541649b4..a290984b5ea3e7 100644 --- a/lib/workers/repository/process/lookup/filter-checks.ts +++ b/lib/workers/repository/process/lookup/filter-checks.ts @@ -26,7 +26,7 @@ export async function filterInternalChecks( sortedReleases: Release[] ): Promise { const { currentVersion, datasource, depName, internalChecksFilter } = config; - let release: Release; + let release: Release | undefined = undefined; let pendingChecks = false; let pendingReleases: Release[] = []; if (internalChecksFilter === 'none') { @@ -41,12 +41,13 @@ export async function filterInternalChecks( releaseConfig.updateType = getUpdateType( releaseConfig, versioning, - currentVersion, + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + currentVersion!, candidateRelease.version ); releaseConfig = mergeChildConfig( releaseConfig, - releaseConfig[releaseConfig.updateType] + releaseConfig[releaseConfig.updateType]! ); // Apply packageRules in case any apply to updateType releaseConfig = applyPackageRules(releaseConfig); @@ -69,15 +70,21 @@ export async function filterInternalChecks( continue; } } - if (isActiveConfidenceLevel(minimumConfidence)) { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + if (isActiveConfidenceLevel(minimumConfidence!)) { const confidenceLevel = await getMergeConfidenceLevel( - datasource, - depName, - currentVersion, + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + datasource!, + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + depName!, + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + currentVersion!, newVersion, - updateType + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + updateType! ); - if (!satisfiesConfidenceLevel(confidenceLevel, minimumConfidence)) { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + if (!satisfiesConfidenceLevel(confidenceLevel, minimumConfidence!)) { logger.debug( { depName, check: 'minimumConfidence' }, `Release ${candidateRelease.version} is pending status checks` @@ -106,5 +113,6 @@ export async function filterInternalChecks( } } } - return { release, pendingChecks, pendingReleases }; + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + return { release: release!, pendingChecks, pendingReleases }; } diff --git a/lib/workers/repository/process/lookup/filter.ts b/lib/workers/repository/process/lookup/filter.ts index 4f0f03c1acc695..fa5e63069944d5 100644 --- a/lib/workers/repository/process/lookup/filter.ts +++ b/lib/workers/repository/process/lookup/filter.ts @@ -50,7 +50,8 @@ export function filterVersions( const versionRelease = releases.find( (release) => release.version === v.version ); - if (versionRelease.isDeprecated) { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + if (versionRelease!.isDeprecated) { logger.trace( `Skipping ${config.depName}@${v.version} because it is deprecated` ); @@ -79,7 +80,7 @@ export function filterVersions( 'Falling back to npm semver syntax for allowedVersions' ); filteredVersions = filteredVersions.filter((v) => - semver.satisfies(semver.coerce(v.version), allowedVersions) + semver.satisfies(semver.coerce(v.version)!, allowedVersions) ); } else if ( config.versioning === poetryVersioning.id && diff --git a/lib/workers/repository/process/lookup/generate.ts b/lib/workers/repository/process/lookup/generate.ts index 058d9a9477867d..64e272350449a6 100644 --- a/lib/workers/repository/process/lookup/generate.ts +++ b/lib/workers/repository/process/lookup/generate.ts @@ -18,19 +18,26 @@ export function generateUpdate( const update: LookupUpdate = { bucket, newVersion, - newValue: null, + newValue: null!, }; - const releaseFields = [ - 'checksumUrl', - 'downloadUrl', - 'newDigest', - 'releaseTimestamp', - ]; - for (const field of releaseFields) { - if (release[field] !== undefined) { - update[field] = release[field]; - } + + // istanbul ignore if + if (release.checksumUrl !== undefined) { + update.checksumUrl = release.checksumUrl; + } + // istanbul ignore if + if (release.downloadUrl !== undefined) { + update.downloadUrl = release.downloadUrl; } + // istanbul ignore if + if (release.newDigest !== undefined) { + update.newDigest = release.newDigest; + } + // istanbul ignore if + if (release.releaseTimestamp !== undefined) { + update.releaseTimestamp = release.releaseTimestamp; + } + const { currentValue } = config; if (currentValue) { try { @@ -39,7 +46,7 @@ export function generateUpdate( rangeStrategy, currentVersion, newVersion, - }); + })!; } catch (err) /* istanbul ignore next */ { logger.warn( { err, currentValue, rangeStrategy, currentVersion, newVersion }, @@ -48,14 +55,14 @@ export function generateUpdate( update.newValue = currentValue; } } else { - update.newValue = currentValue; + update.newValue = currentValue!; } - update.newMajor = versioning.getMajor(newVersion); - update.newMinor = versioning.getMinor(newVersion); + update.newMajor = versioning.getMajor(newVersion)!; + update.newMinor = versioning.getMinor(newVersion)!; // istanbul ignore if if (!update.updateType && !currentVersion) { logger.debug({ update }, 'Update has no currentVersion'); - update.newValue = currentValue; + update.newValue = currentValue!; return update; } update.updateType = @@ -69,7 +76,8 @@ export function generateUpdate( } if ( rangeStrategy === 'bump' && - versioning.matches(newVersion, currentValue) + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + versioning.matches(newVersion, currentValue!) ) { update.isBump = true; } diff --git a/lib/workers/repository/process/lookup/index.ts b/lib/workers/repository/process/lookup/index.ts index 02d84803c3ce9b..33a1fbeefb40eb 100644 --- a/lib/workers/repository/process/lookup/index.ts +++ b/lib/workers/repository/process/lookup/index.ts @@ -67,7 +67,8 @@ export async function lookupUpdates( if (unconstrainedValue || isValid) { if ( !updatePinnedDependencies && - versioning.isSingleVersion(currentValue) + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + versioning.isSingleVersion(currentValue!) ) { res.skipReason = 'is-pinned'; return res; @@ -132,7 +133,9 @@ export async function lookupUpdates( } // Check that existing constraint can be satisfied const allSatisfyingVersions = allVersions.filter( - (v) => unconstrainedValue || versioning.matches(v.version, currentValue) + (v) => + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + unconstrainedValue || versioning.matches(v.version, currentValue!) ); if (rollbackPrs && !allSatisfyingVersions.length) { const rollback = getRollbackUpdate(config, allVersions, versioning); @@ -152,10 +155,12 @@ export async function lookupUpdates( updateType: 'replacement', newName: dependency.replacementName, newValue: versioning.getNewValue({ - currentValue, + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + currentValue: currentValue!, newVersion: dependency.replacementVersion, - rangeStrategy, - }), + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + rangeStrategy: rangeStrategy!, + })!, }); } // istanbul ignore next @@ -171,33 +176,43 @@ export async function lookupUpdates( .map((release) => release.version); let currentVersion: string; if (rangeStrategy === 'update-lockfile') { - currentVersion = lockedVersion; + currentVersion = lockedVersion!; } currentVersion ??= getCurrentVersion( - currentValue, - lockedVersion, + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + currentValue!, + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + lockedVersion!, versioning, - rangeStrategy, - latestVersion, + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + rangeStrategy!, + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + latestVersion!, nonDeprecatedVersions - ) || + )! || getCurrentVersion( - currentValue, - lockedVersion, + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + currentValue!, + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + lockedVersion!, versioning, - rangeStrategy, - latestVersion, + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + rangeStrategy!, + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + latestVersion!, allVersions.map((v) => v.version) - ); + )!; // istanbul ignore if - if (!currentVersion && lockedVersion) { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + if (!currentVersion! && lockedVersion) { return res; } - res.currentVersion = currentVersion; + res.currentVersion = currentVersion!; if ( currentValue && - currentVersion && + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + currentVersion! && rangeStrategy === 'pin' && !versioning.isSingleVersion(currentValue) ) { @@ -209,20 +224,23 @@ export async function lookupUpdates( rangeStrategy, currentVersion, newVersion: currentVersion, - }), - newMajor: versioning.getMajor(currentVersion), + })!, + newMajor: versioning.getMajor(currentVersion)!, }); } // istanbul ignore if - if (!versioning.isVersion(currentVersion)) { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + if (!versioning.isVersion(currentVersion!)) { res.skipReason = 'invalid-version'; return res; } // Filter latest, unstable, etc let filteredReleases = filterVersions( config, - currentVersion, - latestVersion, + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + currentVersion!, + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + latestVersion!, allVersions, versioning ).filter( @@ -237,7 +255,8 @@ export async function lookupUpdates( for (const release of filteredReleases) { const bucket = getBucket( config, - currentVersion, + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + currentVersion!, release.version, versioning ); @@ -269,16 +288,20 @@ export async function lookupUpdates( const update = generateUpdate( config, versioning, - rangeStrategy, - lockedVersion || currentVersion, + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + rangeStrategy!, + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + lockedVersion || currentVersion!, bucket, release ); if (pendingChecks) { update.pendingChecks = pendingChecks; } - if (pendingReleases.length) { - update.pendingVersions = pendingReleases.map((r) => r.version); + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + if (pendingReleases!.length) { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + update.pendingVersions = pendingReleases!.map((r) => r.version); } if (!update.newValue || update.newValue === currentValue) { if (!lockedVersion) { @@ -326,7 +349,8 @@ export async function lookupUpdates( // digest update res.updates.push({ updateType: 'digest', - newValue: currentValue, + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + newValue: currentValue!, }); } } else if (pinDigests) { @@ -336,21 +360,24 @@ export async function lookupUpdates( res.updates.push({ isPinDigest: true, updateType: 'pinDigest', - newValue: currentValue, + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + newValue: currentValue!, }); } } if (versioning.valueToVersion) { - res.currentVersion = versioning.valueToVersion(res.currentVersion); + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + res.currentVersion = versioning.valueToVersion(res.currentVersion!); for (const update of res.updates || []) { - update.newVersion = versioning.valueToVersion(update.newVersion); + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + update.newVersion = versioning.valueToVersion(update.newVersion!); } } // update digest for all for (const update of res.updates) { if (pinDigests || currentDigest) { update.newDigest = - update.newDigest || (await getDigest(config, update.newValue)); + update.newDigest || (await getDigest(config, update.newValue))!; } } } @@ -364,7 +391,8 @@ export async function lookupUpdates( (update) => update.newValue !== currentValue || update.isLockfileUpdate || - (update.newDigest && !update.newDigest.startsWith(currentDigest)) + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + (update.newDigest && !update.newDigest.startsWith(currentDigest!)) ); // If range strategy specified in config is 'in-range-only', also strip out updates where currentValue !== newValue if (config.rangeStrategy === 'in-range-only') { diff --git a/lib/workers/repository/process/lookup/rollback.ts b/lib/workers/repository/process/lookup/rollback.ts index 3ad692ed8947df..7c17a70340b843 100644 --- a/lib/workers/repository/process/lookup/rollback.ts +++ b/lib/workers/repository/process/lookup/rollback.ts @@ -8,7 +8,7 @@ export function getRollbackUpdate( config: RollbackConfig, versions: Release[], version: VersioningApi -): LookupUpdate { +): LookupUpdate | null { const { packageFile, versioning, depName, currentValue } = config; // istanbul ignore if if (!('isLessThanRange' in version)) { @@ -19,7 +19,8 @@ export function getRollbackUpdate( return null; } const lessThanVersions = versions.filter((v) => - version.isLessThanRange(v.version, currentValue) + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + version.isLessThanRange!(v.version, currentValue!) ); // istanbul ignore if if (!lessThanVersions.length) { @@ -45,14 +46,16 @@ export function getRollbackUpdate( return null; } const newValue = version.getNewValue({ - currentValue, + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + currentValue: currentValue!, rangeStrategy: 'replace', newVersion, }); return { bucket: 'rollback', - newMajor: version.getMajor(newVersion), - newValue, + newMajor: version.getMajor(newVersion)!, + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + newValue: newValue!, newVersion, updateType: 'rollback', }; diff --git a/lib/workers/repository/process/lookup/types.ts b/lib/workers/repository/process/lookup/types.ts index b06583fa9e30ce..4c10d150a5e420 100644 --- a/lib/workers/repository/process/lookup/types.ts +++ b/lib/workers/repository/process/lookup/types.ts @@ -52,10 +52,10 @@ export interface UpdateResult { dependencyUrl?: string; homepage?: string; deprecationMessage?: string; - sourceUrl?: string; + sourceUrl?: string | null; currentVersion?: string; isSingleVersion?: boolean; - skipReason: SkipReason; + skipReason?: SkipReason; releases: Release[]; fixedVersion?: string; updates: LookupUpdate[]; diff --git a/lib/workers/repository/process/lookup/update-type.ts b/lib/workers/repository/process/lookup/update-type.ts index 4c8f9dcebe5219..4da91f3e338ffa 100644 --- a/lib/workers/repository/process/lookup/update-type.ts +++ b/lib/workers/repository/process/lookup/update-type.ts @@ -13,10 +13,10 @@ export function getUpdateType( currentVersion: string, newVersion: string ): UpdateType { - if (versioning.getMajor(newVersion) > versioning.getMajor(currentVersion)) { + if (versioning.getMajor(newVersion)! > versioning.getMajor(currentVersion)!) { return 'major'; } - if (versioning.getMinor(newVersion) > versioning.getMinor(currentVersion)) { + if (versioning.getMinor(newVersion)! > versioning.getMinor(currentVersion)!) { return 'minor'; } return 'patch'; diff --git a/tsconfig.strict.json b/tsconfig.strict.json index 85ef1dd9a1c613..2315840d17b0b2 100644 --- a/tsconfig.strict.json +++ b/tsconfig.strict.json @@ -59,15 +59,6 @@ "lib/workers/repository/process/fetch.ts", "lib/workers/repository/process/index.ts", "lib/workers/repository/process/limits.ts", - "lib/workers/repository/process/lookup/bucket.ts", - "lib/workers/repository/process/lookup/current.ts", - "lib/workers/repository/process/lookup/filter-checks.ts", - "lib/workers/repository/process/lookup/filter.ts", - "lib/workers/repository/process/lookup/generate.ts", - "lib/workers/repository/process/lookup/index.ts", - "lib/workers/repository/process/lookup/rollback.ts", - "lib/workers/repository/process/lookup/types.ts", - "lib/workers/repository/process/lookup/update-type.ts", "lib/workers/repository/process/sort.ts", "lib/workers/repository/process/write.ts", "lib/workers/repository/process/vulnerabilities.ts", From bd6e42236c4ec45746d652ade5644eeebf47e4e2 Mon Sep 17 00:00:00 2001 From: RahulGautamSingh Date: Thu, 2 Jun 2022 18:16:22 +0530 Subject: [PATCH 006/240] refactor: add option endpoint to global config (#15843) --- lib/config/global.ts | 1 + lib/config/types.ts | 2 ++ lib/workers/repository/index.spec.ts | 11 ++++++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/config/global.ts b/lib/config/global.ts index ea336e2578104f..23eae864f9787e 100644 --- a/lib/config/global.ts +++ b/lib/config/global.ts @@ -23,6 +23,7 @@ export class GlobalConfig { 'privateKey', 'privateKeyOld', 'gitTimeout', + 'endpoint', ]; private static config: RepoGlobalConfig = {}; diff --git a/lib/config/types.ts b/lib/config/types.ts index 739c606e32a555..4c70d89b68bf31 100644 --- a/lib/config/types.ts +++ b/lib/config/types.ts @@ -95,6 +95,7 @@ export interface GlobalOnlyConfig { privateKeyPathOld?: string; redisUrl?: string; repositories?: RenovateRepository[]; + endpoint?: string; } // Config options used within the repository worker, but not user configurable @@ -120,6 +121,7 @@ export interface RepoGlobalConfig { privateKeyOld?: string; localDir?: string; cacheDir?: string; + endpoint?: string; } export interface LegacyAdminConfig { diff --git a/lib/workers/repository/index.spec.ts b/lib/workers/repository/index.spec.ts index 67f5578a2795e9..f2f0f982a151bf 100644 --- a/lib/workers/repository/index.spec.ts +++ b/lib/workers/repository/index.spec.ts @@ -19,7 +19,6 @@ describe('workers/repository/index', () => { beforeEach(() => { config = getConfig(); - GlobalConfig.set({ localDir: '' }); }); it('runs', async () => { @@ -27,5 +26,15 @@ describe('workers/repository/index', () => { const res = await renovateRepository(config); expect(res).toBeUndefined(); }); + + it('shows endpoint', async () => { + process.extractDependencies.mockResolvedValue(mock()); + const res = await renovateRepository({ + ...config, + endpoint: 'https://github.com', + }); + expect(GlobalConfig.get().endpoint).toBe('https://github.com'); + expect(res).toBeUndefined(); + }); }); }); From 82da704955133d7769c19114bbb475c39a543bc1 Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Thu, 2 Jun 2022 17:25:20 +0300 Subject: [PATCH 007/240] refactor: Strict null checks for extract-related functions (#15806) * refactor: Strict null checks for extract-related functions * Fix Co-authored-by: Michael Kriese --- lib/workers/repository/extract/file-match.ts | 9 ++++++--- lib/workers/repository/extract/index.ts | 7 ++++--- lib/workers/repository/extract/manager-files.ts | 3 ++- tsconfig.strict.json | 3 --- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/workers/repository/extract/file-match.ts b/lib/workers/repository/extract/file-match.ts index 834d0ba5c4661a..e13f180b041909 100644 --- a/lib/workers/repository/extract/file-match.ts +++ b/lib/workers/repository/extract/file-match.ts @@ -40,8 +40,10 @@ export function getFilteredFileList( fileList: string[] ): string[] { const { includePaths, ignorePaths } = config; - let filteredList = getIncludedFiles(fileList, includePaths); - filteredList = filterIgnoredFiles(filteredList, ignorePaths); + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + let filteredList = getIncludedFiles(fileList, includePaths!); + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + filteredList = filterIgnoredFiles(filteredList, ignorePaths!); return filteredList; } @@ -52,7 +54,8 @@ export function getMatchingFiles( const fileList = getFilteredFileList(config, allFiles); const { fileMatch, manager } = config; let matchedFiles: string[] = []; - for (const match of fileMatch) { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + for (const match of fileMatch!) { logger.debug(`Using file match: ${match} for manager ${manager}`); const re = regEx(match); matchedFiles = matchedFiles.concat( diff --git a/lib/workers/repository/extract/index.ts b/lib/workers/repository/extract/index.ts index 9c9c02794cb268..f24010ba9d3c53 100644 --- a/lib/workers/repository/extract/index.ts +++ b/lib/workers/repository/extract/index.ts @@ -16,10 +16,11 @@ export async function extractAllDependencies( config: RenovateConfig ): Promise> { let managerList = getManagerList(); - if (is.nonEmptyArray(config.enabledManagers)) { + const { enabledManagers } = config; + if (is.nonEmptyArray(enabledManagers)) { logger.debug('Applying enabledManagers filtering'); managerList = managerList.filter((manager) => - config.enabledManagers.includes(manager) + enabledManagers.includes(manager) ); } const extractList: WorkerExtractConfig[] = []; @@ -36,7 +37,7 @@ export async function extractAllDependencies( const managerConfig = getManagerConfig(config, manager); managerConfig.manager = manager; if (manager === 'regex') { - for (const regexManager of config.regexManagers) { + for (const regexManager of config.regexManagers ?? []) { tryConfig(mergeChildConfig(managerConfig, regexManager)); } } else { diff --git a/lib/workers/repository/extract/manager-files.ts b/lib/workers/repository/extract/manager-files.ts index 2b6549ba7b96b0..79a16b4543a348 100644 --- a/lib/workers/repository/extract/manager-files.ts +++ b/lib/workers/repository/extract/manager-files.ts @@ -42,7 +42,8 @@ export async function getManagerPackageFiles( } } } - return allPackageFiles; + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + return allPackageFiles!; } const packageFiles: PackageFile[] = []; for (const packageFile of fileList) { diff --git a/tsconfig.strict.json b/tsconfig.strict.json index 2315840d17b0b2..245cf31cc54808 100644 --- a/tsconfig.strict.json +++ b/tsconfig.strict.json @@ -33,9 +33,6 @@ "lib/workers/repository/changelog/index.ts", "lib/workers/repository/error-config.ts", "lib/workers/repository/error.ts", - "lib/workers/repository/extract/file-match.ts", - "lib/workers/repository/extract/index.ts", - "lib/workers/repository/extract/manager-files.ts", "lib/workers/repository/finalise/index.ts", "lib/workers/repository/finalise/prune.ts", "lib/workers/repository/index.ts", From c09b39e14c8155ffab14886ef3ffefdda3953ae2 Mon Sep 17 00:00:00 2001 From: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Date: Thu, 2 Jun 2022 16:52:33 +0200 Subject: [PATCH 008/240] docs(regex manager): one sentence per line (#15845) --- lib/modules/manager/regex/readme.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/modules/manager/regex/readme.md b/lib/modules/manager/regex/readme.md index 20b108eb8b4116..8543a9685c6dbe 100644 --- a/lib/modules/manager/regex/readme.md +++ b/lib/modules/manager/regex/readme.md @@ -8,7 +8,8 @@ This manager is unique in Renovate in that: ### Required Fields -The first two required fields are `fileMatch` and `matchStrings`. `fileMatch` works the same as any manager, while `matchStrings` is a `regexManagers` concept and is used for configuring a regular expression with named capture groups. +The first two required fields are `fileMatch` and `matchStrings`. +`fileMatch` works the same as any manager, while `matchStrings` is a `regexManagers` concept and is used for configuring a regular expression with named capture groups. In order for Renovate to look up a dependency and decide about updates, it then needs the following information about each dependency: @@ -49,7 +50,8 @@ You can use the Code Generator in the sidebar and copy the regex in the generate ### Configuration templates -In many cases, named capture groups alone won't be enough and you'll need to configure Renovate with additional information about how to look up a dependency. Continuing the above example with Yarn, here is the full config: +In many cases, named capture groups alone won't be enough and you'll need to configure Renovate with additional information about how to look up a dependency. +Continuing the above example with Yarn, here is the full config: ```json { @@ -66,7 +68,8 @@ In many cases, named capture groups alone won't be enough and you'll need to con ### Advanced Capture -Let's say that your `Dockerfile` has many `ENV` variables you want to keep updated and you prefer not to write one `regexManagers` rule per variable. Instead you could enhance your `Dockerfile` like the following: +Let's say that your `Dockerfile` has many `ENV` variables you want to keep updated and you prefer not to write one `regexManagers` rule per variable. +Instead you could enhance your `Dockerfile` like the following: ```Dockerfile ARG IMAGE=node:12@sha256:6e5264cd4cfaefd7174b2bc10c7f9a1c2b99d98d127fc57a802d264da9fb43bd @@ -104,6 +107,9 @@ The above (obviously not a complete `Dockerfile`, but abbreviated for this examp } ``` -In the above the `versioningTemplate` is not actually necessary because Renovate already defaults to `semver` versioning, but it has been included to help illustrate why we call these fields _templates_. They are named this way because they are compiled using Handlebars and so can be composed from values you collect in named capture groups. You will usually want to use the tripe brace `{{{ }}}` template (e.v. `{{{versioning}}}` to be safe because Handlebars escapes special characters by default with double braces. +In the above the `versioningTemplate` is not actually necessary because Renovate already defaults to `semver` versioning, but it has been included to help illustrate why we call these fields _templates_. +They are named this way because they are compiled using Handlebars and so can be composed from values you collect in named capture groups. +You will usually want to use the tripe brace `{{{ }}}` template (e.v. `{{{versioning}}}` to be safe because Handlebars escapes special characters by default with double braces. -By adding the comments to the `Dockerfile`, you can see that instead of four separate `regexManagers` being required, there is now only one - and the `Dockerfile` itself is now somewhat better documented too. The syntax we used there is completely arbitrary and you may choose your own instead if you prefer - just be sure to update your `matchStrings` regex. +By adding the comments to the `Dockerfile`, you can see that instead of four separate `regexManagers` being required, there is now only one - and the `Dockerfile` itself is now somewhat better documented too. +The syntax we used there is completely arbitrary and you may choose your own instead if you prefer - just be sure to update your `matchStrings` regex. From 5f21c63ba530632ebd7917c715c7142591383c92 Mon Sep 17 00:00:00 2001 From: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Date: Thu, 2 Jun 2022 16:58:52 +0200 Subject: [PATCH 009/240] docs: replace word therefore, plus other small changes (#15694) --- docs/usage/configuration-options.md | 20 ++++++++++--------- docs/usage/configuration-templates.md | 2 +- docs/usage/dependency-pinning.md | 11 +++++----- docs/usage/faq.md | 2 +- .../usage/getting-started/private-packages.md | 4 ++-- docs/usage/getting-started/running.md | 2 +- docs/usage/getting-started/use-cases.md | 2 +- docs/usage/key-concepts/automerge.md | 4 ++-- docs/usage/known-limitations.md | 6 +++--- docs/usage/noise-reduction.md | 3 ++- docs/usage/self-hosted-configuration.md | 2 +- docs/usage/updating-rebasing.md | 2 +- lib/modules/datasource/docker/readme.md | 2 +- lib/modules/manager/gomod/readme.md | 2 +- lib/modules/manager/pip-compile/readme.md | 3 +-- lib/modules/manager/pre-commit/readme.md | 2 +- 16 files changed, 36 insertions(+), 33 deletions(-) diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index 8bea41783359bc..f0e0314b8dfee0 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -133,7 +133,8 @@ If configured, Renovate will take a random sample of given size from assignees a ## automerge By default, Renovate raises PRs but leaves them to someone or something else to merge them. -By configuring this setting, you can enable Renovate to automerge PRs or even branches itself, therefore reducing the amount of human intervention required. +By configuring this setting, you allow Renovate to automerge PRs or even branches. +Using automerge reduces the amount of human intervention required. Usually you won't want to automerge _all_ PRs, for example most people would want to leave major dependency updates to a human to review first. You could configure Renovate to automerge all but major this way: @@ -510,8 +511,9 @@ Examples of what having a Dependency Dashboard will allow you to do: !!! tip - Enabling the Dependency Dashboard does not itself change any of the "control flow" of Renovate, e.g. it will otherwise still create and manage PRs exactly as it always has, including scheduling and rate limiting. - The Dependency Dashboard therefore provides visibility as well as additional control. + Just enabling the Dependency Dashboard doesn't change the "control flow" of Renovate. + Renovate still creates and manages PRs, and still follows your schedules and rate limits. + The Dependency Dashboard gives you extra visibility and control over your updates. ## dependencyDashboardApproval @@ -621,7 +623,7 @@ This option is evaluated at PR/MR creation time and is only supported on the fol !!! note GitLab implements draft status by checking whether the PR's title starts with certain strings. - Therefore, `draftPR` on GitLab is incompatible with the legacy method of triggering Renovate to rebase a PR by renaming the PR to start with `rebase!`. + This means that `draftPR` on GitLab is incompatible with the legacy method of triggering Renovate to rebase a PR by renaming the PR to start with `rebase!`. ## enabled @@ -1361,7 +1363,7 @@ This option exists to provide flexibility about whether `npmrc` strings in confi In some situations you need the ability to force override `.npmrc` contents in a repo (`npmrcMerge=false`) while in others you might want to simply supplement the settings already in the `.npmrc` (`npmrcMerge=true`). A use case for the latter is if you are a Renovate bot admin and wish to provide a default token for `npmjs.org` without removing any other `.npmrc` settings which individual repositories have configured (such as scopes/registries). -If `false` (default), it means that defining `config.npmrc` will result in any `.npmrc` file in the repo being overridden and therefore its values ignored. +If `false` (default), it means that defining `config.npmrc` will result in any `.npmrc` file in the repo being overridden and its values ignored. If configured to `true`, it means that any `.npmrc` file in the repo will have `config.npmrc` prepended to it before running `npm`. ## packageRules @@ -1446,7 +1448,7 @@ For example you have multiple `package.json` and want to use `dependencyDashboar ``` Important to know: Renovate will evaluate all `packageRules` and not stop once it gets a first match. -Therefore, you should order your `packageRules` in order of importance so that later rules can override settings from earlier rules if necessary. +You should order your `packageRules` in order of importance so that later rules can override settings from earlier rules if needed. ### allowedVersions @@ -2067,7 +2069,7 @@ This limit is enforced on a per-repository basis. If you configure `prCreation=not-pending`, then Renovate will wait until tests are non-pending (all pass or at least one fails) before creating PRs. However there are cases where PRs may remain in pending state forever, e.g. absence of tests or status checks that are configure to pending indefinitely. -Therefore we configure an upper limit for how long we wait until creating a PR. +This is why we configured an upper limit for how long we wait until creating a PR. !!! note @@ -2078,7 +2080,7 @@ Therefore we configure an upper limit for how long we wait until creating a PR. Sometimes Renovate needs to rate limit its creation of PRs, e.g. hourly or concurrent PR limits. In such cases it sorts/prioritizes by default based on the update type (e.g. patches raised before minor, minor before major). If you have dependencies that are more or less important than others then you can use the `prPriority` field for PR sorting. -The default value is 0, so therefore setting a negative value will make dependencies sort last, while higher values sort first. +The default value is 0, so setting a negative value will make dependencies sort last, while higher values sort first. Here's an example of how you would define PR priority so that devDependencies are raised last and `react` is raised first: @@ -2136,7 +2138,7 @@ Renovate's `"auto"` strategy works like this for npm: 5. Otherwise, replace the range. e.g. `"^2.0.0"` would be replaced by `"^3.0.0"` By default, Renovate assumes that if you are using ranges then it's because you want them to be wide/open. -Therefore, Renovate won't deliberately "narrow" any range by increasing the semver value inside. +Renovate won't deliberately "narrow" any range by increasing the semver value inside. For example, if your `package.json` specifies a value for `left-pad` of `^1.0.0` and the latest version on npmjs is `1.2.0`, then Renovate won't change anything because `1.2.0` satisfies the range. If instead you'd prefer to be updated to `^1.2.0` in cases like this, then configure `rangeStrategy` to `bump` in your Renovate config. diff --git a/docs/usage/configuration-templates.md b/docs/usage/configuration-templates.md index 0ea09b8b55f71a..512f8c04385cb6 100644 --- a/docs/usage/configuration-templates.md +++ b/docs/usage/configuration-templates.md @@ -30,7 +30,7 @@ Be careful, and consider creating a new "config help" post at the [discussions t ## Commit Message Renovate will use one commit per branch, this makes it easy for you to merge. -Therefore, the `commitMessage` reflects the contents of the branch and is usually the same as the PR title. +The `commitMessage` reflects the contents of the branch and is usually the same as the PR title. `commitMessage` has a default value of `{{commitMessagePrefix}} {{commitMessageAction}} {{commitMessageTopic}} {{commitMessageExtra}} {{commitMessageSuffix}}`, with the intention that you only edit some of those subcomponents. diff --git a/docs/usage/dependency-pinning.md b/docs/usage/dependency-pinning.md index b4c3dda3ca3803..f0bb261f8ebb7b 100644 --- a/docs/usage/dependency-pinning.md +++ b/docs/usage/dependency-pinning.md @@ -17,7 +17,7 @@ To ensure we're all talking about the same thing, it's important to define exact Historically, projects use SemVer ranges in their `package.json`. For instance, if you run `npm install foobar` you will see an entry like `"foobar": "^1.1.0"` added to your `package.json`. Verbosely, this means "any foobar version greater than or equal to 1.1.0 but less than 2". -Therefore the project will automatically use 1.1.1 if it's released, or 1.2.0, or 1.2.1, etc - meaning you will get not only patch updates but also feature (minor) releases too. +The project will automatically use `1.1.1` if it's released, or `1.2.0`, or `1.2.1`, etc - meaning you will get not only patch updates but also feature (minor) releases too. Another alternative is ranges like `"foobar": "~1.1.0"` which means "any foobar version greater than or equal to 1.1.0 but less than 1.2". This narrows the range to only patch updates to the 1.1 range. @@ -67,7 +67,7 @@ You would need to manually check and work out which dependency caused the failur Consider the same situation if instead you were _pinning_ dependency versions. Your `main` branch would not be broken because it's pinned to `foobar@1.1.0` - instead you'd just have a Pull Request for upgrading to `foobar@1.2.0` which would fail. You'd know not to merge it and can wait for `foobar@1.2.1` or later when it's fixed. -Therefore you know exactly what you're running and you know exactly what failed - you have great "visibility". +By pinning dependencies you know exactly what you're running and you know exactly what failed. Now consider a similar theoretical scenario where `foobar@1.2.0` is faulty but it is _not_ caught by any of your automated tests. This is more common and more dangerous. @@ -100,8 +100,9 @@ To some extent this is simply a trade-off for having your dependencies pinned an There are some dependencies that either (a) don't have the potential to break something in production, or (b) are fully tested by your tests. -For example, it's very hard for `eslint` to break anything in production. If your build/tests pass, then you are fine. -Therefore you should consider enabling automerge for all lint packages to save yourself the pointless click when you manually approve them each time. +For example, it's very hard for `eslint` to break anything in production. +If your build/tests pass, then you are fine. +Consider enabling automerge for all lint packages to save yourself the pointless click when you manually approve them each time. In this case you might wake up to 5/10 of your overnight Pull Requests having already merged themselves. Another example of a good candidate for automerging might be a database driver like `node-postgres` (`pg` on npm), if you have 100% test coverage of your API. @@ -182,7 +183,7 @@ The (broken) upgrade to `1.2.0` would have been explicitly proposed to you via a Meanwhile you could be upgrading all the other essential fixes of other dependencies without worrying about `foobar`. You could even be running `yarn upgrade` regularly to be getting _indirect_ package updates in the lockfile and seeing if everything still passes. -Therefore, the lock file does not solve the same SemVer problems that pinning solves - but it compliments it. +So the lock file does not solve the same SemVer problems that pinning solves - but it compliments it. For this reason our usual recommendation using a lock file regardless of whether you pin dependencies or not, and pinning even if you have a lock file. Don't forget though that our motto is "Flexible, so you don't need to be", so go ahead and configure however you want. diff --git a/docs/usage/faq.md b/docs/usage/faq.md index f59332e7a5ac97..4ba3e7d5f3abc4 100644 --- a/docs/usage/faq.md +++ b/docs/usage/faq.md @@ -51,7 +51,7 @@ The default branch name that Git uses is `master` (this will be changed to `main The Git-hosting ecosystem has settled on using `main` to replace `master`. When you create a new repository on say GitHub or GitLab, you'll get a `main` branch as your base branch. -It therefore makes sense for Renovate to replace `master` with `main` where possible as well. +We've replaced `master` with `main` in our documentation where possible. A branch name has no special meaning within the Git program, it's just a name. The base branch could be called `trunk` or `mainline` or `prod`, and Git would work just as well. diff --git a/docs/usage/getting-started/private-packages.md b/docs/usage/getting-started/private-packages.md index 46586c41ba4840..37afd34d9de68f 100644 --- a/docs/usage/getting-started/private-packages.md +++ b/docs/usage/getting-started/private-packages.md @@ -371,8 +371,8 @@ The solution to this is that you should break your presets into public and priva ### Encrypting secrets -It is strongly recommended that you don't commit secrets to repositories, including private ones, and this includes secrets needed by Renovate to access private modules. -Therefore the preferred approach to secrets is that the bot administrator configures them as `hostRules` which are then applied to all repositories which the bot accesses. +It is strongly recommended that you avoid committing secrets to repositories, including private ones, and this includes secrets needed by Renovate to access private modules. +The preferred approach to secrets is that the bot administrator configures them as `hostRules` which are then applied to all repositories which the bot accesses. If you need to provide credentials to the hosted Renovate App, please do this: diff --git a/docs/usage/getting-started/running.md b/docs/usage/getting-started/running.md index c657014ffd7dfe..ddded8a81a950d 100644 --- a/docs/usage/getting-started/running.md +++ b/docs/usage/getting-started/running.md @@ -23,7 +23,7 @@ Self-hosting Renovate means that you are the "administrator" of the bot, which e Renovate's Open Source CLI is built and distributed as the npm package `renovate`. You can run this directly in any Node.js environment - even via `npx` - and it will process all the repositories it is configured with, before exiting. When you install Renovate from npm it naturally does not come bundled with any third-party tools or languages such as Ruby, Python, Composer, Bundler, Poetry, etc. -Therefore if you need Renovate to support any non-npm lock files like Bundler then you'll need to make sure all required third-party tools are pre-installed in the same environment alongside Renovate before you run it. +If you need Renovate to support any non-npm lock files like Bundler then you'll need to make sure all required third-party tools are pre-installed in the same environment alongside Renovate before you run it. The `renovate` npm package is compatible with all of Renovate's supported platforms. diff --git a/docs/usage/getting-started/use-cases.md b/docs/usage/getting-started/use-cases.md index 8a2e17d7ff6907..75379e12d652a1 100644 --- a/docs/usage/getting-started/use-cases.md +++ b/docs/usage/getting-started/use-cases.md @@ -39,7 +39,7 @@ npm, Yarn, Bundler, Composer, Poetry, Pipenv, and Cargo all support or use lock If you use a lock file then changes to your package file must come with a compatible change to the lock file. Renovate can patch/update package files directly, but a lock file is too complex to "reverse engineer". -Therefore Renovate lets the package manager do the lock file update. +This is why Renovate lets the package manager do the lock file update. A simplified example: 1. The repository has a `package.json` and `package-lock.json` with version `1.0.0` of a dependency diff --git a/docs/usage/key-concepts/automerge.md b/docs/usage/key-concepts/automerge.md index 71b8a77982208d..22160cd4fe97d5 100644 --- a/docs/usage/key-concepts/automerge.md +++ b/docs/usage/key-concepts/automerge.md @@ -15,7 +15,7 @@ If you or others keep committing to the default branch then Renovate cannot find Once a branch is automerged, the "Git state" needs to be recalculated for every remaining branch. At times, merging one branch could result in another branch's updates being changed or even removed as unnecessary. Renovate's approach is to ensure that automerging branches are up-to-date with their target branch before automerging. -Therefore merging multiple branches in a row won't reliably work, we prefer not to do that. +This means merging multiple branches in a row won't work reliably, so we prefer not to do that. What all this means is that Renovate will only automerge at most one branch/PR per target branch per run, before you need to wait for the next run. As a general guide, we recommend that you enable automerge for any type of dependency updates where you would just click "merge" anyway. @@ -66,7 +66,7 @@ But in many cases the new version(s) will pass tests, and if so then there's rea ### Automerge non-major updates -Non-major updates in SemVer ecosystems shouldn't have breaking changes (if they follow the spec), therefore many users enable automerge for these too: +Non-major updates in SemVer ecosystems shouldn't have breaking changes (if they follow the spec), so many users enable automerge for these too: ```json { diff --git a/docs/usage/known-limitations.md b/docs/usage/known-limitations.md index 87a12f6709b94f..a3ec63ca8563e7 100644 --- a/docs/usage/known-limitations.md +++ b/docs/usage/known-limitations.md @@ -26,9 +26,9 @@ For this reason, it's best to allow for a minimum 2-3 hours schedule window per ## Automerge limitations -Renovate automerges at most one branch per run. -Renovate will only automerge a branch when it is up-to-date with the target branch. -Therefore, Renovate may not be able to automerge as many branches as you expect, especially if your base branch is receiving regular commits at the same time. +- Renovate automerges at most one branch per run +- Renovate will only automerge a branch when it is up-to-date with the target branch +- Renovate may not be able to automerge as many branches as you expect, especially if your base branch is receiving regular commits at the same time The limitation to only merge one branch per run is because Renovate's dependency and branch state is based on what was present in the base branch at the start of the run. If a branch is merged into the base branch during Renovate's run - including by other users - it means that remaining Renovate branches may have Git conflicts. diff --git a/docs/usage/noise-reduction.md b/docs/usage/noise-reduction.md index ec2cf2a67007fd..b19ca456c78cf6 100644 --- a/docs/usage/noise-reduction.md +++ b/docs/usage/noise-reduction.md @@ -52,8 +52,9 @@ For a high level overview of scheduling when Renovate bot runs, read the [key co On its own, the Renovate CLI tool runs once and then exits. Hence, it only runs as often as its administrator sets it to (e.g. via `cron`). + For the [Renovate app on GitHub](https://github.com/apps/renovate), it currently runs continuously using a job queue that gets refreshed hourly, or when you make relevant commits to your repository. -Therefore, you can expect to get PRs at any time of the day, e.g. soon after versions are published to npm. +You can expect to get PRs at any time of the day, e.g. soon after versions are published to npm. Receiving PRs at any hour can increase the feeling of being "overwhelmed" by updates and possibly interrupt your flow during working hours, so many Renovate users also consider reducing Renovate's schedule to be outside their normal working hours, for example weeknights and weekends. This is achievable by configuring `schedule` in your Renovate config and optionally `timezone` (Renovate's default time zone is UTC, so you may find it easier to write schedules if you override `timezone` to your local one). diff --git a/docs/usage/self-hosted-configuration.md b/docs/usage/self-hosted-configuration.md index 12c31085c6e8eb..6b4a84336f5406 100644 --- a/docs/usage/self-hosted-configuration.md +++ b/docs/usage/self-hosted-configuration.md @@ -396,7 +396,7 @@ Disabling the warning is helpful for self-hosted environments that can't access ## globalExtends Unlike the `extends` field, which is passed through unresolved to be part of repository config, any presets in `globalExtends` are resolved immediately as part of global config. -Therefore you need to use this field if your preset has any global-only configuration options, such as the list of repositories to run against. +Use the `globalExtends` field if your preset has any global-only configuration options, such as the list of repositories to run against. Use the `extends` field instead of this if, for example, you need the ability for a repository config (e.g. `renovate.json`) to be able to use `ignorePresets` for any preset defined in global config. diff --git a/docs/usage/updating-rebasing.md b/docs/usage/updating-rebasing.md index 706d06cb08c465..35eae7b54b5831 100644 --- a/docs/usage/updating-rebasing.md +++ b/docs/usage/updating-rebasing.md @@ -57,7 +57,7 @@ Or you can add a "rebase" label to the PR. The label name is configurable via the `rebaseLabel` option. If you apply a rebase label then Renovate will regenerate its commit for the branch, even if the branch has been modified. -Therefore it is useful in situations such as: +The rebase label is useful in situations like: - If a branch is stale but you don't have `rebaseWhen=behind-base-branch` enabled - If a branch has been edited and you want to discard the edits and have Renovate create it again diff --git a/lib/modules/datasource/docker/readme.md b/lib/modules/datasource/docker/readme.md index ab423d17091fce..e8012fce9ad3fa 100644 --- a/lib/modules/datasource/docker/readme.md +++ b/lib/modules/datasource/docker/readme.md @@ -2,7 +2,7 @@ This datasource identifies an image's source repository according to the [pre-de This datasource looks for the metadata of the **latest stable** image found on the Docker registry and uses the value of the label `org.opencontainers.image.source` and `org.label-schema.vcs-url` as the `sourceUrl`. -The [Label Schema](https://label-schema.org/) is superseded by OCI annotations, therefore `org.opencontainers.image.source` label should be preferred. +The [Label Schema](https://label-schema.org/) is superseded by OCI annotations, use the `org.opencontainers.image.source` label if possible. If you maintain a Docker image and want Renovate to find your changelogs, add a `org.opencontainers.image.source` field to your Dockerfile. The link must point to your GitHub or GitLab repository. diff --git a/lib/modules/manager/gomod/readme.md b/lib/modules/manager/gomod/readme.md index f41d8b140fb2fd..8d2a59ee7eb978 100644 --- a/lib/modules/manager/gomod/readme.md +++ b/lib/modules/manager/gomod/readme.md @@ -7,4 +7,4 @@ You might be interested in the following `postUpdateOptions`: 1. `gomodMassage` - to enable massaging of all `replace` statements prior to running `go` so that they will be ignored. When Renovate is running using `binarySource=docker` (such as in the hosted Mend Renovate app) then it will pick the latest compatible version of Go to run, i.e. the latest `1.x` release. -Therefore even if the `go.mod` has a version like `go 1.14`, you will see Renovate treating that as a `^1.14` constraint and not `=1.14`. +Even if the `go.mod` has a version like `go 1.14`, Renovate will treat it as a `^1.14` constraint and not `=1.14`. diff --git a/lib/modules/manager/pip-compile/readme.md b/lib/modules/manager/pip-compile/readme.md index 981635be2bf3ac..894002ffa6cbcf 100644 --- a/lib/modules/manager/pip-compile/readme.md +++ b/lib/modules/manager/pip-compile/readme.md @@ -21,8 +21,7 @@ You can "activate" the manager by specifying a `fileMatch` pattern such as: If Renovate matches/extracts a file, it assumes that the corresponding output file is found by swapping the `.in` for `.txt`. e.g. `requirements.in` => `requirements.txt` - -Therefore it will not work if files are in separate directories, including `input/requirements.in` and `output/requirements.txt`. +It will not work if files are in separate directories, including `input/requirements.in` and `output/requirements.txt`. If no `.in` suffix is found, then a `.txt` suffix is appended for the output file, e.g. `foo.file` would look for a corresponding `foo.file.txt`. diff --git a/lib/modules/manager/pre-commit/readme.md b/lib/modules/manager/pre-commit/readme.md index 04d9d97af54097..0878f3975f2141 100644 --- a/lib/modules/manager/pre-commit/readme.md +++ b/lib/modules/manager/pre-commit/readme.md @@ -1,6 +1,6 @@ _Important note_: The `pre-commit` manager is disabled by default and must be opted into through config. Renovate's approach to version updating is not fully aligned with `pre-commit upgrade` and this has caused frustration for `pre-commit`'s creator/maintainer. -Attempts to work with the `pre-commit` project to fix these gaps have been rejected, so therefore we have chosen to disable the manager by default indefinitely. +Attempts to work with the `pre-commit` project to fix these gaps have been rejected, so we have chosen to disable the manager by default indefinitely. Please do not contact the `pre-commit` project/maintainer about any Renovate-related topic. To view a list of open issues related to the `pre-commit` manager in Renovate, see the [filtered list using the `manager:pre-commit` label](https://github.com/renovatebot/renovate/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Amanager%3Apre-commit). From 000598cfa3f93edab516231d8399c9f0ed065387 Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Thu, 2 Jun 2022 21:20:34 +0200 Subject: [PATCH 010/240] refactor: Revert "refactor: add option endpoint to global config (#15843)" --- lib/config/global.ts | 1 - lib/config/types.ts | 2 -- lib/workers/repository/index.spec.ts | 11 +---------- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/lib/config/global.ts b/lib/config/global.ts index 23eae864f9787e..ea336e2578104f 100644 --- a/lib/config/global.ts +++ b/lib/config/global.ts @@ -23,7 +23,6 @@ export class GlobalConfig { 'privateKey', 'privateKeyOld', 'gitTimeout', - 'endpoint', ]; private static config: RepoGlobalConfig = {}; diff --git a/lib/config/types.ts b/lib/config/types.ts index 4c70d89b68bf31..739c606e32a555 100644 --- a/lib/config/types.ts +++ b/lib/config/types.ts @@ -95,7 +95,6 @@ export interface GlobalOnlyConfig { privateKeyPathOld?: string; redisUrl?: string; repositories?: RenovateRepository[]; - endpoint?: string; } // Config options used within the repository worker, but not user configurable @@ -121,7 +120,6 @@ export interface RepoGlobalConfig { privateKeyOld?: string; localDir?: string; cacheDir?: string; - endpoint?: string; } export interface LegacyAdminConfig { diff --git a/lib/workers/repository/index.spec.ts b/lib/workers/repository/index.spec.ts index f2f0f982a151bf..67f5578a2795e9 100644 --- a/lib/workers/repository/index.spec.ts +++ b/lib/workers/repository/index.spec.ts @@ -19,6 +19,7 @@ describe('workers/repository/index', () => { beforeEach(() => { config = getConfig(); + GlobalConfig.set({ localDir: '' }); }); it('runs', async () => { @@ -26,15 +27,5 @@ describe('workers/repository/index', () => { const res = await renovateRepository(config); expect(res).toBeUndefined(); }); - - it('shows endpoint', async () => { - process.extractDependencies.mockResolvedValue(mock()); - const res = await renovateRepository({ - ...config, - endpoint: 'https://github.com', - }); - expect(GlobalConfig.get().endpoint).toBe('https://github.com'); - expect(res).toBeUndefined(); - }); }); }); From cf6885f71a03a58ae122a2af560b7dd462886bda Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Fri, 3 Jun 2022 06:43:58 +0200 Subject: [PATCH 011/240] fix(config): move endpoint, platform to GlobalConfig (#15864) Co-authored-by: Michael Kriese --- lib/config/global.ts | 2 + lib/config/presets/index.spec.ts | 21 ---- lib/config/presets/index.ts | 1 - lib/config/presets/local/index.spec.ts | 105 +++++++++--------- lib/config/presets/local/index.ts | 7 +- lib/config/presets/types.ts | 1 - lib/config/types.ts | 8 +- .../manager/gitlabci-include/extract.spec.ts | 24 ++-- .../manager/gitlabci-include/extract.ts | 16 +-- lib/modules/manager/npm/post-update/index.ts | 4 +- lib/modules/manager/types.ts | 2 - lib/util/cache/repository/index.spec.ts | 2 +- lib/util/cache/repository/init.ts | 10 +- lib/workers/global/index.ts | 4 +- lib/workers/repository/init/index.ts | 4 +- .../onboarding/branch/config.spec.ts | 1 + .../repository/onboarding/branch/config.ts | 7 +- lib/workers/types.ts | 1 - 18 files changed, 94 insertions(+), 126 deletions(-) diff --git a/lib/config/global.ts b/lib/config/global.ts index ea336e2578104f..db0b80366beab1 100644 --- a/lib/config/global.ts +++ b/lib/config/global.ts @@ -23,6 +23,8 @@ export class GlobalConfig { 'privateKey', 'privateKeyOld', 'gitTimeout', + 'platform', + 'endpoint', ]; private static config: RepoGlobalConfig = {}; diff --git a/lib/config/presets/index.spec.ts b/lib/config/presets/index.spec.ts index c692bffdc94a3c..d6a562dbfe7d32 100644 --- a/lib/config/presets/index.spec.ts +++ b/lib/config/presets/index.spec.ts @@ -287,7 +287,6 @@ describe('config/presets/index', () => { expect(res.labels).toEqual(['self-hosted resolved']); expect(local.getPreset.mock.calls).toHaveLength(1); - expect(local.getPreset.mock.calls[0][0].baseConfig).toBeDefined(); expect(res).toMatchSnapshot(); }); @@ -308,26 +307,6 @@ describe('config/presets/index', () => { endpoint: 'https://dummy.example.com/api/v4', labels: ['self-hosted resolved'], }); - expect(local.getPreset.mock.calls).toMatchObject([ - [ - { - baseConfig: { - platform: 'gitlab', - endpoint: 'https://dummy.example.com/api/v4', - extends: ['local>username/preset-repo'], - }, - }, - ], - [ - { - baseConfig: { - platform: 'gitlab', - endpoint: 'https://dummy.example.com/api/v4', - extends: ['local>username/preset-repo'], - }, - }, - ], - ]); }); }); diff --git a/lib/config/presets/index.ts b/lib/config/presets/index.ts index 04deef121484d5..506c7f042c2dfb 100644 --- a/lib/config/presets/index.ts +++ b/lib/config/presets/index.ts @@ -222,7 +222,6 @@ export async function getPreset( repo, presetPath, presetName, - baseConfig, tag, }); if (!presetConfig) { diff --git a/lib/config/presets/local/index.spec.ts b/lib/config/presets/local/index.spec.ts index 44aec13e4409ed..17c4c6499f9880 100644 --- a/lib/config/presets/local/index.spec.ts +++ b/lib/config/presets/local/index.spec.ts @@ -1,4 +1,5 @@ import { mocked } from '../../../../test/util'; +import { GlobalConfig } from '../../global'; import * as _azure from '../azure'; import * as _bitbucket from '../bitbucket'; import * as _bitbucketServer from '../bitbucket-server'; @@ -34,62 +35,66 @@ describe('config/presets/local/index', () => { }); describe('getPreset()', () => { + beforeEach(() => { + GlobalConfig.reset(); + }); + it('throws for unsupported platform', async () => { + GlobalConfig.set({ + platform: 'unsupported-platform', + }); await expect(async () => { await local.getPreset({ repo: 'some/repo', presetName: 'default', - baseConfig: { - platform: 'unsupported-platform', - }, }); }).rejects.toThrow(); }); it('throws for missing platform', async () => { + GlobalConfig.set({ + platform: undefined, + }); await expect(async () => { await local.getPreset({ repo: 'some/repo', presetName: 'default', - baseConfig: { - platform: undefined, - }, }); }).rejects.toThrow(); }); it('forwards to azure', async () => { + GlobalConfig.set({ + platform: 'azure', + }); const content = await local.getPreset({ repo: 'some/repo', presetName: 'default', - baseConfig: { - platform: 'azure', - }, }); expect(azure.getPresetFromEndpoint.mock.calls).toMatchSnapshot(); expect(content).toEqual({ resolved: 'preset' }); }); it('forwards to bitbucket', async () => { + GlobalConfig.set({ + platform: 'bitbucket', + }); const content = await local.getPreset({ repo: 'some/repo', presetName: 'default', - baseConfig: { - platform: 'bitbucket', - }, }); expect(bitbucket.getPresetFromEndpoint.mock.calls).toMatchSnapshot(); expect(content).toEqual({ resolved: 'preset' }); }); it('forwards to custom bitbucket-server', async () => { + GlobalConfig.set({ + platform: 'bitbucket-server', + endpoint: 'https://git.example.com', + }); const content = await local.getPreset({ repo: 'some/repo', presetName: 'default', - baseConfig: { - platform: 'bitbucket-server', - endpoint: 'https://git.example.com', - }, }); expect( bitbucketServer.getPresetFromEndpoint.mock.calls @@ -98,126 +103,124 @@ describe('config/presets/local/index', () => { }); it('forwards to gitea', async () => { + GlobalConfig.set({ + platform: 'gitea', + }); const content = await local.getPreset({ repo: 'some/repo', - baseConfig: { - platform: 'gitea', - }, }); expect(gitea.getPresetFromEndpoint.mock.calls).toMatchSnapshot(); expect(content).toEqual({ resolved: 'preset' }); }); it('forwards to custom gitea', async () => { + GlobalConfig.set({ + platform: 'gitea', + endpoint: 'https://api.gitea.example.com', + }); const content = await local.getPreset({ repo: 'some/repo', presetName: 'default', - baseConfig: { - platform: 'gitea', - endpoint: 'https://api.gitea.example.com', - }, }); expect(gitea.getPresetFromEndpoint.mock.calls).toMatchSnapshot(); expect(content).toEqual({ resolved: 'preset' }); }); it('forwards to github', async () => { + GlobalConfig.set({ + platform: 'github', + }); const content = await local.getPreset({ repo: 'some/repo', - baseConfig: { - platform: 'github', - }, }); expect(github.getPresetFromEndpoint.mock.calls).toMatchSnapshot(); expect(content).toEqual({ resolved: 'preset' }); }); it('forwards to custom github', async () => { + GlobalConfig.set({ + platform: 'github', + endpoint: 'https://api.github.example.com', + }); const content = await local.getPreset({ repo: 'some/repo', presetName: 'default', - baseConfig: { - platform: 'github', - endpoint: 'https://api.github.example.com', - }, }); expect(github.getPresetFromEndpoint.mock.calls).toMatchSnapshot(); expect(content).toEqual({ resolved: 'preset' }); }); it('forwards to github with a tag', async () => { + GlobalConfig.set({ + platform: 'github', + }); const content = await local.getPreset({ repo: 'some/repo', tag: 'someTag', - baseConfig: { - platform: 'github', - }, }); expect(github.getPresetFromEndpoint.mock.calls).toMatchSnapshot(); expect(content).toEqual({ resolved: 'preset' }); }); it('forwards to custom github with a tag', async () => { + GlobalConfig.set({ + platform: 'github', + endpoint: 'https://api.github.example.com', + }); const content = await local.getPreset({ repo: 'some/repo', presetName: 'default', tag: 'someTag', - baseConfig: { - platform: 'github', - endpoint: 'https://api.github.example.com', - }, }); expect(github.getPresetFromEndpoint.mock.calls).toMatchSnapshot(); expect(content).toEqual({ resolved: 'preset' }); }); it('forwards to gitlab', async () => { + GlobalConfig.set({ + platform: 'GitLab', + }); const content = await local.getPreset({ repo: 'some/repo', presetName: 'default', - baseConfig: { - platform: 'GitLab', - }, }); expect(gitlab.getPresetFromEndpoint.mock.calls).toMatchSnapshot(); expect(content).toEqual({ resolved: 'preset' }); }); it('forwards to custom gitlab', async () => { + GlobalConfig.set({ + platform: 'gitlab', + endpoint: 'https://gitlab.example.com/api/v4', + }); const content = await local.getPreset({ repo: 'some/repo', presetName: 'default', - baseConfig: { - platform: 'gitlab', - endpoint: 'https://gitlab.example.com/api/v4', - }, }); expect(gitlab.getPresetFromEndpoint.mock.calls).toMatchSnapshot(); expect(content).toEqual({ resolved: 'preset' }); }); it('forwards to gitlab with a tag', async () => { + GlobalConfig.set({ platform: 'GitLab' }); const content = await local.getPreset({ repo: 'some/repo', presetName: 'default', tag: 'someTag', - baseConfig: { - platform: 'GitLab', - }, }); expect(gitlab.getPresetFromEndpoint.mock.calls).toMatchSnapshot(); expect(content).toEqual({ resolved: 'preset' }); }); it('forwards to custom gitlab with a tag', async () => { + GlobalConfig.set({ + platform: 'gitlab', + endpoint: 'https://gitlab.example.com/api/v4', + }); const content = await local.getPreset({ repo: 'some/repo', presetName: 'default', tag: 'someTag', - baseConfig: { - platform: 'gitlab', - endpoint: 'https://gitlab.example.com/api/v4', - }, }); expect(gitlab.getPresetFromEndpoint.mock.calls).toMatchSnapshot(); expect(content).toEqual({ resolved: 'preset' }); diff --git a/lib/config/presets/local/index.ts b/lib/config/presets/local/index.ts index 57aff34349d9bd..6b951eeea3e5fd 100644 --- a/lib/config/presets/local/index.ts +++ b/lib/config/presets/local/index.ts @@ -1,4 +1,5 @@ import { PlatformId } from '../../../constants'; +import { GlobalConfig } from '../../global'; import * as azure from '../azure'; import * as bitbucket from '../bitbucket'; import * as bitbucketServer from '../bitbucket-server'; @@ -21,9 +22,8 @@ export function getPreset({ presetName = 'default', presetPath, tag, - baseConfig, }: PresetConfig): Promise { - const { platform, endpoint } = baseConfig ?? {}; + const { platform, endpoint } = GlobalConfig.get(); if (!platform) { throw new Error(`Missing platform config for local preset.`); } @@ -31,8 +31,7 @@ export function getPreset({ if (!resolver) { throw new Error( // TODO: can be undefined? #7154 - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion - `Unsupported platform '${baseConfig!.platform}' for local preset.` + `Unsupported platform '${platform}' for local preset.` ); } return resolver.getPresetFromEndpoint( diff --git a/lib/config/presets/types.ts b/lib/config/presets/types.ts index ce920d8f9a1021..cc31c2e27ab4a9 100644 --- a/lib/config/presets/types.ts +++ b/lib/config/presets/types.ts @@ -7,7 +7,6 @@ export type PresetConfig = { repo: string; presetPath?: string; presetName?: string; - baseConfig?: RenovateConfig; tag?: string; }; diff --git a/lib/config/types.ts b/lib/config/types.ts index 739c606e32a555..e49d86f2d5be65 100644 --- a/lib/config/types.ts +++ b/lib/config/types.ts @@ -51,7 +51,6 @@ export interface RenovateSharedConfig { hashedBranchLength?: number; npmrc?: string; npmrcMerge?: boolean; - platform?: string; postUpgradeTasks?: PostUpgradeTasks; prBodyColumns?: string[]; prBodyDefinitions?: Record; @@ -95,6 +94,8 @@ export interface GlobalOnlyConfig { privateKeyPathOld?: string; redisUrl?: string; repositories?: RenovateRepository[]; + platform?: string; + endpoint?: string; } // Config options used within the repository worker, but not user configurable @@ -120,11 +121,11 @@ export interface RepoGlobalConfig { privateKeyOld?: string; localDir?: string; cacheDir?: string; + platform?: string; + endpoint?: string; } export interface LegacyAdminConfig { - endpoint?: string; - localDir?: string; logContext?: string; @@ -137,7 +138,6 @@ export interface LegacyAdminConfig { onboardingConfig?: RenovateSharedConfig; onboardingConfigFileName?: string; - platform?: string; requireConfig?: RequiredConfig; } export type ExecutionMode = 'branch' | 'update'; diff --git a/lib/modules/manager/gitlabci-include/extract.spec.ts b/lib/modules/manager/gitlabci-include/extract.spec.ts index 201ff682a617d9..1a384e662a359a 100644 --- a/lib/modules/manager/gitlabci-include/extract.spec.ts +++ b/lib/modules/manager/gitlabci-include/extract.spec.ts @@ -1,4 +1,5 @@ import { loadFixture } from '../../../../test/util'; +import { GlobalConfig } from '../../../config/global'; import { extractPackageFile } from './extract'; const yamlFileMultiConfig = loadFixture('gitlab-ci.1.yaml'); @@ -8,32 +9,22 @@ const yamlWithEmptyIncludeConfig = loadFixture('gitlab-ci.3.yaml'); describe('modules/manager/gitlabci-include/extract', () => { describe('extractPackageFile()', () => { it('returns null for empty', () => { - expect( - extractPackageFile('nothing here', '.gitlab-ci.yml', {}) - ).toBeNull(); + expect(extractPackageFile('nothing here')).toBeNull(); }); it('returns null for include block without any actual includes', () => { - const res = extractPackageFile( - yamlWithEmptyIncludeConfig, - '.gitlab-ci.yml', - {} - ); + const res = extractPackageFile(yamlWithEmptyIncludeConfig); expect(res).toBeNull(); }); it('extracts single include block', () => { - const res = extractPackageFile( - yamlFileSingleConfig, - '.gitlab-ci.yml', - {} - ); + const res = extractPackageFile(yamlFileSingleConfig); expect(res.deps).toMatchSnapshot(); expect(res.deps).toHaveLength(1); }); it('extracts multiple include blocks', () => { - const res = extractPackageFile(yamlFileMultiConfig, '.gitlab-ci.yml', {}); + const res = extractPackageFile(yamlFileMultiConfig); expect(res.deps).toMatchSnapshot(); expect(res.deps).toHaveLength(3); }); @@ -45,9 +36,8 @@ describe('modules/manager/gitlabci-include/extract', () => { ]; for (const endpoint of endpoints) { - const res = extractPackageFile(yamlFileMultiConfig, '.gitlab-ci.yml', { - endpoint, - }); + GlobalConfig.set({ platform: 'gitlab', endpoint }); + const res = extractPackageFile(yamlFileMultiConfig); expect(res.deps[0].registryUrls[0]).toBe('http://gitlab.test'); } }); diff --git a/lib/modules/manager/gitlabci-include/extract.ts b/lib/modules/manager/gitlabci-include/extract.ts index cfb52a5f40d012..ea6be88efc4241 100644 --- a/lib/modules/manager/gitlabci-include/extract.ts +++ b/lib/modules/manager/gitlabci-include/extract.ts @@ -1,10 +1,11 @@ import is from '@sindresorhus/is'; import { load } from 'js-yaml'; +import { GlobalConfig } from '../../../config/global'; import { logger } from '../../../logger'; import { regEx } from '../../../util/regex'; import { GitlabTagsDatasource } from '../../datasource/gitlab-tags'; import { replaceReferenceTags } from '../gitlabci/utils'; -import type { ExtractConfig, PackageDependency, PackageFile } from '../types'; +import type { PackageDependency, PackageFile } from '../types'; function extractDepFromIncludeFile(includeObj: { file: any; @@ -24,12 +25,9 @@ function extractDepFromIncludeFile(includeObj: { return dep; } -export function extractPackageFile( - content: string, - _packageFile: string, - config: ExtractConfig -): PackageFile | null { +export function extractPackageFile(content: string): PackageFile | null { const deps: PackageDependency[] = []; + const { platform, endpoint } = GlobalConfig.get(); try { // TODO: fix me (#9610) const doc: any = load(replaceReferenceTags(content), { @@ -44,10 +42,8 @@ export function extractPackageFile( for (const includeObj of includes) { if (includeObj?.file && includeObj.project) { const dep = extractDepFromIncludeFile(includeObj); - if (config.endpoint) { - dep.registryUrls = [ - config.endpoint.replace(regEx(/\/api\/v4\/?/), ''), - ]; + if (platform === 'gitlab' && endpoint) { + dep.registryUrls = [endpoint.replace(regEx(/\/api\/v4\/?/), '')]; } deps.push(dep); } diff --git a/lib/modules/manager/npm/post-update/index.ts b/lib/modules/manager/npm/post-update/index.ts index cfbc499038700d..41181e50a473a7 100644 --- a/lib/modules/manager/npm/post-update/index.ts +++ b/lib/modules/manager/npm/post-update/index.ts @@ -269,7 +269,7 @@ export async function writeUpdatedPackageFiles( const massagedFile = JSON.parse(packageFile.contents.toString()); try { const { token } = hostRules.find({ - hostType: config.platform, + hostType: 'github', url: 'https://api.github.com/', }); for (const upgrade of config.upgrades) { @@ -507,7 +507,7 @@ export async function getAdditionalFiles( let token: string | undefined; try { ({ token } = hostRules.find({ - hostType: config.platform, + hostType: 'github', url: 'https://api.github.com/', })); token = token ? /* istanbul ignore next */ `${token}@` : token; diff --git a/lib/modules/manager/types.ts b/lib/modules/manager/types.ts index 1f1f542c39fcae..8ca2a35518cc0b 100644 --- a/lib/modules/manager/types.ts +++ b/lib/modules/manager/types.ts @@ -16,7 +16,6 @@ export interface ManagerData { export interface ExtractConfig { registryUrls?: string[]; - endpoint?: string; aliases?: Record; npmrc?: string; npmrcMerge?: boolean; @@ -297,7 +296,6 @@ export interface PostUpdateConfig> skipInstalls?: boolean; ignoreScripts?: boolean; - platform?: string; upgrades: Upgrade[]; npmLock?: string; yarnLock?: string; diff --git a/lib/util/cache/repository/index.spec.ts b/lib/util/cache/repository/index.spec.ts index b7b996436bbc15..8a2aeb0add410a 100644 --- a/lib/util/cache/repository/index.spec.ts +++ b/lib/util/cache/repository/index.spec.ts @@ -13,7 +13,7 @@ describe('util/cache/repository/index', () => { beforeEach(() => { resetCache(); jest.resetAllMocks(); - GlobalConfig.set({ cacheDir: '/tmp/cache' }); + GlobalConfig.set({ cacheDir: '/tmp/cache', platform: 'github' }); }); const config: RenovateConfig = { diff --git a/lib/util/cache/repository/init.ts b/lib/util/cache/repository/init.ts index bcde9c206942c9..77b20ab2c99ae6 100644 --- a/lib/util/cache/repository/init.ts +++ b/lib/util/cache/repository/init.ts @@ -1,3 +1,4 @@ +import { GlobalConfig } from '../../../config/global'; import type { RenovateConfig } from '../../../config/types'; import { LocalRepoCache } from './impl/local'; import { resetCache, setCache } from '.'; @@ -7,12 +8,9 @@ import { resetCache, setCache } from '.'; */ export async function initRepoCache(config: RenovateConfig): Promise { resetCache(); - if ( - config.platform && - config.repository && - config.repositoryCache === 'enabled' - ) { - const localCache = new LocalRepoCache(config.platform, config.repository); + const { platform } = GlobalConfig.get(); + if (platform && config.repository && config.repositoryCache === 'enabled') { + const localCache = new LocalRepoCache(platform, config.repository); await localCache.load(); setCache(localCache); } diff --git a/lib/workers/global/index.ts b/lib/workers/global/index.ts index b108aee4ce6c6e..9354be86d85fe1 100644 --- a/lib/workers/global/index.ts +++ b/lib/workers/global/index.ts @@ -5,6 +5,7 @@ import semver from 'semver'; import upath from 'upath'; import * as configParser from '../../config'; import { mergeChildConfig } from '../../config'; +import { GlobalConfig } from '../../config/global'; import { resolveConfigPresets } from '../../config/presets'; import { validateConfigSecrets } from '../../config/secrets'; import type { @@ -31,9 +32,10 @@ export async function getRepositoryConfig( globalConfig, is.string(repository) ? { repository } : repository ); + const platform = GlobalConfig.get('platform'); repoConfig.localDir = upath.join( repoConfig.baseDir, - `./repos/${repoConfig.platform}/${repoConfig.repository}` + `./repos/${platform}/${repoConfig.repository}` ); await fs.ensureDir(repoConfig.localDir); delete repoConfig.baseDir; diff --git a/lib/workers/repository/init/index.ts b/lib/workers/repository/init/index.ts index 788eab615b6fcb..ce75de4b3f1cf6 100644 --- a/lib/workers/repository/init/index.ts +++ b/lib/workers/repository/init/index.ts @@ -1,3 +1,4 @@ +import { GlobalConfig } from '../../../config/global'; import { applySecretsToConfig } from '../../../config/secrets'; import type { RenovateConfig } from '../../../config/types'; import { logger } from '../../../logger'; @@ -17,8 +18,9 @@ function initializeConfig(config: RenovateConfig): RenovateConfig { function warnOnUnsupportedOptions(config: RenovateConfig): void { if (config.filterUnavailableUsers && !platform.filterUnavailableUsers) { + const platform = GlobalConfig.get('platform'); logger.warn( - `Configuration option 'filterUnavailableUsers' is not supported on the current platform '${config.platform}'.` + `Configuration option 'filterUnavailableUsers' is not supported on the current platform '${platform}'.` ); } } diff --git a/lib/workers/repository/onboarding/branch/config.spec.ts b/lib/workers/repository/onboarding/branch/config.spec.ts index 8ce9e6a8bc196a..613e50bc5cbb2a 100644 --- a/lib/workers/repository/onboarding/branch/config.spec.ts +++ b/lib/workers/repository/onboarding/branch/config.spec.ts @@ -14,6 +14,7 @@ describe('workers/repository/onboarding/branch/config', () => { beforeAll(() => { GlobalConfig.set({ localDir: '', + platform: 'github', }); }); diff --git a/lib/workers/repository/onboarding/branch/config.ts b/lib/workers/repository/onboarding/branch/config.ts index 57d4ff32877e3b..bdce49e22b5588 100644 --- a/lib/workers/repository/onboarding/branch/config.ts +++ b/lib/workers/repository/onboarding/branch/config.ts @@ -1,3 +1,4 @@ +import { GlobalConfig } from '../../../../config/global'; import { getPreset } from '../../../../config/presets/local'; import { PRESET_DEP_NOT_FOUND } from '../../../../config/presets/util'; import type { @@ -24,7 +25,7 @@ async function getOnboardingConfig( // Check for org/renovate-config try { const repo = `${orgName}/renovate-config`; - await getPreset({ repo, baseConfig: config }); + await getPreset({ repo }); orgPreset = `local>${repo}`; } catch (err) { if ( @@ -37,13 +38,13 @@ async function getOnboardingConfig( if (!orgPreset) { // Check for org/.{{platform}} + const platform = GlobalConfig.get('platform'); try { - const repo = `${orgName}/.${config.platform}`; + const repo = `${orgName}/.${platform}`; const presetName = 'renovate-config'; await getPreset({ repo, presetName, - baseConfig: config, }); orgPreset = `local>${repo}:${presetName}`; } catch (err) { diff --git a/lib/workers/types.ts b/lib/workers/types.ts index f7df16edb0dace..8b1f69c89036c8 100644 --- a/lib/workers/types.ts +++ b/lib/workers/types.ts @@ -37,7 +37,6 @@ export interface BranchUpgradeConfig currentDigest?: string; currentDigestShort?: string; currentValue?: string; - endpoint?: string; excludeCommitPaths?: string[]; githubName?: string; group?: GroupConfig; From c4bd2b27f09a2c64eab62de76b64bcc688c6004d Mon Sep 17 00:00:00 2001 From: Kevin Ennis Date: Fri, 3 Jun 2022 01:58:33 -0400 Subject: [PATCH 012/240] fix(manager:npm): Allow Github URLs with uppercase letters (#15863) --- .../npm/extract/__snapshots__/index.spec.ts.snap | 13 +++++++++++++ lib/modules/manager/npm/extract/index.spec.ts | 7 +++++++ lib/modules/manager/npm/extract/index.ts | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/lib/modules/manager/npm/extract/__snapshots__/index.spec.ts.snap b/lib/modules/manager/npm/extract/__snapshots__/index.spec.ts.snap index 92c2fd16d4c765..0628a164eed571 100644 --- a/lib/modules/manager/npm/extract/__snapshots__/index.spec.ts.snap +++ b/lib/modules/manager/npm/extract/__snapshots__/index.spec.ts.snap @@ -310,6 +310,19 @@ Object { "prettyDepType": "dependency", "sourceUrl": "https://github.com/owner/o", }, + Object { + "currentRawValue": "Owner/P.git#v2.0.0", + "currentValue": "v2.0.0", + "datasource": "github-tags", + "depName": "p", + "depType": "dependencies", + "gitRef": true, + "githubRepo": "Owner/P", + "packageName": "Owner/P", + "pinDigests": false, + "prettyDepType": "dependency", + "sourceUrl": "https://github.com/Owner/P", + }, ], "lernaClient": undefined, "lernaPackages": undefined, diff --git a/lib/modules/manager/npm/extract/index.spec.ts b/lib/modules/manager/npm/extract/index.spec.ts index 5226da0f7640ac..06343c0a005a5f 100644 --- a/lib/modules/manager/npm/extract/index.spec.ts +++ b/lib/modules/manager/npm/extract/index.spec.ts @@ -501,6 +501,7 @@ describe('modules/manager/npm/extract/index', () => { m: 'https://github.com/owner/m.git#v1.0.0', n: 'git+https://github.com/owner/n#v2.0.0', o: 'git@github.com:owner/o.git#v2.0.0', + p: 'Owner/P.git#v2.0.0', }, }; const pJsonStr = JSON.stringify(pJson); @@ -592,6 +593,12 @@ describe('modules/manager/npm/extract/index', () => { datasource: 'github-tags', sourceUrl: 'https://github.com/owner/o', }, + { + depName: 'p', + currentValue: 'v2.0.0', + datasource: 'github-tags', + sourceUrl: 'https://github.com/Owner/P', + }, ], }); }); diff --git a/lib/modules/manager/npm/extract/index.ts b/lib/modules/manager/npm/extract/index.ts index 063e409100cf97..d7e4dc835fd5f6 100644 --- a/lib/modules/manager/npm/extract/index.ts +++ b/lib/modules/manager/npm/extract/index.ts @@ -306,7 +306,7 @@ export async function extractPackageFile( githubRepo = matchUrlSshFormat[2]; githubOwnerRepo = `${githubOwner}/${githubRepo}`; } - const githubValidRegex = /^[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38}$/; // TODO #12872 lookahead + const githubValidRegex = /^[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38}$/i; // TODO #12872 lookahead if ( !githubValidRegex.test(githubOwner) || !githubValidRegex.test(githubRepo) From f5b8f08906fa4d257b3dd3a6d38f00cf3baa237e Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Fri, 3 Jun 2022 08:46:45 +0200 Subject: [PATCH 013/240] feat: additionalRegistryUrls (#15868) --- lib/modules/datasource/index.ts | 21 ++++-- lib/modules/datasource/types.ts | 2 + .../__snapshots__/extract.spec.ts.snap | 18 ++--- .../manager/pip_requirements/extract.spec.ts | 64 +++++----------- .../manager/pip_requirements/extract.ts | 73 ++++++++----------- lib/modules/manager/types.ts | 2 +- 6 files changed, 80 insertions(+), 100 deletions(-) diff --git a/lib/modules/datasource/index.ts b/lib/modules/datasource/index.ts index 803d70b0cc9de6..b55b1c2e1a76dd 100644 --- a/lib/modules/datasource/index.ts +++ b/lib/modules/datasource/index.ts @@ -190,15 +190,22 @@ function massageRegistryUrls(registryUrls: string[]): string[] { function resolveRegistryUrls( datasource: DatasourceApi, defaultRegistryUrls: string[] | undefined, - registryUrls: string[] | undefined + registryUrls: string[] | undefined, + additionalRegistryUrls: string[] | undefined ): string[] { if (!datasource.customRegistrySupport) { if ( is.nonEmptyArray(registryUrls) || - is.nonEmptyArray(defaultRegistryUrls) + is.nonEmptyArray(defaultRegistryUrls) || + is.nonEmptyArray(additionalRegistryUrls) ) { logger.warn( - { datasource: datasource.id, registryUrls, defaultRegistryUrls }, + { + datasource: datasource.id, + registryUrls, + defaultRegistryUrls, + additionalRegistryUrls, + }, 'Custom registries are not allowed for this datasource and will be ignored' ); } @@ -210,8 +217,10 @@ function resolveRegistryUrls( resolvedUrls = [...customUrls]; } else if (is.nonEmptyArray(defaultRegistryUrls)) { resolvedUrls = [...defaultRegistryUrls]; + resolvedUrls.concat(additionalRegistryUrls ?? []); } else if (is.nonEmptyArray(datasource.defaultRegistryUrls)) { resolvedUrls = [...datasource.defaultRegistryUrls]; + resolvedUrls.concat(additionalRegistryUrls ?? []); } return massageRegistryUrls(resolvedUrls); } @@ -263,7 +272,8 @@ async function fetchReleases( registryUrls = resolveRegistryUrls( datasource, config.defaultRegistryUrls, - registryUrls + registryUrls, + config.additionalRegistryUrls ); let dep: ReleaseResult | null = null; const registryStrategy = datasource.registryStrategy || 'hunt'; @@ -417,7 +427,8 @@ function getDigestConfig( const [registryUrl] = resolveRegistryUrls( datasource, config.defaultRegistryUrls, - config.registryUrls + config.registryUrls, + config.additionalRegistryUrls ); return { packageName, registryUrl, currentValue, currentDigest }; } diff --git a/lib/modules/datasource/types.ts b/lib/modules/datasource/types.ts index c0173243043c14..be5e106ec04fd2 100644 --- a/lib/modules/datasource/types.ts +++ b/lib/modules/datasource/types.ts @@ -6,6 +6,7 @@ export interface GetDigestInputConfig { depName: string; defaultRegistryUrls?: string[]; registryUrls?: string[]; + additionalRegistryUrls?: string[]; currentValue?: string; currentDigest?: string; } @@ -26,6 +27,7 @@ export interface GetPkgReleasesConfig { npmrc?: string; defaultRegistryUrls?: string[]; registryUrls?: string[]; + additionalRegistryUrls?: string[]; datasource: string; depName: string; packageName?: string; diff --git a/lib/modules/manager/pip_requirements/__snapshots__/extract.spec.ts.snap b/lib/modules/manager/pip_requirements/__snapshots__/extract.spec.ts.snap index a5774c42e9bd54..31c6b448b3a013 100644 --- a/lib/modules/manager/pip_requirements/__snapshots__/extract.spec.ts.snap +++ b/lib/modules/manager/pip_requirements/__snapshots__/extract.spec.ts.snap @@ -106,6 +106,9 @@ Array [ exports[`modules/manager/pip_requirements/extract extractPackageFile() handles extra index url 1`] = ` Object { + "additionalRegistryUrls": Array [ + "http://example.com/private-pypi/", + ], "deps": Array [ Object { "currentValue": "==2.0.12", @@ -146,13 +149,15 @@ Object { ], "registryUrls": Array [ "https://artifactory.company.com/artifactory/api/pypi/python/simple", - "http://example.com/private-pypi/", ], } `; exports[`modules/manager/pip_requirements/extract extractPackageFile() handles extra index url and defaults without index to config 1`] = ` Object { + "additionalRegistryUrls": Array [ + "http://example.com/private-pypi/", + ], "deps": Array [ Object { "currentValue": "==2.0.12", @@ -191,15 +196,14 @@ Object { "depName": "not_semver", }, ], - "registryUrls": Array [ - "AnExistingDefaultUrl", - "http://example.com/private-pypi/", - ], } `; exports[`modules/manager/pip_requirements/extract extractPackageFile() handles extra index url and defaults without index to pypi 1`] = ` Object { + "additionalRegistryUrls": Array [ + "http://example.com/private-pypi/", + ], "deps": Array [ Object { "currentValue": "==2.0.12", @@ -238,10 +242,6 @@ Object { "depName": "not_semver", }, ], - "registryUrls": Array [ - "https://pypi.org/pypi/", - "http://example.com/private-pypi/", - ], } `; diff --git a/lib/modules/manager/pip_requirements/extract.spec.ts b/lib/modules/manager/pip_requirements/extract.spec.ts index 7ef5886ded05f3..9751ce1dc157e8 100644 --- a/lib/modules/manager/pip_requirements/extract.spec.ts +++ b/lib/modules/manager/pip_requirements/extract.spec.ts @@ -25,11 +25,9 @@ describe('modules/manager/pip_requirements/extract', () => { }); describe('extractPackageFile()', () => { - let config; const OLD_ENV = process.env; beforeEach(() => { - config = { registryUrls: ['AnExistingDefaultUrl'] }; process.env = { ...OLD_ENV }; delete process.env.PIP_INDEX_URL; }); @@ -39,40 +37,30 @@ describe('modules/manager/pip_requirements/extract', () => { }); it('returns null for empty', () => { - expect( - extractPackageFile('nothing here', 'requirements.txt', config) - ).toBeNull(); + expect(extractPackageFile('nothing here')).toBeNull(); }); it('extracts dependencies', () => { - const res = extractPackageFile(requirements1, 'unused_file_name', config); + const res = extractPackageFile(requirements1); expect(res).toMatchSnapshot(); expect(res.registryUrls).toEqual(['http://example.com/private-pypi/']); expect(res.deps).toHaveLength(4); }); it('extracts multiple dependencies', () => { - const res = extractPackageFile( - requirements2, - 'unused_file_name', - config - ).deps; + const res = extractPackageFile(requirements2).deps; expect(res).toMatchSnapshot(); expect(res).toHaveLength(5); }); it('handles comments and commands', () => { - const res = extractPackageFile( - requirements3, - 'unused_file_name', - config - ).deps; + const res = extractPackageFile(requirements3).deps; expect(res).toMatchSnapshot(); expect(res).toHaveLength(5); }); it('handles extras and complex index url', () => { - const res = extractPackageFile(requirements4, 'unused_file_name', config); + const res = extractPackageFile(requirements4); expect(res).toMatchSnapshot(); expect(res.registryUrls).toEqual([ 'https://artifactory.company.com/artifactory/api/pypi/python/simple', @@ -81,37 +69,37 @@ describe('modules/manager/pip_requirements/extract', () => { }); it('handles extra index url', () => { - const res = extractPackageFile(requirements5, 'unused_file_name', config); + const res = extractPackageFile(requirements5); expect(res).toMatchSnapshot(); expect(res.registryUrls).toEqual([ 'https://artifactory.company.com/artifactory/api/pypi/python/simple', + ]); + expect(res.additionalRegistryUrls).toEqual([ 'http://example.com/private-pypi/', ]); expect(res.deps).toHaveLength(6); }); it('handles extra index url and defaults without index to config', () => { - const res = extractPackageFile(requirements6, 'unused_file_name', config); + const res = extractPackageFile(requirements6); expect(res).toMatchSnapshot(); - expect(res.registryUrls).toEqual([ - 'AnExistingDefaultUrl', + expect(res.additionalRegistryUrls).toEqual([ 'http://example.com/private-pypi/', ]); expect(res.deps).toHaveLength(6); }); it('handles extra index url and defaults without index to pypi', () => { - const res = extractPackageFile(requirements6, 'unused_file_name', {}); + const res = extractPackageFile(requirements6); expect(res).toMatchSnapshot(); - expect(res.registryUrls).toEqual([ - 'https://pypi.org/pypi/', + expect(res.additionalRegistryUrls).toEqual([ 'http://example.com/private-pypi/', ]); expect(res.deps).toHaveLength(6); }); it('handles extra spaces around pinned dependency equal signs', () => { - const res = extractPackageFile(requirements4, 'unused_file_name', {}); + const res = extractPackageFile(requirements4); expect(res).toMatchSnapshot(); expect(res.deps[0].currentValue).toStartWith('=='); @@ -126,14 +114,11 @@ describe('modules/manager/pip_requirements/extract', () => { it('should not replace env vars in low trust mode', () => { process.env.PIP_TEST_TOKEN = 'its-a-secret'; - const res = extractPackageFile(requirements7, 'unused_file_name', {}); - expect(res.registryUrls).toEqual([ - 'https://pypi.org/pypi/', + const res = extractPackageFile(requirements7); + expect(res.additionalRegistryUrls).toEqual([ 'http://$PIP_TEST_TOKEN:example.com/private-pypi/', - 'http://${PIP_TEST_TOKEN}:example.com/private-pypi/', 'http://$PIP_TEST_TOKEN:example.com/private-pypi/', - 'http://${PIP_TEST_TOKEN}:example.com/private-pypi/', ]); }); @@ -141,9 +126,8 @@ describe('modules/manager/pip_requirements/extract', () => { it('should replace env vars in high trust mode', () => { process.env.PIP_TEST_TOKEN = 'its-a-secret'; GlobalConfig.set({ exposeAllEnv: true }); - const res = extractPackageFile(requirements7, 'unused_file_name', {}); - expect(res.registryUrls).toEqual([ - 'https://pypi.org/pypi/', + const res = extractPackageFile(requirements7); + expect(res.additionalRegistryUrls).toEqual([ 'http://its-a-secret:example.com/private-pypi/', 'http://its-a-secret:example.com/private-pypi/', 'http://its-a-secret:example.com/private-pypi/', @@ -152,17 +136,13 @@ describe('modules/manager/pip_requirements/extract', () => { }); it('should handle hashes', () => { - const res = extractPackageFile(requirements8, 'unused_file_name', {}); + const res = extractPackageFile(requirements8); expect(res).toMatchSnapshot(); expect(res.deps).toHaveLength(3); }); it('should handle dependency and ignore env markers', () => { - const res = extractPackageFile( - requirementsWithEnvMarkers, - 'unused_file_name', - {} - ); + const res = extractPackageFile(requirementsWithEnvMarkers); expect(res).toEqual({ deps: [ { @@ -176,11 +156,7 @@ describe('modules/manager/pip_requirements/extract', () => { }); it('should handle git packages', () => { - const res = extractPackageFile( - requirementsGitPackages, - 'unused_file_name', - {} - ); + const res = extractPackageFile(requirementsGitPackages); expect(res.deps).toHaveLength(5); expect(res).toEqual({ deps: [ diff --git a/lib/modules/manager/pip_requirements/extract.ts b/lib/modules/manager/pip_requirements/extract.ts index 4909b006a3da3d..34524aee2b1c63 100644 --- a/lib/modules/manager/pip_requirements/extract.ts +++ b/lib/modules/manager/pip_requirements/extract.ts @@ -7,7 +7,7 @@ import { isSkipComment } from '../../../util/ignore'; import { newlineRegex, regEx } from '../../../util/regex'; import { GitTagsDatasource } from '../../datasource/git-tags'; import { PypiDatasource } from '../../datasource/pypi'; -import type { ExtractConfig, PackageDependency, PackageFile } from '../types'; +import type { PackageDependency, PackageFile } from '../types'; export const packagePattern = '[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9._-]*[a-zA-Z0-9]'; @@ -24,38 +24,44 @@ const specifierPartPattern = `\\s*${rangePattern.replace( const specifierPattern = `${specifierPartPattern}(?:\\s*,${specifierPartPattern})*`; export const dependencyPattern = `(${packagePattern})(${extrasPattern})(${specifierPattern})`; -export function extractPackageFile( - content: string, - _: string, - config: ExtractConfig -): PackageFile | null { +export function cleanRegistryUrls(registryUrls: string[]): string[] { + return registryUrls.map((url) => { + // handle the optional quotes in eg. `--extra-index-url "https://foo.bar"` + const cleaned = url.replace(regEx(/^"/), '').replace(regEx(/"$/), ''); + if (!GlobalConfig.get('exposeAllEnv')) { + return cleaned; + } + // interpolate any environment variables + return cleaned.replace( + regEx(/(\$[A-Za-z\d_]+)|(\${[A-Za-z\d_]+})/g), + (match) => { + const envvar = match + .substring(1) + .replace(regEx(/^{/), '') + .replace(regEx(/}$/), ''); + const sub = process.env[envvar]; + return sub || match; + } + ); + }); +} + +export function extractPackageFile(content: string): PackageFile | null { logger.trace('pip_requirements.extractPackageFile()'); - let indexUrl: string | undefined; - const extraUrls: string[] = []; + let registryUrls: string[] = []; + const additionalRegistryUrls: string[] = []; content.split(newlineRegex).forEach((line) => { if (line.startsWith('--index-url ')) { - indexUrl = line.substring('--index-url '.length).split(' ')[0]; + registryUrls = [line.substring('--index-url '.length).split(' ')[0]]; } if (line.startsWith('--extra-index-url ')) { const extraUrl = line .substring('--extra-index-url '.length) .split(' ')[0]; - extraUrls.push(extraUrl); + additionalRegistryUrls.push(extraUrl); } }); - let registryUrls: string[] = []; - if (indexUrl) { - // index url in file takes precedence - registryUrls.push(indexUrl); - } else if (config.registryUrls?.length) { - // configured registryURls takes next precedence - registryUrls = registryUrls.concat(config.registryUrls); - } else if (extraUrls.length) { - // Use default registry first if extra URLs are present and index URL is not - registryUrls.push(process.env.PIP_INDEX_URL || 'https://pypi.org/pypi/'); - } - registryUrls = registryUrls.concat(extraUrls); const pkgRegex = regEx(`^(${packagePattern})$`); const pkgValRegex = regEx(`^${dependencyPattern}$`); @@ -123,25 +129,10 @@ export function extractPackageFile( } const res: PackageFile = { deps }; if (registryUrls.length > 0) { - res.registryUrls = registryUrls.map((url) => { - // handle the optional quotes in eg. `--extra-index-url "https://foo.bar"` - const cleaned = url.replace(regEx(/^"/), '').replace(regEx(/"$/), ''); - if (!GlobalConfig.get('exposeAllEnv')) { - return cleaned; - } - // interpolate any environment variables - return cleaned.replace( - regEx(/(\$[A-Za-z\d_]+)|(\${[A-Za-z\d_]+})/g), - (match) => { - const envvar = match - .substring(1) - .replace(regEx(/^{/), '') - .replace(regEx(/}$/), ''); - const sub = process.env[envvar]; - return sub || match; - } - ); - }); + res.registryUrls = cleanRegistryUrls(registryUrls); + } + if (additionalRegistryUrls.length) { + res.additionalRegistryUrls = cleanRegistryUrls(additionalRegistryUrls); } return res; } diff --git a/lib/modules/manager/types.ts b/lib/modules/manager/types.ts index 8ca2a35518cc0b..94d641da38ec41 100644 --- a/lib/modules/manager/types.ts +++ b/lib/modules/manager/types.ts @@ -15,7 +15,6 @@ export interface ManagerData { } export interface ExtractConfig { - registryUrls?: string[]; aliases?: Record; npmrc?: string; npmrcMerge?: boolean; @@ -79,6 +78,7 @@ export interface PackageFile> constraints?: Record; datasource?: string; registryUrls?: string[]; + additionalRegistryUrls?: string[]; deps: PackageDependency[]; lernaClient?: string; lernaPackages?: string[]; From 2e957baed962d65cb8e40136edc142af6014ad95 Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Fri, 3 Jun 2022 12:27:26 +0300 Subject: [PATCH 014/240] feat(github): long-term datasource caching (#15653) --- .../__snapshots__/index.spec.ts.snap | 64 ---- .../github-releases/cache/cache-base.spec.ts | 262 +++++++++++++++ .../github-releases/cache/cache-base.ts | 301 ++++++++++++++++++ .../github-releases/cache/index.spec.ts | 43 +++ .../datasource/github-releases/cache/index.ts | 93 ++++++ .../datasource/github-releases/cache/types.ts | 100 ++++++ .../datasource/github-releases/common.ts | 5 +- .../datasource/github-releases/index.spec.ts | 71 ++--- .../datasource/github-releases/index.ts | 55 ++-- .../__snapshots__/index.spec.ts.snap | 37 --- .../datasource/github-tags/cache.spec.ts | 51 +++ lib/modules/datasource/github-tags/cache.ts | 88 +++++ .../datasource/github-tags/index.spec.ts | 68 ++-- lib/modules/datasource/github-tags/index.ts | 44 +-- .../releases-direct.spec.ts.snap | 32 -- .../datasource/go/releases-direct.spec.ts | 127 ++++---- .../datasource/go/releases-goproxy.spec.ts | 38 ++- lib/util/http/github.ts | 2 +- .../repository/process/lookup/index.spec.ts | 74 ++--- .../update/pr/changelog/github.spec.ts | 22 +- .../update/pr/changelog/github/index.ts | 40 +-- .../update/pr/changelog/index.spec.ts | 61 ++-- .../update/pr/changelog/release-notes.spec.ts | 154 +++++---- 23 files changed, 1318 insertions(+), 514 deletions(-) delete mode 100644 lib/modules/datasource/github-releases/__snapshots__/index.spec.ts.snap create mode 100644 lib/modules/datasource/github-releases/cache/cache-base.spec.ts create mode 100644 lib/modules/datasource/github-releases/cache/cache-base.ts create mode 100644 lib/modules/datasource/github-releases/cache/index.spec.ts create mode 100644 lib/modules/datasource/github-releases/cache/index.ts create mode 100644 lib/modules/datasource/github-releases/cache/types.ts delete mode 100644 lib/modules/datasource/github-tags/__snapshots__/index.spec.ts.snap create mode 100644 lib/modules/datasource/github-tags/cache.spec.ts create mode 100644 lib/modules/datasource/github-tags/cache.ts diff --git a/lib/modules/datasource/github-releases/__snapshots__/index.spec.ts.snap b/lib/modules/datasource/github-releases/__snapshots__/index.spec.ts.snap deleted file mode 100644 index 4bf63b80cdd5ed..00000000000000 --- a/lib/modules/datasource/github-releases/__snapshots__/index.spec.ts.snap +++ /dev/null @@ -1,64 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`modules/datasource/github-releases/index getReleases returns releases 1`] = ` -Object { - "registryUrl": "https://github.com", - "releases": Array [ - Object { - "gitRef": "1.0.0", - "releaseTimestamp": "2020-03-09T11:00:00.000Z", - "version": "1.0.0", - }, - Object { - "gitRef": "v1.1.0", - "releaseTimestamp": "2020-03-09T10:00:00.000Z", - "version": "v1.1.0", - }, - Object { - "gitRef": "2.0.0", - "isStable": false, - "releaseTimestamp": "2020-04-09T10:00:00.000Z", - "version": "2.0.0", - }, - ], - "sourceUrl": "https://github.com/some/dep", -} -`; - -exports[`modules/datasource/github-releases/index getReleases supports ghe 1`] = ` -Object { - "releases": Array [ - Object { - "gitRef": "a", - "isStable": undefined, - "releaseTimestamp": "2020-03-09T13:00:00Z", - "version": "a", - }, - Object { - "gitRef": "v", - "isStable": undefined, - "releaseTimestamp": "2020-03-09T12:00:00Z", - "version": "v", - }, - Object { - "gitRef": "1.0.0", - "isStable": undefined, - "releaseTimestamp": "2020-03-09T11:00:00Z", - "version": "1.0.0", - }, - Object { - "gitRef": "v1.1.0", - "isStable": undefined, - "releaseTimestamp": "2020-03-09T10:00:00Z", - "version": "v1.1.0", - }, - Object { - "gitRef": "2.0.0", - "isStable": false, - "releaseTimestamp": "2020-04-09T10:00:00Z", - "version": "2.0.0", - }, - ], - "sourceUrl": "https://git.enterprise.com/some/dep", -} -`; diff --git a/lib/modules/datasource/github-releases/cache/cache-base.spec.ts b/lib/modules/datasource/github-releases/cache/cache-base.spec.ts new file mode 100644 index 00000000000000..c36ffccd4002b3 --- /dev/null +++ b/lib/modules/datasource/github-releases/cache/cache-base.spec.ts @@ -0,0 +1,262 @@ +import { DateTime } from 'luxon'; +import { mocked } from '../../../../../test/util'; +import * as _packageCache from '../../../../util/cache/package'; +import { + GithubGraphqlResponse, + GithubHttp, +} from '../../../../util/http/github'; +import { AbstractGithubDatasourceCache } from './cache-base'; +import type { QueryResponse, StoredItemBase } from './types'; + +jest.mock('../../../../util/cache/package'); +const packageCache = mocked(_packageCache); + +interface FetchedItem { + name: string; + createdAt: string; + foo: string; +} + +interface StoredItem extends StoredItemBase { + bar: string; +} + +type GraphqlDataResponse = { + statusCode: 200; + headers: Record; + body: GithubGraphqlResponse>; +}; + +type GraphqlResponse = GraphqlDataResponse | Error; + +class TestCache extends AbstractGithubDatasourceCache { + cacheNs = 'test-cache'; + graphqlQuery = `query { ... }`; + + coerceFetched({ + name: version, + createdAt: releaseTimestamp, + foo: bar, + }: FetchedItem): StoredItem | null { + return version === 'invalid' ? null : { version, releaseTimestamp, bar }; + } + + isEquivalent({ bar: x }: StoredItem, { bar: y }: StoredItem): boolean { + return x === y; + } +} + +function resp(items: FetchedItem[], hasNextPage = false): GraphqlDataResponse { + return { + statusCode: 200, + headers: {}, + body: { + data: { + repository: { + payload: { + nodes: items, + pageInfo: { + hasNextPage, + endCursor: 'abc', + }, + }, + }, + }, + }, + }; +} + +const sortItems = (items: StoredItem[]) => + items.sort(({ releaseTimestamp: x }, { releaseTimestamp: y }) => + x.localeCompare(y) + ); + +describe('modules/datasource/github-releases/cache/cache-base', () => { + const http = new GithubHttp(); + const httpPostJson = jest.spyOn(GithubHttp.prototype, 'postJson'); + + const now = DateTime.local(2022, 6, 15, 18, 30, 30); + const t1 = now.minus({ days: 3 }).toISO(); + const t2 = now.minus({ days: 2 }).toISO(); + const t3 = now.minus({ days: 1 }).toISO(); + + let responses: GraphqlResponse[] = []; + + beforeEach(() => { + responses = []; + jest.resetAllMocks(); + jest.spyOn(DateTime, 'now').mockReturnValue(now); + httpPostJson.mockImplementation(() => { + const resp = responses.shift(); + return resp instanceof Error + ? Promise.reject(resp) + : Promise.resolve(resp); + }); + }); + + it('performs pre-fetch', async () => { + responses = [ + resp([{ name: 'v3', createdAt: t3, foo: 'ccc' }], true), + resp([{ name: 'v2', createdAt: t2, foo: 'bbb' }], true), + resp([{ name: 'v1', createdAt: t1, foo: 'aaa' }]), + ]; + const cache = new TestCache(http, { resetDeltaMinutes: 0 }); + + const res = await cache.getItems({ packageName: 'foo/bar' }); + + expect(sortItems(res)).toMatchObject([ + { version: 'v1', bar: 'aaa' }, + { version: 'v2', bar: 'bbb' }, + { version: 'v3', bar: 'ccc' }, + ]); + expect(packageCache.set).toHaveBeenCalledWith( + 'test-cache', + 'https://api.github.com/:foo:bar', + { + createdAt: now.toISO(), + updatedAt: now.toISO(), + items: { + v1: { bar: 'aaa', releaseTimestamp: t1, version: 'v1' }, + v2: { bar: 'bbb', releaseTimestamp: t2, version: 'v2' }, + v3: { bar: 'ccc', releaseTimestamp: t3, version: 'v3' }, + }, + }, + 7 * 24 * 60 + ); + }); + + it('filters out items being coerced to null', async () => { + responses = [ + resp([{ name: 'v3', createdAt: t3, foo: 'ccc' }], true), + resp([{ name: 'invalid', createdAt: t3, foo: 'xxx' }], true), + resp([{ name: 'v2', createdAt: t2, foo: 'bbb' }], true), + resp([{ name: 'v1', createdAt: t1, foo: 'aaa' }]), + ]; + const cache = new TestCache(http, { resetDeltaMinutes: 0 }); + + const res = await cache.getItems({ packageName: 'foo/bar' }); + + expect(sortItems(res)).toMatchObject([ + { version: 'v1' }, + { version: 'v2' }, + { version: 'v3' }, + ]); + }); + + it('updates items', async () => { + packageCache.get.mockResolvedValueOnce({ + items: { + v1: { version: 'v1', releaseTimestamp: t1, bar: 'aaa' }, + v2: { version: 'v2', releaseTimestamp: t2, bar: 'bbb' }, + v3: { version: 'v3', releaseTimestamp: t3, bar: 'ccc' }, + }, + createdAt: t3, + updatedAt: t3, + }); + + responses = [ + resp([{ name: 'v3', createdAt: t3, foo: 'xxx' }], true), + resp([{ name: 'v2', createdAt: t2, foo: 'bbb' }], true), + resp([{ name: 'v1', createdAt: t1, foo: 'aaa' }]), + ]; + const cache = new TestCache(http, { resetDeltaMinutes: 0 }); + + const res = await cache.getItems({ packageName: 'foo/bar' }); + + expect(sortItems(res)).toMatchObject([ + { version: 'v1', bar: 'aaa' }, + { version: 'v2', bar: 'bbb' }, + { version: 'v3', bar: 'xxx' }, + ]); + expect(packageCache.set).toHaveBeenCalledWith( + 'test-cache', + 'https://api.github.com/:foo:bar', + { + createdAt: t3, + updatedAt: now.toISO(), + items: { + v1: { bar: 'aaa', releaseTimestamp: t1, version: 'v1' }, + v2: { bar: 'bbb', releaseTimestamp: t2, version: 'v2' }, + v3: { bar: 'xxx', releaseTimestamp: t3, version: 'v3' }, + }, + }, + 6 * 24 * 60 + ); + }); + + it('stops updating once stability period have passed', async () => { + packageCache.get.mockResolvedValueOnce({ + items: { + v1: { version: 'v1', releaseTimestamp: t1, bar: 'aaa' }, + v2: { version: 'v2', releaseTimestamp: t2, bar: 'bbb' }, + v3: { version: 'v3', releaseTimestamp: t3, bar: 'ccc' }, + }, + createdAt: t3, + updatedAt: t3, + }); + responses = [ + resp([{ name: 'v3', createdAt: t3, foo: 'zzz' }], true), + resp([{ name: 'v2', createdAt: t2, foo: 'yyy' }], true), + resp([{ name: 'v1', createdAt: t1, foo: 'xxx' }]), + ]; + const cache = new TestCache(http, { unstableDays: 1.5 }); + + const res = await cache.getItems({ packageName: 'foo/bar' }); + + expect(sortItems(res)).toMatchObject([ + { version: 'v1', bar: 'aaa' }, + { version: 'v2', bar: 'bbb' }, + { version: 'v3', bar: 'zzz' }, + ]); + }); + + it('removes deleted items from cache', async () => { + packageCache.get.mockResolvedValueOnce({ + items: { + v1: { version: 'v1', releaseTimestamp: t1, bar: 'aaa' }, + v2: { version: 'v2', releaseTimestamp: t2, bar: 'bbb' }, + v3: { version: 'v3', releaseTimestamp: t3, bar: 'ccc' }, + }, + createdAt: t3, + updatedAt: t3, + }); + responses = [ + resp([{ name: 'v3', createdAt: t3, foo: 'ccc' }], true), + resp([{ name: 'v1', createdAt: t1, foo: 'aaa' }]), + ]; + const cache = new TestCache(http, { resetDeltaMinutes: 0 }); + + const res = await cache.getItems({ packageName: 'foo/bar' }); + + expect(sortItems(res)).toMatchObject([ + { version: 'v1', bar: 'aaa' }, + { version: 'v3', bar: 'ccc' }, + ]); + }); + + it('returns cached values on server errors', async () => { + packageCache.get.mockResolvedValueOnce({ + items: { + v1: { version: 'v1', releaseTimestamp: t1, bar: 'aaa' }, + v2: { version: 'v2', releaseTimestamp: t2, bar: 'bbb' }, + v3: { version: 'v3', releaseTimestamp: t3, bar: 'ccc' }, + }, + createdAt: t3, + updatedAt: t3, + }); + responses = [ + resp([{ name: 'v3', createdAt: t3, foo: 'zzz' }], true), + new Error('Unknown error'), + resp([{ name: 'v1', createdAt: t1, foo: 'xxx' }]), + ]; + const cache = new TestCache(http, { resetDeltaMinutes: 0 }); + + const res = await cache.getItems({ packageName: 'foo/bar' }); + + expect(sortItems(res)).toMatchObject([ + { version: 'v1', bar: 'aaa' }, + { version: 'v2', bar: 'bbb' }, + { version: 'v3', bar: 'ccc' }, + ]); + }); +}); diff --git a/lib/modules/datasource/github-releases/cache/cache-base.ts b/lib/modules/datasource/github-releases/cache/cache-base.ts new file mode 100644 index 00000000000000..8e8ee6ae172e7d --- /dev/null +++ b/lib/modules/datasource/github-releases/cache/cache-base.ts @@ -0,0 +1,301 @@ +import { DateTime, DurationLikeObject } from 'luxon'; +import { logger } from '../../../../logger'; +import * as packageCache from '../../../../util/cache/package'; +import type { + GithubGraphqlResponse, + GithubHttp, +} from '../../../../util/http/github'; +import type { GetReleasesConfig } from '../../types'; +import { getApiBaseUrl } from '../common'; +import type { + CacheOptions, + GithubDatasourceCache, + GithubQueryParams, + QueryResponse, + StoredItemBase, +} from './types'; + +/** + * The options that are meant to be used in production. + */ +const cacheDefaults: Required = { + /** + * How many minutes to wait until next cache update + */ + updateAfterMinutes: 30, + + /** + * How many days to wait until full cache reset (for single package). + */ + resetAfterDays: 7, + + /** + * Delays cache reset by some random amount of minutes, + * in order to stabilize load during mass cache reset. + */ + resetDeltaMinutes: 3 * 60, + + /** + * How many days ago the package should be published to be considered as stable. + * Since this period is expired, it won't be refreshed via soft updates anymore. + */ + unstableDays: 30, + + /** + * How many items per page to obtain per page during initial fetch (i.e. pre-fetch) + */ + itemsPerPrefetchPage: 100, + + /** + * How many pages to fetch (at most) during the initial fetch (i.e. pre-fetch) + */ + maxPrefetchPages: 100, + + /** + * How many items per page to obtain per page during the soft update + */ + itemsPerUpdatePage: 100, + + /** + * How many pages to fetch (at most) during the soft update + */ + maxUpdatePages: 100, +}; + +/** + * Tells whether the time `duration` is expired starting + * from the `date` (ISO date format) at the moment of `now`. + */ +function isExpired( + now: DateTime, + date: string, + duration: DurationLikeObject +): boolean { + const then = DateTime.fromISO(date); + const expiry = then.plus(duration); + return now >= expiry; +} + +export abstract class AbstractGithubDatasourceCache< + StoredItem extends StoredItemBase, + FetchedItem = unknown +> { + private updateDuration: DurationLikeObject; + private resetDuration: DurationLikeObject; + private stabilityDuration: DurationLikeObject; + + private maxPrefetchPages: number; + private itemsPerPrefetchPage: number; + + private maxUpdatePages: number; + private itemsPerUpdatePage: number; + + private resetDeltaMinutes: number; + + constructor(private http: GithubHttp, opts: CacheOptions = {}) { + const { + updateAfterMinutes, + resetAfterDays, + unstableDays, + maxPrefetchPages, + itemsPerPrefetchPage, + maxUpdatePages, + itemsPerUpdatePage, + resetDeltaMinutes, + } = { + ...cacheDefaults, + ...opts, + }; + + this.updateDuration = { minutes: updateAfterMinutes }; + this.resetDuration = { days: resetAfterDays }; + this.stabilityDuration = { days: unstableDays }; + + this.maxPrefetchPages = maxPrefetchPages; + this.itemsPerPrefetchPage = itemsPerPrefetchPage; + this.maxUpdatePages = maxUpdatePages; + this.itemsPerUpdatePage = itemsPerUpdatePage; + + this.resetDeltaMinutes = resetDeltaMinutes; + } + + /** + * The key at which data is stored in the package cache. + */ + abstract readonly cacheNs: string; + + /** + * The query string. + * For parameters, see `GithubQueryParams`. + */ + abstract readonly graphqlQuery: string; + + /** + * Transform `fetchedItem` for storing in the package cache. + * @param fetchedItem Node obtained from GraphQL response + */ + abstract coerceFetched(fetchedItem: FetchedItem): StoredItem | null; + + /** + * Pre-fetch, update, or just return the package cache items. + */ + async getItems(releasesConfig: GetReleasesConfig): Promise { + const { packageName, registryUrl } = releasesConfig; + + // The time meant to be used across the function + const now = DateTime.now(); + + // Initialize items and timestamps for the new cache + let cacheItems: Record = {}; + + // Add random minutes to the creation date in order to + // provide back-off time during mass cache invalidation. + const randomDelta = this.getRandomDeltaMinutes(); + let cacheCreatedAt = now.plus(randomDelta).toISO(); + + // We have to initialize `updatedAt` value as already expired, + // so that soft update mechanics is immediately starting. + let cacheUpdatedAt = now.minus(this.updateDuration).toISO(); + + const baseUrl = getApiBaseUrl(registryUrl).replace('/v3/', '/'); // Replace for GHE + + const [owner, name] = packageName.split('/'); + if (owner && name) { + const cacheKey = `${baseUrl}:${owner}:${name}`; + const cache = await packageCache.get>( + this.cacheNs, + cacheKey + ); + + const cacheDoesExist = + cache && !isExpired(now, cache.createdAt, this.resetDuration); + if (cacheDoesExist) { + // Keeping the the original `cache` value intact + // in order to be used in exception handler + cacheItems = { ...cache.items }; + cacheCreatedAt = cache.createdAt; + cacheUpdatedAt = cache.updatedAt; + } + + try { + if (isExpired(now, cacheUpdatedAt, this.updateDuration)) { + const variables: GithubQueryParams = { + owner, + name, + cursor: null, + count: cacheDoesExist + ? this.itemsPerUpdatePage + : this.itemsPerPrefetchPage, + }; + + // Collect version values to determine deleted items + const checkedVersions = new Set(); + + // Page-by-page update loop + let pagesRemained = cacheDoesExist + ? this.maxUpdatePages + : this.maxPrefetchPages; + let stopIteration = false; + while (pagesRemained > 0 && !stopIteration) { + const graphqlRes = await this.http.postJson< + GithubGraphqlResponse> + >('/graphql', { + baseUrl, + body: { query: this.graphqlQuery, variables }, + }); + pagesRemained -= 1; + + const data = graphqlRes.body.data; + if (data) { + const { + nodes: fetchedItems, + pageInfo: { hasNextPage, endCursor }, + } = data.repository.payload; + + if (hasNextPage) { + variables.cursor = endCursor; + } else { + stopIteration = true; + } + + for (const item of fetchedItems) { + const newStoredItem = this.coerceFetched(item); + if (newStoredItem) { + const { version } = newStoredItem; + + // Stop earlier if the stored item have reached stability, + // which means `unstableDays` period have passed + const oldStoredItem = cacheItems[version]; + if ( + oldStoredItem && + isExpired( + now, + oldStoredItem.releaseTimestamp, + this.stabilityDuration + ) + ) { + stopIteration = true; + break; + } + + cacheItems[version] = newStoredItem; + checkedVersions.add(version); + } + } + } + } + + // Detect removed items + for (const [version, item] of Object.entries(cacheItems)) { + if ( + !isExpired(now, item.releaseTimestamp, this.stabilityDuration) && + !checkedVersions.has(version) + ) { + delete cacheItems[version]; + } + } + + // Store cache + const expiry = DateTime.fromISO(cacheCreatedAt).plus( + this.resetDuration + ); + const { minutes: ttlMinutes } = expiry + .diff(now, ['minutes']) + .toObject(); + if (ttlMinutes && ttlMinutes > 0) { + const cacheValue: GithubDatasourceCache = { + items: cacheItems, + createdAt: cacheCreatedAt, + updatedAt: now.toISO(), + }; + await packageCache.set( + this.cacheNs, + cacheKey, + cacheValue, + ttlMinutes + ); + } + } + } catch (err) { + logger.debug( + { err }, + `GitHub datasource: error fetching cacheable GraphQL data` + ); + + // On errors, return previous value (if valid) + if (cacheDoesExist) { + const cachedItems = Object.values(cache.items); + return cachedItems; + } + } + } + + const items = Object.values(cacheItems); + return items; + } + + getRandomDeltaMinutes(): number { + const rnd = Math.random(); + return Math.floor(rnd * this.resetDeltaMinutes); + } +} diff --git a/lib/modules/datasource/github-releases/cache/index.spec.ts b/lib/modules/datasource/github-releases/cache/index.spec.ts new file mode 100644 index 00000000000000..9839f49432109f --- /dev/null +++ b/lib/modules/datasource/github-releases/cache/index.spec.ts @@ -0,0 +1,43 @@ +import { GithubHttp } from '../../../../util/http/github'; +import { CacheableGithubReleases, FetchedRelease } from '.'; + +describe('modules/datasource/github-releases/cache/index', () => { + const http = new GithubHttp(); + const cache = new CacheableGithubReleases(http, { resetDeltaMinutes: 0 }); + + const fetchedItem: FetchedRelease = { + version: '1.2.3', + releaseTimestamp: '2020-04-09T10:00:00.000Z', + isDraft: false, + isPrerelease: false, + url: 'https://example.com/', + id: 123, + name: 'Some name', + description: 'Some description', + }; + + describe('coerceFetched', () => { + it('transforms GraphQL item', () => { + expect(cache.coerceFetched(fetchedItem)).toEqual({ + description: 'Some description', + id: 123, + name: 'Some name', + releaseTimestamp: '2020-04-09T10:00:00.000Z', + url: 'https://example.com/', + version: '1.2.3', + }); + }); + + it('marks pre-release as unstable', () => { + expect( + cache.coerceFetched({ ...fetchedItem, isPrerelease: true }) + ).toMatchObject({ + isStable: false, + }); + }); + + it('filters out drafts', () => { + expect(cache.coerceFetched({ ...fetchedItem, isDraft: true })).toBeNull(); + }); + }); +}); diff --git a/lib/modules/datasource/github-releases/cache/index.ts b/lib/modules/datasource/github-releases/cache/index.ts new file mode 100644 index 00000000000000..5f7d35cfb6f8e9 --- /dev/null +++ b/lib/modules/datasource/github-releases/cache/index.ts @@ -0,0 +1,93 @@ +import type { GithubHttp } from '../../../../util/http/github'; +import { AbstractGithubDatasourceCache } from './cache-base'; +import type { CacheOptions, StoredItemBase } from './types'; + +export const query = ` +query ($owner: String!, $name: String!, $cursor: String, $count: Int!) { + repository(owner: $owner, name: $name) { + payload: releases( + first: $count + after: $cursor + orderBy: {field: CREATED_AT, direction: DESC} + ) { + nodes { + version: tagName + releaseTimestamp: publishedAt + isDraft + isPrerelease + url + id: databaseId + name + description + } + pageInfo { + hasNextPage + endCursor + } + } + } +} +`; + +export interface FetchedRelease { + version: string; + releaseTimestamp: string; + isDraft: boolean; + isPrerelease: boolean; + url: string; + id: number; + name: string; + description: string; +} + +export interface StoredRelease extends StoredItemBase { + isStable?: boolean; + url: string; + id: number; + name: string; + description: string; +} + +export class CacheableGithubReleases extends AbstractGithubDatasourceCache< + StoredRelease, + FetchedRelease +> { + cacheNs = 'github-datasource-graphql-releases'; + graphqlQuery = query; + + constructor(http: GithubHttp, opts: CacheOptions = {}) { + super(http, opts); + } + + coerceFetched(item: FetchedRelease): StoredRelease | null { + const { + version, + releaseTimestamp, + isDraft, + isPrerelease, + url, + id, + name, + description, + } = item; + + if (isDraft) { + return null; + } + + const result: StoredRelease = { + version, + releaseTimestamp, + url, + id, + name, + description, + }; + + if (isPrerelease) { + result.isStable = false; + } + + return result; + } +} diff --git a/lib/modules/datasource/github-releases/cache/types.ts b/lib/modules/datasource/github-releases/cache/types.ts new file mode 100644 index 00000000000000..898aa724e62f1d --- /dev/null +++ b/lib/modules/datasource/github-releases/cache/types.ts @@ -0,0 +1,100 @@ +/** + * Every `AbstractGithubDatasourceCache` implementation + * should have `graphqlQuery` that uses parameters + * defined this interface. + */ +export interface GithubQueryParams { + owner: string; + name: string; + cursor: string | null; + count: number; +} + +/** + * Every `AbstractGithubDatasourceCache` implementation + * should have `graphqlQuery` that resembles the structure + * of this interface. + */ +export interface QueryResponse { + repository: { + payload: { + nodes: T[]; + pageInfo: { + hasNextPage: boolean; + endCursor: string; + }; + }; + }; +} + +/** + * Base interface meant to be extended by all implementations. + * Must have `version` and `releaseTimestamp` fields. + */ +export interface StoredItemBase { + /** The values of `version` field meant to be unique. */ + version: string; + + /** The `releaseTimestamp` field meant to be ISO-encoded date. */ + releaseTimestamp: string; +} + +/** + * The data structure stored in the package cache. + */ +export interface GithubDatasourceCache { + items: Record; + + /** Cache full reset decision is based on `createdAt` value. */ + createdAt: string; + + /** Cache soft updates are performed depending on `updatedAt` value. */ + updatedAt: string; +} + +/** + * The configuration for cache. + */ +export interface CacheOptions { + /** + * How many minutes to wait until next cache update + */ + updateAfterMinutes?: number; + + /** + * How many days to wait until full cache reset (for single package). + */ + resetAfterDays?: number; + + /** + * Delays cache reset by some random amount of minutes, + * in order to stabilize load during mass cache reset. + */ + resetDeltaMinutes?: number; + + /** + * How many days ago the package should be published to be considered as stable. + * Since this period is expired, it won't be refreshed via soft updates anymore. + */ + unstableDays?: number; + + /** + * How many items per page to obtain per page during initial fetch (i.e. pre-fetch) + */ + itemsPerPrefetchPage?: number; + + /** + * How many pages to fetch (at most) during the initial fetch (i.e. pre-fetch) + */ + maxPrefetchPages?: number; + + /** + * How many items per page to obtain per page during the soft update + */ + itemsPerUpdatePage?: number; + + /** + * How many pages to fetch (at most) during the soft update + */ + maxUpdatePages?: number; +} diff --git a/lib/modules/datasource/github-releases/common.ts b/lib/modules/datasource/github-releases/common.ts index b0164ca1e1cc74..638ebdeff5f7a1 100644 --- a/lib/modules/datasource/github-releases/common.ts +++ b/lib/modules/datasource/github-releases/common.ts @@ -1,6 +1,7 @@ import { ensureTrailingSlash } from '../../../util/url'; const defaultSourceUrlBase = 'https://github.com/'; +const defaultApiBaseUrl = 'https://api.github.com/'; export function getSourceUrlBase(registryUrl: string | undefined): string { // default to GitHub.com if no GHE host is specified. @@ -9,8 +10,8 @@ export function getSourceUrlBase(registryUrl: string | undefined): string { export function getApiBaseUrl(registryUrl: string | undefined): string { const sourceUrlBase = getSourceUrlBase(registryUrl); - return sourceUrlBase === defaultSourceUrlBase - ? `https://api.github.com/` + return [defaultSourceUrlBase, defaultApiBaseUrl].includes(sourceUrlBase) + ? defaultApiBaseUrl : `${sourceUrlBase}api/v3/`; } diff --git a/lib/modules/datasource/github-releases/index.spec.ts b/lib/modules/datasource/github-releases/index.spec.ts index 2c0908962dcf06..dcfdb54654462e 100644 --- a/lib/modules/datasource/github-releases/index.spec.ts +++ b/lib/modules/datasource/github-releases/index.spec.ts @@ -1,6 +1,6 @@ import { getDigest, getPkgReleases } from '..'; -import * as httpMock from '../../../../test/http-mock'; import * as _hostRules from '../../../util/host-rules'; +import { CacheableGithubReleases } from './cache'; import { GitHubReleaseMocker } from './test'; import { GithubReleasesDatasource } from '.'; @@ -8,25 +8,15 @@ jest.mock('../../../util/host-rules'); const hostRules: any = _hostRules; const githubApiHost = 'https://api.github.com'; -const githubEnterpriseApiHost = 'https://git.enterprise.com'; - -const responseBody = [ - { tag_name: 'a', published_at: '2020-03-09T13:00:00Z' }, - { tag_name: 'v', published_at: '2020-03-09T12:00:00Z' }, - { tag_name: '1.0.0', published_at: '2020-03-09T11:00:00Z' }, - { tag_name: 'v1.1.0', draft: false, published_at: '2020-03-09T10:00:00Z' }, - { tag_name: '1.2.0', draft: true, published_at: '2020-03-09T10:00:00Z' }, - { - tag_name: '2.0.0', - published_at: '2020-04-09T10:00:00Z', - prerelease: true, - }, -]; describe('modules/datasource/github-releases/index', () => { - const githubReleases = new GithubReleasesDatasource(); + const cacheGetItems = jest.spyOn( + CacheableGithubReleases.prototype, + 'getItems' + ); beforeEach(() => { + jest.resetAllMocks(); hostRules.hosts.mockReturnValue([]); hostRules.find.mockReturnValue({ token: 'some-token', @@ -35,39 +25,36 @@ describe('modules/datasource/github-releases/index', () => { describe('getReleases', () => { it('returns releases', async () => { - httpMock - .scope(githubApiHost) - .get('/repos/some/dep/releases?per_page=100') - .reply(200, responseBody); + cacheGetItems.mockResolvedValueOnce([ + { version: 'a', releaseTimestamp: '2020-03-09T13:00:00Z' }, + { version: 'v', releaseTimestamp: '2020-03-09T12:00:00Z' }, + { version: '1.0.0', releaseTimestamp: '2020-03-09T11:00:00Z' }, + { version: 'v1.1.0', releaseTimestamp: '2020-03-09T10:00:00Z' }, + { + version: '2.0.0', + releaseTimestamp: '2020-04-09T10:00:00Z', + isStable: false, + }, + ] as never); const res = await getPkgReleases({ datasource: GithubReleasesDatasource.id, depName: 'some/dep', }); - expect(res).toMatchSnapshot(); - expect(res.releases).toHaveLength(3); - expect( - res.releases.find((release) => release.version === 'v1.1.0') - ).toBeDefined(); - expect( - res.releases.find((release) => release.version === '1.2.0') - ).toBeUndefined(); - expect( - res.releases.find((release) => release.version === '2.0.0').isStable - ).toBeFalse(); - }); - it('supports ghe', async () => { - const packageName = 'some/dep'; - httpMock - .scope(githubEnterpriseApiHost) - .get(`/api/v3/repos/${packageName}/releases?per_page=100`) - .reply(200, responseBody); - const res = await githubReleases.getReleases({ - registryUrl: 'https://git.enterprise.com', - packageName, + expect(res).toMatchObject({ + registryUrl: 'https://github.com', + releases: [ + { releaseTimestamp: '2020-03-09T11:00:00.000Z', version: '1.0.0' }, + { version: 'v1.1.0', releaseTimestamp: '2020-03-09T10:00:00.000Z' }, + { + version: '2.0.0', + releaseTimestamp: '2020-04-09T10:00:00.000Z', + isStable: false, + }, + ], + sourceUrl: 'https://github.com/some/dep', }); - expect(res).toMatchSnapshot(); }); }); diff --git a/lib/modules/datasource/github-releases/index.ts b/lib/modules/datasource/github-releases/index.ts index 63f8db6ea1f186..c28d774e083114 100644 --- a/lib/modules/datasource/github-releases/index.ts +++ b/lib/modules/datasource/github-releases/index.ts @@ -4,7 +4,13 @@ import { cache } from '../../../util/cache/package/decorator'; import { GithubHttp } from '../../../util/http/github'; import { newlineRegex, regEx } from '../../../util/regex'; import { Datasource } from '../datasource'; -import type { DigestConfig, GetReleasesConfig, ReleaseResult } from '../types'; +import type { + DigestConfig, + GetReleasesConfig, + Release, + ReleaseResult, +} from '../types'; +import { CacheableGithubReleases } from './cache'; import { getApiBaseUrl, getSourceUrl } from './common'; import type { DigestAsset, GithubRelease, GithubReleaseAsset } from './types'; @@ -27,9 +33,12 @@ export class GithubReleasesDatasource extends Datasource { override http: GithubHttp; + private releasesCache: CacheableGithubReleases; + constructor(id = GithubReleasesDatasource.id) { super(id); this.http = new GithubHttp(id); + this.releasesCache = new CacheableGithubReleases(this.http); } async findDigestFile( @@ -218,11 +227,6 @@ export class GithubReleasesDatasource extends Datasource { return newDigest; } - @cache({ - namespace: 'datasource-github-releases', - key: ({ packageName: repo, registryUrl }: GetReleasesConfig) => - `${registryUrl}:${repo}:tags`, - }) /** * github.getReleases * @@ -233,27 +237,22 @@ export class GithubReleasesDatasource extends Datasource { * - Sanitize the versions if desired (e.g. strip out leading 'v') * - Return a dependency object containing sourceUrl string and releases array */ - async getReleases({ - packageName: repo, - registryUrl, - }: GetReleasesConfig): Promise { - const apiBaseUrl = getApiBaseUrl(registryUrl); - const url = `${apiBaseUrl}repos/${repo}/releases?per_page=100`; - const res = await this.http.getJson(url, { - paginate: true, - }); - const githubReleases = res.body; - const dependency: ReleaseResult = { - sourceUrl: getSourceUrl(repo, registryUrl), - releases: githubReleases - .filter(({ draft }) => draft !== true) - .map(({ tag_name, published_at, prerelease }) => ({ - version: tag_name, - gitRef: tag_name, - releaseTimestamp: published_at, - isStable: prerelease ? false : undefined, - })), - }; - return dependency; + async getReleases(config: GetReleasesConfig): Promise { + let result: ReleaseResult | null = null; + const releases = await this.releasesCache.getItems(config); + if (releases.length) { + result = { + sourceUrl: getSourceUrl(config.packageName, config.registryUrl), + releases: releases.map((item) => { + const { version, releaseTimestamp, isStable } = item; + const result: Release = { version, releaseTimestamp }; + if (isStable !== undefined) { + result.isStable = isStable; + } + return result; + }), + }; + } + return result; } } diff --git a/lib/modules/datasource/github-tags/__snapshots__/index.spec.ts.snap b/lib/modules/datasource/github-tags/__snapshots__/index.spec.ts.snap deleted file mode 100644 index 2fad1922db34a3..00000000000000 --- a/lib/modules/datasource/github-tags/__snapshots__/index.spec.ts.snap +++ /dev/null @@ -1,37 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`modules/datasource/github-tags/index getReleases returns tags 1`] = ` -Object { - "registryUrl": "https://github.com", - "releases": Array [ - Object { - "gitRef": "v1.0.0", - "releaseTimestamp": "1970-01-01T00:00:00.000Z", - "version": "v1.0.0", - }, - Object { - "gitRef": "v1.1.0", - "isStable": false, - "releaseTimestamp": "1970-01-01T00:00:00.001Z", - "version": "v1.1.0", - }, - ], - "sourceUrl": "https://github.com/some/dep2", -} -`; - -exports[`modules/datasource/github-tags/index getReleases supports ghe 1`] = ` -Object { - "releases": Array [ - Object { - "gitRef": "v1.0.0", - "version": "v1.0.0", - }, - Object { - "gitRef": "v1.1.0", - "version": "v1.1.0", - }, - ], - "sourceUrl": "https://git.enterprise.com/some/dep2", -} -`; diff --git a/lib/modules/datasource/github-tags/cache.spec.ts b/lib/modules/datasource/github-tags/cache.spec.ts new file mode 100644 index 00000000000000..3d8f02ff059774 --- /dev/null +++ b/lib/modules/datasource/github-tags/cache.spec.ts @@ -0,0 +1,51 @@ +import { GithubHttp } from '../../../util/http/github'; +import { CacheableGithubTags, FetchedTag } from './cache'; + +describe('modules/datasource/github-tags/cache', () => { + const http = new GithubHttp(); + const cache = new CacheableGithubTags(http, { resetDeltaMinutes: 0 }); + + const fetchedItem: FetchedTag = { + version: '1.2.3', + target: { + type: 'Commit', + hash: 'abc', + releaseTimestamp: '2020-04-09T10:00:00.000Z', + }, + }; + + describe('coerceFetched', () => { + it('transforms GraphQL items', () => { + expect(cache.coerceFetched(fetchedItem)).toEqual({ + version: '1.2.3', + hash: 'abc', + releaseTimestamp: '2020-04-09T10:00:00.000Z', + }); + expect( + cache.coerceFetched({ + version: '1.2.3', + target: { + type: 'Tag', + target: { + hash: 'abc', + releaseTimestamp: '2020-04-09T10:00:00.000Z', + }, + }, + }) + ).toEqual({ + version: '1.2.3', + hash: 'abc', + releaseTimestamp: '2020-04-09T10:00:00.000Z', + }); + }); + + it('returns null for tags we can not process', () => { + expect( + cache.coerceFetched({ + version: '1.2.3', + target: { type: 'Blob' } as never, + }) + ).toBeNull(); + }); + }); +}); diff --git a/lib/modules/datasource/github-tags/cache.ts b/lib/modules/datasource/github-tags/cache.ts new file mode 100644 index 00000000000000..1f7d1fb407daf3 --- /dev/null +++ b/lib/modules/datasource/github-tags/cache.ts @@ -0,0 +1,88 @@ +import type { GithubHttp } from '../../../util/http/github'; +import { AbstractGithubDatasourceCache } from '../github-releases/cache/cache-base'; +import type { + CacheOptions, + StoredItemBase, +} from '../github-releases/cache/types'; + +const query = ` +query ($owner: String!, $name: String!, $cursor: String, $count: Int!) { + repository(owner: $owner, name: $name) { + payload: refs( + first: $count + after: $cursor + orderBy: {field: TAG_COMMIT_DATE, direction: DESC} + refPrefix: "refs/tags/" + ) { + nodes { + version: name + target { + type: __typename + ... on Commit { + hash: oid + releaseTimestamp: committedDate + } + ... on Tag { + target { + ... on Commit { + hash: oid + releaseTimestamp: committedDate + } + } + } + } + } + pageInfo { + hasNextPage + endCursor + } + } + } +} +`; + +export interface FetchedTag { + version: string; + target: + | { + type: 'Commit'; + hash: string; + releaseTimestamp: string; + } + | { + type: 'Tag'; + target: { + hash: string; + releaseTimestamp: string; + }; + }; +} + +export interface StoredTag extends StoredItemBase { + hash: string; + releaseTimestamp: string; +} + +export class CacheableGithubTags extends AbstractGithubDatasourceCache< + StoredTag, + FetchedTag +> { + readonly cacheNs = 'github-datasource-graphql-tags'; + readonly graphqlQuery = query; + + constructor(http: GithubHttp, opts: CacheOptions = {}) { + super(http, opts); + } + + coerceFetched(item: FetchedTag): StoredTag | null { + const { version, target } = item; + if (target.type === 'Commit') { + const { hash, releaseTimestamp } = target; + return { version, hash, releaseTimestamp }; + } else if (target.type === 'Tag') { + const { hash, releaseTimestamp } = target.target; + return { version, hash, releaseTimestamp }; + } + return null; + } +} diff --git a/lib/modules/datasource/github-tags/index.spec.ts b/lib/modules/datasource/github-tags/index.spec.ts index e8b978e5ae923f..e3315fa0844549 100644 --- a/lib/modules/datasource/github-tags/index.spec.ts +++ b/lib/modules/datasource/github-tags/index.spec.ts @@ -1,6 +1,8 @@ import { getPkgReleases } from '..'; import * as httpMock from '../../../../test/http-mock'; import * as _hostRules from '../../../util/host-rules'; +import { CacheableGithubReleases } from '../github-releases/cache'; +import { CacheableGithubTags } from './cache'; import { GithubTagsDatasource } from '.'; jest.mock('../../../util/host-rules'); @@ -10,6 +12,15 @@ const githubApiHost = 'https://api.github.com'; const githubEnterpriseApiHost = 'https://git.enterprise.com'; describe('modules/datasource/github-tags/index', () => { + const releasesCacheGetItems = jest.spyOn( + CacheableGithubReleases.prototype, + 'getItems' + ); + const tagsCacheGetItems = jest.spyOn( + CacheableGithubTags.prototype, + 'getItems' + ); + const github = new GithubTagsDatasource(); beforeEach(() => { @@ -116,37 +127,38 @@ describe('modules/datasource/github-tags/index', () => { const depName = 'some/dep2'; it('returns tags', async () => { - const tags = [{ name: 'v1.0.0' }, { name: 'v1.1.0' }]; - const releases = tags.map((item, idx) => ({ - tag_name: item.name, - published_at: new Date(idx), - prerelease: !!idx, - })); - httpMock - .scope(githubApiHost) - .get(`/repos/${depName}/tags?per_page=100`) - .reply(200, tags) - .get(`/repos/${depName}/releases?per_page=100`) - .reply(200, releases); + tagsCacheGetItems.mockResolvedValueOnce([ + { version: 'v1.0.0', releaseTimestamp: '2021-01-01', hash: '123' }, + { version: 'v2.0.0', releaseTimestamp: '2022-01-01', hash: 'abc' }, + ]); + releasesCacheGetItems.mockResolvedValueOnce([ + { version: 'v1.0.0', releaseTimestamp: '2021-01-01', isStable: true }, + { version: 'v2.0.0', releaseTimestamp: '2022-01-01', isStable: false }, + ] as never); + const res = await getPkgReleases({ datasource: github.id, depName }); - expect(res).toMatchSnapshot(); - expect(res.releases).toHaveLength(2); - }); - it('supports ghe', async () => { - const body = [{ name: 'v1.0.0' }, { name: 'v1.1.0' }]; - httpMock - .scope(githubEnterpriseApiHost) - .get(`/api/v3/repos/${depName}/tags?per_page=100`) - .reply(200, body) - .get(`/api/v3/repos/${depName}/releases?per_page=100`) - .reply(404); - - const res = await github.getReleases({ - registryUrl: 'https://git.enterprise.com', - packageName: depName, + expect(res).toEqual({ + registryUrl: 'https://github.com', + sourceUrl: 'https://github.com/some/dep2', + releases: [ + { + gitRef: 'v1.0.0', + hash: '123', + isStable: true, + releaseTimestamp: '2021-01-01T00:00:00.000Z', + version: 'v1.0.0', + }, + + { + gitRef: 'v2.0.0', + hash: 'abc', + isStable: false, + releaseTimestamp: '2022-01-01T00:00:00.000Z', + version: 'v2.0.0', + }, + ], }); - expect(res).toMatchSnapshot(); }); }); }); diff --git a/lib/modules/datasource/github-tags/index.ts b/lib/modules/datasource/github-tags/index.ts index e54974d2d5c518..03a3bb573c35ab 100644 --- a/lib/modules/datasource/github-tags/index.ts +++ b/lib/modules/datasource/github-tags/index.ts @@ -8,13 +8,17 @@ import type { Release, ReleaseResult, } from '../types'; -import type { GitHubTag, TagResponse } from './types'; +import { CacheableGithubTags } from './cache'; +import type { TagResponse } from './types'; export class GithubTagsDatasource extends GithubReleasesDatasource { static override readonly id = 'github-tags'; + private tagsCache: CacheableGithubTags; + constructor() { super(GithubTagsDatasource.id); + this.tagsCache = new CacheableGithubTags(this.http); } @cache({ @@ -93,45 +97,21 @@ export class GithubTagsDatasource extends GithubReleasesDatasource { this.getCommit(registryUrl, repo!); } - @cache({ - ttlMinutes: 10, - namespace: `datasource-${GithubTagsDatasource.id}`, - key: ({ registryUrl, packageName: repo }: GetReleasesConfig) => - `${registryUrl}:${repo}:tags`, - }) - async getTags({ - registryUrl, - packageName: repo, - }: GetReleasesConfig): Promise { - const apiBaseUrl = getApiBaseUrl(registryUrl); - // tag - const url = `${apiBaseUrl}repos/${repo}/tags?per_page=100`; - - const versions = ( - await this.http.getJson(url, { - paginate: true, - }) - ).body.map((o) => o.name); - const dependency: ReleaseResult = { - sourceUrl: getSourceUrl(repo, registryUrl), - releases: versions.map((version) => ({ - version, - gitRef: version, - })), - }; - return dependency; - } - override async getReleases( config: GetReleasesConfig ): Promise { - const tagsResult = await this.getTags(config); + const tagReleases = await this.tagsCache.getItems(config); // istanbul ignore if - if (!tagsResult) { + if (!tagReleases.length) { return null; } + const tagsResult: ReleaseResult = { + sourceUrl: getSourceUrl(config.packageName, config.registryUrl), + releases: tagReleases.map((item) => ({ ...item, gitRef: item.version })), + }; + try { // Fetch additional data from releases endpoint when possible const releasesResult = await super.getReleases(config); diff --git a/lib/modules/datasource/go/__snapshots__/releases-direct.spec.ts.snap b/lib/modules/datasource/go/__snapshots__/releases-direct.spec.ts.snap index 80e885cb4ee953..5d82c767a1eaf0 100644 --- a/lib/modules/datasource/go/__snapshots__/releases-direct.spec.ts.snap +++ b/lib/modules/datasource/go/__snapshots__/releases-direct.spec.ts.snap @@ -1,21 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`modules/datasource/go/releases-direct getReleases processes real data 1`] = ` -Object { - "releases": Array [ - Object { - "gitRef": "v1.0.0", - "version": "v1.0.0", - }, - Object { - "gitRef": "v2.0.0", - "version": "v2.0.0", - }, - ], - "sourceUrl": "https://github.com/golang/text", -} -`; - exports[`modules/datasource/go/releases-direct getReleases support bitbucket tags 1`] = ` Object { "registryUrl": "https://bitbucket.org", @@ -35,22 +19,6 @@ Object { } `; -exports[`modules/datasource/go/releases-direct getReleases support ghe 1`] = ` -Object { - "releases": Array [ - Object { - "gitRef": "v1.0.0", - "version": "v1.0.0", - }, - Object { - "gitRef": "v2.0.0", - "version": "v2.0.0", - }, - ], - "sourceUrl": "https://git.enterprise.com/example/module", -} -`; - exports[`modules/datasource/go/releases-direct getReleases support gitlab 1`] = ` Object { "releases": Array [ diff --git a/lib/modules/datasource/go/releases-direct.spec.ts b/lib/modules/datasource/go/releases-direct.spec.ts index 6c6c1159e2f41e..5753655146d089 100644 --- a/lib/modules/datasource/go/releases-direct.spec.ts +++ b/lib/modules/datasource/go/releases-direct.spec.ts @@ -1,6 +1,7 @@ import * as httpMock from '../../../../test/http-mock'; import { mocked } from '../../../../test/util'; import * as _hostRules from '../../../util/host-rules'; +import { GithubTagsDatasource } from '../github-tags'; import { BaseGoDatasource } from './base'; import { GoDirectDatasource } from './releases-direct'; @@ -12,6 +13,11 @@ const getDatasourceSpy = jest.spyOn(BaseGoDatasource, 'getDatasource'); const hostRules = mocked(_hostRules); describe('modules/datasource/go/releases-direct', () => { + const githubGetTags = jest.spyOn( + GithubTagsDatasource.prototype, + 'getReleases' + ); + beforeEach(() => { jest.resetAllMocks(); hostRules.find.mockReturnValue({}); @@ -46,18 +52,24 @@ describe('modules/datasource/go/releases-direct', () => { packageName: 'golang/text', registryUrl: 'https://github.com', }); - httpMock - .scope('https://api.github.com/') - .get('/repos/golang/text/tags?per_page=100') - .reply(200, [{ name: 'v1.0.0' }, { name: 'v2.0.0' }]) - .get('/repos/golang/text/releases?per_page=100') - .reply(200, []); + githubGetTags.mockResolvedValueOnce({ + releases: [ + { gitRef: 'v1.0.0', version: 'v1.0.0' }, + { gitRef: 'v2.0.0', version: 'v2.0.0' }, + ], + }); + const res = await datasource.getReleases({ packageName: 'golang.org/x/text', }); - expect(res).toMatchSnapshot(); - expect(res).not.toBeNull(); - expect(res).toBeDefined(); + + expect(res).toEqual({ + releases: [ + { gitRef: 'v1.0.0', version: 'v1.0.0' }, + { gitRef: 'v2.0.0', version: 'v2.0.0' }, + ], + sourceUrl: 'https://github.com/golang/text', + }); }); it('support gitlab', async () => { @@ -125,18 +137,27 @@ describe('modules/datasource/go/releases-direct', () => { registryUrl: 'https://git.enterprise.com', packageName: 'example/module', }); - httpMock - .scope('https://git.enterprise.com/') - .get('/api/v3/repos/example/module/tags?per_page=100') - .reply(200, [{ name: 'v1.0.0' }, { name: 'v2.0.0' }]) - .get('/api/v3/repos/example/module/releases?per_page=100') - .reply(200, []); + githubGetTags.mockResolvedValueOnce({ + releases: [ + { gitRef: 'v1.0.0', version: 'v1.0.0' }, + { gitRef: 'v2.0.0', version: 'v2.0.0' }, + ], + }); + const res = await datasource.getReleases({ packageName: 'git.enterprise.com/example/module', }); - expect(res).toMatchSnapshot(); - expect(res).not.toBeNull(); - expect(res).toBeDefined(); + + expect(res).toEqual({ + releases: [ + { gitRef: 'v1.0.0', version: 'v1.0.0' }, + { gitRef: 'v2.0.0', version: 'v2.0.0' }, + ], + sourceUrl: 'https://git.enterprise.com/example/module', + }); + expect(githubGetTags.mock.calls).toMatchObject([ + [{ registryUrl: 'https://git.enterprise.com' }], + ]); }); it('works for known servers', async () => { @@ -155,20 +176,7 @@ describe('modules/datasource/go/releases-direct', () => { packageName: 'go-x/x', registryUrl: 'https://github.com', }); - httpMock - .scope('https://api.github.com/') - .get('/repos/x/text/tags?per_page=100') - .reply(200, []) - .get('/repos/x/text/releases?per_page=100') - .reply(200, []) - .get('/repos/x/text/tags?per_page=100') - .reply(200, []) - .get('/repos/x/text/releases?per_page=100') - .reply(200, []) - .get('/repos/go-x/x/tags?per_page=100') - .reply(200, []) - .get('/repos/go-x/x/releases?per_page=100') - .reply(200, []); + githubGetTags.mockResolvedValue({ releases: [] }); const packages = [ { packageName: 'github.com/x/text' }, { packageName: 'gopkg.in/x/text' }, @@ -178,6 +186,7 @@ describe('modules/datasource/go/releases-direct', () => { const res = await datasource.getReleases(pkg); expect(res.releases).toBeEmpty(); } + expect(githubGetTags).toHaveBeenCalledTimes(3); }); it('support gitlab subgroups', async () => { @@ -220,16 +229,15 @@ describe('modules/datasource/go/releases-direct', () => { { packageName: 'github.com/x/text/a' }, { packageName: 'github.com/x/text/b' }, ]; - const tags = [{ name: 'a/v1.0.0' }, { name: 'b/v2.0.0' }]; - for (const pkg of packages) { - httpMock - .scope('https://api.github.com/') - .get('/repos/x/text/tags?per_page=100') - .reply(200, tags) - .get('/repos/x/text/releases?per_page=100') - .reply(200, []); + githubGetTags.mockResolvedValue({ + releases: [ + { version: 'a/v1.0.0', gitRef: 'a/v1.0.0' }, + { version: 'b/v2.0.0', gitRef: 'b/v2.0.0' }, + ], + }); + for (const pkg of packages) { const prefix = pkg.packageName.split('/')[3]; const result = await datasource.getReleases(pkg); expect(result.releases).toHaveLength(1); @@ -252,16 +260,15 @@ describe('modules/datasource/go/releases-direct', () => { { packageName: 'github.com/x/text/a' }, { packageName: 'github.com/x/text/b' }, ]; - const tags = [{ name: 'v1.0.0' }, { name: 'v2.0.0' }]; - for (const pkg of packages) { - httpMock - .scope('https://api.github.com/') - .get('/repos/x/text/tags?per_page=100') - .reply(200, tags) - .get('/repos/x/text/releases?per_page=100') - .reply(200, []); + githubGetTags.mockResolvedValue({ + releases: [ + { version: 'v1.0.0', gitRef: 'v1.0.0' }, + { version: 'v2.0.0', gitRef: 'v2.0.0' }, + ], + }); + for (const pkg of packages) { const result = await datasource.getReleases(pkg); expect(result.releases).toHaveLength(0); } @@ -274,24 +281,20 @@ describe('modules/datasource/go/releases-direct', () => { registryUrl: 'https://github.com', }); const pkg = { packageName: 'github.com/x/text/b/v2' }; - const tags = [ - { name: 'a/v1.0.0' }, - { name: 'v5.0.0' }, - { name: 'b/v2.0.0' }, - { name: 'b/v3.0.0' }, - ]; - httpMock - .scope('https://api.github.com/') - .get('/repos/x/text/tags?per_page=100') - .reply(200, tags) - .get('/repos/x/text/releases?per_page=100') - .reply(200, []); + githubGetTags.mockResolvedValue({ + releases: [ + { version: 'a/v1.0.0', gitRef: 'a/v1.0.0' }, + { version: 'v5.0.0', gitRef: 'v5.0.0' }, + { version: 'b/v2.0.0', gitRef: 'b/v2.0.0' }, + { version: 'b/v3.0.0', gitRef: 'b/v3.0.0' }, + ], + }); const result = await datasource.getReleases(pkg); expect(result.releases).toEqual([ - { gitRef: 'b/v2.0.0', version: 'v2.0.0' }, - { gitRef: 'b/v3.0.0', version: 'v3.0.0' }, + { version: 'v2.0.0', gitRef: 'b/v2.0.0' }, + { version: 'v3.0.0', gitRef: 'b/v3.0.0' }, ]); }); }); diff --git a/lib/modules/datasource/go/releases-goproxy.spec.ts b/lib/modules/datasource/go/releases-goproxy.spec.ts index a2bbec4a9d5de4..9936e8d1bf7bd2 100644 --- a/lib/modules/datasource/go/releases-goproxy.spec.ts +++ b/lib/modules/datasource/go/releases-goproxy.spec.ts @@ -1,10 +1,22 @@ import * as httpMock from '../../../../test/http-mock'; import { loadFixture } from '../../../../test/util'; +import { GithubReleasesDatasource } from '../github-releases'; +import { GithubTagsDatasource } from '../github-tags'; import { GoProxyDatasource } from './releases-goproxy'; const datasource = new GoProxyDatasource(); describe('modules/datasource/go/releases-goproxy', () => { + const githubGetReleases = jest.spyOn( + GithubReleasesDatasource.prototype, + 'getReleases' + ); + + const githubGetTags = jest.spyOn( + GithubTagsDatasource.prototype, + 'getReleases' + ); + it('encodeCase', () => { expect(datasource.encodeCase('foo')).toBe('foo'); expect(datasource.encodeCase('Foo')).toBe('!foo'); @@ -276,12 +288,13 @@ describe('modules/datasource/go/releases-goproxy', () => { process.env.GOPROXY = baseUrl; process.env.GOPRIVATE = 'github.com/google/*'; - httpMock - .scope('https://api.github.com/') - .get('/repos/google/btree/tags?per_page=100') - .reply(200, [{ name: 'v1.0.0' }, { name: 'v1.0.1' }]) - .get('/repos/google/btree/releases?per_page=100') - .reply(200, []); + githubGetTags.mockResolvedValueOnce({ + releases: [ + { gitRef: 'v1.0.0', version: 'v1.0.0' }, + { gitRef: 'v1.0.1', version: 'v1.0.1' }, + ], + }); + githubGetReleases.mockResolvedValueOnce({ releases: [] }); const res = await datasource.getReleases({ packageName: 'github.com/google/btree', @@ -458,12 +471,13 @@ describe('modules/datasource/go/releases-goproxy', () => { .get('/@v/list') .reply(410); - httpMock - .scope('https://api.github.com/') - .get('/repos/foo/bar/tags?per_page=100') - .reply(200, [{ name: 'v1.0.0' }, { name: 'v1.0.1' }]) - .get('/repos/foo/bar/releases?per_page=100') - .reply(200, []); + githubGetTags.mockResolvedValueOnce({ + releases: [ + { gitRef: 'v1.0.0', version: 'v1.0.0' }, + { gitRef: 'v1.0.1', version: 'v1.0.1' }, + ], + }); + githubGetReleases.mockResolvedValueOnce({ releases: [] }); const res = await datasource.getReleases({ packageName: 'github.com/foo/bar', diff --git a/lib/util/http/github.ts b/lib/util/http/github.ts index aa39594e043293..e4b43912763106 100644 --- a/lib/util/http/github.ts +++ b/lib/util/http/github.ts @@ -45,7 +45,7 @@ interface GithubGraphqlRepoData { repository?: T; } -interface GithubGraphqlResponse { +export interface GithubGraphqlResponse { data?: T; errors?: { type?: string; diff --git a/lib/workers/repository/process/lookup/index.spec.ts b/lib/workers/repository/process/lookup/index.spec.ts index 3c2a480f320839..090143ceb9f06e 100644 --- a/lib/workers/repository/process/lookup/index.spec.ts +++ b/lib/workers/repository/process/lookup/index.spec.ts @@ -19,22 +19,6 @@ import * as lookup from '.'; jest.mock('../../../../modules/datasource/docker'); -jest.mock('../../../../modules/datasource/git-refs', function () { - const { GitRefsDatasource: Orig } = jest.requireActual( - '../../../../modules/datasource/git-refs' - ); - const Mocked = jest.fn().mockImplementation(() => ({ - getReleases: () => - Promise.resolve({ - releases: [{ version: 'master' }], - }), - getDigest: () => - Promise.resolve('4b825dc642cb6eb9a060e54bf8d69288fbee4904'), - })); - Mocked['id'] = Orig.id; - return { GitRefsDatasource: Mocked }; -}); - const fixtureRoot = '../../../../config/npm'; const qJson = { ...Fixtures.getJson('01.json', fixtureRoot), @@ -53,6 +37,11 @@ const docker = mocked(DockerDatasource.prototype); let config: LookupUpdateConfig; describe('workers/repository/process/lookup/index', () => { + const getGithubReleases = jest.spyOn( + GithubReleasesDatasource.prototype, + 'getReleases' + ); + beforeEach(() => { // TODO: fix types #7154 config = partial(getConfig() as never); @@ -60,6 +49,14 @@ describe('workers/repository/process/lookup/index', () => { config.versioning = npmVersioningId; config.rangeStrategy = 'replace'; jest.resetAllMocks(); + jest + .spyOn(GitRefsDatasource.prototype, 'getReleases') + .mockResolvedValueOnce({ + releases: [{ version: 'master' }], + }); + jest + .spyOn(GitRefsDatasource.prototype, 'getDigest') + .mockResolvedValueOnce('4b825dc642cb6eb9a060e54bf8d69288fbee4904'); }); // TODO: fix mocks @@ -884,14 +881,13 @@ describe('workers/repository/process/lookup/index', () => { config.currentValue = '1.4.4'; config.depName = 'some/action'; config.datasource = GithubReleasesDatasource.id; - httpMock - .scope('https://api.github.com') - .get('/repos/some/action/releases?per_page=100') - .reply(200, [ - { tag_name: '1.4.4' }, - { tag_name: '2.0.0' }, - { tag_name: '2.1.0', prerelease: true }, - ]); + getGithubReleases.mockResolvedValueOnce({ + releases: [ + { version: '1.4.4' }, + { version: '2.0.0' }, + { version: '2.1.0', isStable: false }, + ], + }); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot([ { newValue: '2.0.0', updateType: 'major' }, ]); @@ -907,14 +903,13 @@ describe('workers/repository/process/lookup/index', () => { yesterday.setDate(yesterday.getDate() - 1); const lastWeek = new Date(); lastWeek.setDate(lastWeek.getDate() - 7); - httpMock - .scope('https://api.github.com') - .get('/repos/some/action/releases?per_page=100') - .reply(200, [ - { tag_name: '1.4.4' }, - { tag_name: '1.4.5', published_at: lastWeek.toISOString() }, - { tag_name: '1.4.6', published_at: yesterday.toISOString() }, - ]); + getGithubReleases.mockResolvedValueOnce({ + releases: [ + { version: '1.4.4' }, + { version: '1.4.5', releaseTimestamp: lastWeek.toISOString() }, + { version: '1.4.6', releaseTimestamp: yesterday.toISOString() }, + ], + }); const res = await lookup.lookupUpdates(config); expect(res.updates).toHaveLength(1); expect(res.updates[0].newVersion).toBe('1.4.6'); @@ -931,14 +926,13 @@ describe('workers/repository/process/lookup/index', () => { yesterday.setDate(yesterday.getDate() - 1); const lastWeek = new Date(); lastWeek.setDate(lastWeek.getDate() - 7); - httpMock - .scope('https://api.github.com') - .get('/repos/some/action/releases?per_page=100') - .reply(200, [ - { tag_name: '1.4.4' }, - { tag_name: '1.4.5', published_at: lastWeek.toISOString() }, - { tag_name: '1.4.6', published_at: yesterday.toISOString() }, - ]); + getGithubReleases.mockResolvedValueOnce({ + releases: [ + { version: '1.4.4' }, + { version: '1.4.5', releaseTimestamp: lastWeek.toISOString() }, + { version: '1.4.6', releaseTimestamp: yesterday.toISOString() }, + ], + }); const res = await lookup.lookupUpdates(config); expect(res.updates).toHaveLength(1); expect(res.updates[0].newVersion).toBe('1.4.5'); diff --git a/lib/workers/repository/update/pr/changelog/github.spec.ts b/lib/workers/repository/update/pr/changelog/github.spec.ts index 0b36cb106f70ea..313d4d55d2bda0 100644 --- a/lib/workers/repository/update/pr/changelog/github.spec.ts +++ b/lib/workers/repository/update/pr/changelog/github.spec.ts @@ -1,6 +1,7 @@ import * as httpMock from '../../../../../../test/http-mock'; import { GlobalConfig } from '../../../../../config/global'; import { PlatformId } from '../../../../../constants'; +import { CacheableGithubTags } from '../../../../../modules/datasource/github-tags/cache'; import * as semverVersioning from '../../../../../modules/versioning/semver'; import * as hostRules from '../../../../../util/host-rules'; import type { BranchUpgradeConfig } from '../../../../types'; @@ -35,6 +36,7 @@ describe('workers/repository/update/pr/changelog/github', () => { afterEach(() => { // FIXME: add missing http mocks httpMock.clear(false); + jest.resetAllMocks(); }); describe('getChangeLogJSON', () => { @@ -297,15 +299,17 @@ describe('workers/repository/update/pr/changelog/github', () => { }); it('works with same version releases but different prefix', async () => { - httpMock - .scope('https://api.github.com/') - .get('/repos/chalk/chalk/tags?per_page=100') - .reply(200, [ - { name: 'v1.0.1' }, - { name: '1.0.1' }, - { name: 'correctPrefix/target@1.0.1' }, - { name: 'wrongPrefix/target-1.0.1' }, - ]); + const githubTagsMock = jest.spyOn( + CacheableGithubTags.prototype, + 'getItems' + ); + + githubTagsMock.mockResolvedValue([ + { version: 'v1.0.1' }, + { version: '1.0.1' }, + { version: 'correctPrefix/target@1.0.1' }, + { version: 'wrongPrefix/target-1.0.1' }, + ] as never); const upgradeData: BranchUpgradeConfig = { manager: 'some-manager', diff --git a/lib/workers/repository/update/pr/changelog/github/index.ts b/lib/workers/repository/update/pr/changelog/github/index.ts index 4ced3f393b1c19..5f8817ef7d2a9a 100644 --- a/lib/workers/repository/update/pr/changelog/github/index.ts +++ b/lib/workers/repository/update/pr/changelog/github/index.ts @@ -1,7 +1,7 @@ import changelogFilenameRegex from 'changelog-filename-regex'; import { logger } from '../../../../../../logger'; -import type { GithubRelease } from '../../../../../../modules/datasource/github-releases/types'; -import type { GitHubTag } from '../../../../../../modules/datasource/github-tags/types'; +import { CacheableGithubReleases } from '../../../../../../modules/datasource/github-releases/cache'; +import { CacheableGithubTags } from '../../../../../../modules/datasource/github-tags/cache'; import type { GithubGitBlob, GithubGitTree, @@ -14,25 +14,26 @@ import type { ChangeLogFile, ChangeLogNotes } from '../types'; export const id = 'github-changelog'; const http = new GithubHttp(id); +const tagsCache = new CacheableGithubTags(http); +const releasesCache = new CacheableGithubReleases(http); export async function getTags( endpoint: string, repository: string ): Promise { logger.trace('github.getTags()'); - const url = `${endpoint}repos/${repository}/tags?per_page=100`; try { - const res = await http.getJson(url, { - paginate: true, + const tags = await tagsCache.getItems({ + registryUrl: endpoint, + packageName: repository, }); - const tags = res.body; - + // istanbul ignore if if (!tags.length) { logger.debug({ repository }, 'repository has no Github tags'); } - return tags.map((tag) => tag.name).filter(Boolean); + return tags.map(({ version }) => version).filter(Boolean); } catch (err) { logger.debug( { sourceRepo: repository, err }, @@ -110,16 +111,19 @@ export async function getReleaseList( repository: string ): Promise { logger.trace('github.getReleaseList()'); - const url = `${ensureTrailingSlash(apiBaseUrl)}repos/${repository}/releases`; - const res = await http.getJson(`${url}?per_page=100`, { - paginate: true, + const notesSourceUrl = `${ensureTrailingSlash( + apiBaseUrl + )}repos/${repository}/releases`; + const items = await releasesCache.getItems({ + registryUrl: apiBaseUrl, + packageName: repository, }); - return res.body.map((release) => ({ - url: release.html_url, - notesSourceUrl: url, - id: release.id, - tag: release.tag_name, - name: release.name, - body: release.body, + return items.map(({ url, id, version: tag, name, description: body }) => ({ + url, + notesSourceUrl, + id, + tag, + name, + body, })); } diff --git a/lib/workers/repository/update/pr/changelog/index.spec.ts b/lib/workers/repository/update/pr/changelog/index.spec.ts index 67139d656665bc..570c613e9cebbf 100644 --- a/lib/workers/repository/update/pr/changelog/index.spec.ts +++ b/lib/workers/repository/update/pr/changelog/index.spec.ts @@ -2,6 +2,8 @@ import * as httpMock from '../../../../../../test/http-mock'; import { partial } from '../../../../../../test/util'; import { GlobalConfig } from '../../../../../config/global'; import { PlatformId } from '../../../../../constants'; +import { CacheableGithubReleases } from '../../../../../modules/datasource/github-releases/cache'; +import { CacheableGithubTags } from '../../../../../modules/datasource/github-tags/cache'; import * as semverVersioning from '../../../../../modules/versioning/semver'; import * as hostRules from '../../../../../util/host-rules'; import type { BranchConfig } from '../../../../types'; @@ -34,7 +36,17 @@ const upgrade: BranchConfig = partial({ describe('workers/repository/update/pr/changelog/index', () => { describe('getChangeLogJSON', () => { + const githubReleasesMock = jest.spyOn( + CacheableGithubReleases.prototype, + 'getItems' + ); + const githubTagsMock = jest.spyOn( + CacheableGithubTags.prototype, + 'getItems' + ); + beforeEach(() => { + jest.resetAllMocks(); hostRules.clear(); hostRules.add({ hostType: PlatformId.Github, @@ -81,15 +93,12 @@ describe('workers/repository/update/pr/changelog/index', () => { }); it('works without Github', async () => { + githubTagsMock.mockRejectedValueOnce(new Error('Unknown')); + githubReleasesMock.mockRejectedValueOnce(new Error('Unknown')); httpMock .scope(githubApiHost) .get('/repos/chalk/chalk') .times(4) - .reply(500) - .get('/repos/chalk/chalk/tags?per_page=100') - .reply(500) - .get('/repos/chalk/chalk/releases?per_page=100') - .times(4) .reply(500); expect( await getChangeLogJSON({ @@ -116,20 +125,16 @@ describe('workers/repository/update/pr/changelog/index', () => { }); it('uses GitHub tags', async () => { - httpMock - .scope(githubApiHost) - .get('/repos/chalk/chalk/tags?per_page=100') - .reply(200, [ - { name: '0.9.0' }, - { name: '1.0.0' }, - { name: '1.4.0' }, - { name: 'v2.3.0' }, - { name: '2.2.2' }, - { name: 'v2.4.2' }, - ]) - .persist() - .get(/.*/) - .reply(200, []); + httpMock.scope(githubApiHost).get(/.*/).reply(200, []).persist(); + githubTagsMock.mockResolvedValue([ + { version: '0.9.0' }, + { version: '1.0.0' }, + { version: '1.4.0' }, + { version: 'v2.3.0' }, + { version: '2.2.2' }, + { version: 'v2.4.2' }, + ] as never); + githubReleasesMock.mockResolvedValue([]); expect( await getChangeLogJSON({ ...upgrade, @@ -155,11 +160,11 @@ describe('workers/repository/update/pr/changelog/index', () => { }); it('filters unnecessary warns', async () => { - httpMock - .scope(githubApiHost) - .persist() - .get(/.*/) - .replyWithError('Unknown Github Repo'); + githubTagsMock.mockRejectedValueOnce(new Error('Unknown Github Repo')); + githubReleasesMock.mockRejectedValueOnce( + new Error('Unknown Github Repo') + ); + httpMock.scope(githubApiHost).get(/.*/).reply(200, []).persist(); const res = await getChangeLogJSON({ ...upgrade, depName: '@renovate/no', @@ -185,6 +190,8 @@ describe('workers/repository/update/pr/changelog/index', () => { }); it('supports node engines', async () => { + githubTagsMock.mockRejectedValueOnce([]); + githubReleasesMock.mockRejectedValueOnce([]); expect( await getChangeLogJSON({ ...upgrade, @@ -259,6 +266,8 @@ describe('workers/repository/update/pr/changelog/index', () => { }); it('supports github enterprise and github.com changelog', async () => { + githubTagsMock.mockRejectedValueOnce([]); + githubReleasesMock.mockRejectedValueOnce([]); httpMock.scope(githubApiHost).persist().get(/.*/).reply(200, []); hostRules.add({ hostType: PlatformId.Github, @@ -291,6 +300,8 @@ describe('workers/repository/update/pr/changelog/index', () => { }); it('supports github enterprise and github enterprise changelog', async () => { + githubTagsMock.mockRejectedValueOnce([]); + githubReleasesMock.mockRejectedValueOnce([]); httpMock .scope('https://github-enterprise.example.com') .persist() @@ -329,6 +340,8 @@ describe('workers/repository/update/pr/changelog/index', () => { }); it('supports github.com and github enterprise changelog', async () => { + githubTagsMock.mockRejectedValueOnce([]); + githubReleasesMock.mockRejectedValueOnce([]); httpMock .scope('https://github-enterprise.example.com') .persist() diff --git a/lib/workers/repository/update/pr/changelog/release-notes.spec.ts b/lib/workers/repository/update/pr/changelog/release-notes.spec.ts index 04c99e669e325a..aa94a95e66515e 100644 --- a/lib/workers/repository/update/pr/changelog/release-notes.spec.ts +++ b/lib/workers/repository/update/pr/changelog/release-notes.spec.ts @@ -1,6 +1,7 @@ import { DateTime } from 'luxon'; import * as httpMock from '../../../../../../test/http-mock'; import { loadFixture, mocked } from '../../../../../../test/util'; +import { CacheableGithubReleases } from '../../../../../modules/datasource/github-releases/cache'; import { clone } from '../../../../../util/clone'; import * as _hostRules from '../../../../../util/host-rules'; import { toBase64 } from '../../../../../util/string'; @@ -56,6 +57,11 @@ const gitlabProject = { } as ChangeLogProject; describe('workers/repository/update/pr/changelog/release-notes', () => { + const githubReleasesMock = jest.spyOn( + CacheableGithubReleases.prototype, + 'getItems' + ); + beforeEach(() => { hostRules.find.mockReturnValue({}); hostRules.hosts.mockReturnValue([]); @@ -161,16 +167,14 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { }); it('should return release list for github repo', async () => { - httpMock - .scope('https://api.github.com/') - .get('/repos/some/yet-other-repository/releases?per_page=100') - .reply(200, [ - { tag_name: `v1.0.0` }, - { - tag_name: `v1.0.1`, - body: 'some body #123, [#124](https://github.com/some/yet-other-repository/issues/124)', - }, - ]); + githubReleasesMock.mockResolvedValueOnce([ + { version: `v1.0.0` }, + { + version: `v1.0.1`, + description: + 'some body #123, [#124](https://github.com/some/yet-other-repository/issues/124)', + }, + ] as never); const res = await getReleaseList({ ...githubProject, @@ -263,10 +267,10 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { describe('getReleaseNotes()', () => { it('should return null for release notes without body', async () => { - httpMock - .scope('https://api.github.com/') - .get('/repos/some/repository/releases?per_page=100') - .reply(200, [{ tag_name: 'v1.0.0' }, { tag_name: 'v1.0.1' }]); + githubReleasesMock.mockResolvedValueOnce([ + { version: 'v1.0.0' }, + { version: 'v1.0.1' }, + ] as never); const res = await getReleaseNotes( { ...githubProject, @@ -279,17 +283,14 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { }); it('gets release notes with body ""', async () => { - const prefix = ''; - httpMock - .scope('https://api.github.com/') - .get('/repos/some/other-repository/releases?per_page=100') - .reply(200, [ - { tag_name: `${prefix}1.0.0` }, - { - tag_name: `${prefix}1.0.1`, - body: 'some body #123, [#124](https://github.com/some/yet-other-repository/issues/124)', - }, - ]); + githubReleasesMock.mockResolvedValueOnce([ + { version: '1.0.0' }, + { + version: '1.0.1', + description: + 'some body #123, [#124](https://github.com/some/yet-other-repository/issues/124)', + }, + ] as never); const res = await getReleaseNotes( { ...githubProject, @@ -310,17 +311,14 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { }); it('gets release notes with body "v"', async () => { - const prefix = 'v'; - httpMock - .scope('https://api.github.com/') - .get('/repos/some/other-repository/releases?per_page=100') - .reply(200, [ - { tag_name: `${prefix}1.0.0` }, - { - tag_name: `${prefix}1.0.1`, - body: 'some body #123, [#124](https://github.com/some/yet-other-repository/issues/124)', - }, - ]); + githubReleasesMock.mockResolvedValueOnce([ + { version: 'v1.0.0' }, + { + version: 'v1.0.1', + description: + 'some body #123, [#124](https://github.com/some/yet-other-repository/issues/124)', + }, + ] as never); const res = await getReleaseNotes( { ...githubProject, @@ -341,17 +339,15 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { }); it('gets release notes with body "other-"', async () => { - const prefix = 'other-'; - httpMock - .scope('https://api.github.com/') - .get('/repos/some/other-repository/releases?per_page=100') - .reply(200, [ - { tag_name: `${prefix}1.0.0` }, - { - tag_name: `${prefix}1.0.1`, - body: 'some body #123, [#124](https://github.com/some/yet-other-repository/issues/124)', - }, - ]); + githubReleasesMock.mockResolvedValueOnce([ + { version: 'other-1.0.0' }, + { + version: 'other-1.0.1', + description: + 'some body #123, [#124](https://github.com/some/yet-other-repository/issues/124)', + }, + ] as never); + const res = await getReleaseNotes( { ...githubProject, @@ -372,17 +368,15 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { }); it('gets release notes with body "other_v"', async () => { - const prefix = 'other_v'; - httpMock - .scope('https://api.github.com/') - .get('/repos/some/other-repository/releases?per_page=100') - .reply(200, [ - { tag_name: `${prefix}1.0.0` }, - { - tag_name: `${prefix}1.0.1`, - body: 'some body #123, [#124](https://github.com/some/yet-other-repository/issues/124)', - }, - ]); + githubReleasesMock.mockResolvedValueOnce([ + { version: 'other_v1.0.0' }, + { + version: 'other_v1.0.1', + description: + 'some body #123, [#124](https://github.com/some/yet-other-repository/issues/124)', + }, + ] as never); + const res = await getReleaseNotes( { ...githubProject, @@ -403,17 +397,14 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { }); it('gets release notes with body "other@"', async () => { - const prefix = 'other@'; - httpMock - .scope('https://api.github.com/') - .get('/repos/some/other-repository/releases?per_page=100') - .reply(200, [ - { tag_name: `${prefix}1.0.0` }, - { - tag_name: `${prefix}1.0.1`, - body: 'some body #123, [#124](https://github.com/some/yet-other-repository/issues/124)', - }, - ]); + githubReleasesMock.mockResolvedValueOnce([ + { version: 'other@1.0.0' }, + { + version: 'other@1.0.1', + description: + 'some body #123, [#124](https://github.com/some/yet-other-repository/issues/124)', + }, + ] as never); const res = await getReleaseNotes( { ...githubProject, @@ -547,20 +538,17 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { it('handles same version but different repo releases', async () => { const depName = 'correctTagPrefix/exampleDep'; - httpMock - .scope('https://api.github.com/') - .get('/repos/some/other-repository/releases?per_page=100') - .reply(200, [ - { - tag_name: `${depName}@1.0.0`, - html_url: 'correct/url/tag.com', - body: 'some body', - }, - { tag_name: `someOtherRelease1/exampleDep_1.0.0` }, - { - tag_name: `someOtherRelease2/exampleDep-1.0.0`, - }, - ]); + githubReleasesMock.mockResolvedValueOnce([ + { + version: `${depName}@1.0.0`, + url: 'correct/url/tag.com', + description: 'some body', + }, + { version: `someOtherRelease1/exampleDep_1.0.0` }, + { + version: `someOtherRelease2/exampleDep-1.0.0`, + }, + ] as never); const res = await getReleaseNotes( { ...githubProject, From 0b6b43ab80dc808f87f9411759453729e3c56302 Mon Sep 17 00:00:00 2001 From: Maron <98313426+MaronHatoum@users.noreply.github.com> Date: Fri, 3 Jun 2022 13:32:40 +0300 Subject: [PATCH 015/240] fix(lookup): avoid unstable versions when rolling back (#15821) --- .../repository/process/lookup/index.spec.ts | 22 +++++++++++++++++++ .../repository/process/lookup/rollback.ts | 11 +++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/lib/workers/repository/process/lookup/index.spec.ts b/lib/workers/repository/process/lookup/index.spec.ts index 090143ceb9f06e..daf628f17e4b41 100644 --- a/lib/workers/repository/process/lookup/index.spec.ts +++ b/lib/workers/repository/process/lookup/index.spec.ts @@ -1698,5 +1698,27 @@ describe('workers/repository/process/lookup/index', () => { const res = await lookup.lookupUpdates(config); expect(res).toMatchSnapshot(); }); + + it('rollback for invalid version to last stable version', async () => { + config.currentValue = '2.5.17'; + config.depName = 'vue'; + config.datasource = NpmDatasource.id; + config.rollbackPrs = true; + config.ignoreUnstable = true; + httpMock + .scope('https://registry.npmjs.org') + .get('/vue') + .reply(200, vueJson); + const res = (await lookup.lookupUpdates(config)).updates; + expect(res).toEqual([ + { + bucket: `rollback`, + newMajor: 2, + newValue: `2.5.16`, + newVersion: `2.5.16`, + updateType: `rollback`, + }, + ]); + }); }); }); diff --git a/lib/workers/repository/process/lookup/rollback.ts b/lib/workers/repository/process/lookup/rollback.ts index 7c17a70340b843..57cf13bb141fe9 100644 --- a/lib/workers/repository/process/lookup/rollback.ts +++ b/lib/workers/repository/process/lookup/rollback.ts @@ -38,8 +38,17 @@ export function getRollbackUpdate( { dependency: depName, versions }, 'Versions found before rolling back' ); + lessThanVersions.sort((a, b) => version.sortVersions(a.version, b.version)); - const newVersion = lessThanVersions.pop()?.version; + let newVersion; + if (currentValue && version.isStable(currentValue)) { + newVersion = lessThanVersions + .filter((v) => version.isStable(v.version)) + .pop()?.version; + } + if (!newVersion) { + newVersion = lessThanVersions.pop()?.version; + } // istanbul ignore if if (!newVersion) { logger.debug('No newVersion to roll back to'); From fff0a8141b781d97f294146c6c434258906265eb Mon Sep 17 00:00:00 2001 From: Michele Azzolari Date: Fri, 3 Jun 2022 13:45:23 +0200 Subject: [PATCH 016/240] docs: remove multiple matchStrings note (#15872) --- docs/usage/configuration-options.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index f0e0314b8dfee0..480458356dc7a4 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -2215,7 +2215,6 @@ For template fields, use the triple brace `{{{ }}}` notation to avoid Handlebars ### matchStrings `matchStrings` should each be a valid regular expression, optionally with named capture groups. -Currently only a length of one `matchString` is supported. Example: From cbed78630ae82144cc81610f0974f31078f03cfb Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Fri, 3 Jun 2022 16:35:20 +0300 Subject: [PATCH 017/240] fix(cache): Fix `repositoryCache` support for `reset` value (#15874) --- lib/util/cache/repository/index.spec.ts | 7 +++++++ lib/util/cache/repository/init.ts | 19 +++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/lib/util/cache/repository/index.spec.ts b/lib/util/cache/repository/index.spec.ts index 8a2aeb0add410a..0c85021e8a972f 100644 --- a/lib/util/cache/repository/index.spec.ts +++ b/lib/util/cache/repository/index.spec.ts @@ -33,4 +33,11 @@ describe('util/cache/repository/index', () => { await saveCache(); expect(fs.outputFile).toHaveBeenCalled(); }); + + it('resets cache', async () => { + await initRepoCache({ ...config, repositoryCache: 'reset' }); + expect(fs.readFile).not.toHaveBeenCalled(); + expect(fs.outputFile).toHaveBeenCalled(); + expect(getCache()).toBeEmpty(); + }); }); diff --git a/lib/util/cache/repository/init.ts b/lib/util/cache/repository/init.ts index 77b20ab2c99ae6..dbef05bd91c073 100644 --- a/lib/util/cache/repository/init.ts +++ b/lib/util/cache/repository/init.ts @@ -8,10 +8,25 @@ import { resetCache, setCache } from '.'; */ export async function initRepoCache(config: RenovateConfig): Promise { resetCache(); + const { platform } = GlobalConfig.get(); - if (platform && config.repository && config.repositoryCache === 'enabled') { - const localCache = new LocalRepoCache(platform, config.repository); + const { repository, repositoryCache } = config; + + if (repositoryCache === 'disabled' || !platform || !repository) { + return; + } + + if (repositoryCache === 'enabled') { + const localCache = new LocalRepoCache(platform, repository); await localCache.load(); setCache(localCache); + return; + } + + if (repositoryCache === 'reset') { + const localCache = new LocalRepoCache(platform, repository); + await localCache.save(); + setCache(localCache); + return; } } From a9c2f4762ee5010ddde1f20b8ed723bf2184c2c3 Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Fri, 3 Jun 2022 18:41:54 +0300 Subject: [PATCH 018/240] fix(github): Re-throw datasource cache errors (#15878) --- .../github-releases/cache/cache-base.spec.ts | 12 +- .../github-releases/cache/cache-base.ts | 188 ++++++++---------- 2 files changed, 92 insertions(+), 108 deletions(-) diff --git a/lib/modules/datasource/github-releases/cache/cache-base.spec.ts b/lib/modules/datasource/github-releases/cache/cache-base.spec.ts index c36ffccd4002b3..640fcdcc7f2b78 100644 --- a/lib/modules/datasource/github-releases/cache/cache-base.spec.ts +++ b/lib/modules/datasource/github-releases/cache/cache-base.spec.ts @@ -251,12 +251,10 @@ describe('modules/datasource/github-releases/cache/cache-base', () => { ]; const cache = new TestCache(http, { resetDeltaMinutes: 0 }); - const res = await cache.getItems({ packageName: 'foo/bar' }); - - expect(sortItems(res)).toMatchObject([ - { version: 'v1', bar: 'aaa' }, - { version: 'v2', bar: 'bbb' }, - { version: 'v3', bar: 'ccc' }, - ]); + await expect(cache.getItems({ packageName: 'foo/bar' })).rejects.toThrow( + 'Unknown error' + ); + expect(packageCache.get).toHaveBeenCalled(); + expect(packageCache.set).not.toHaveBeenCalled(); }); }); diff --git a/lib/modules/datasource/github-releases/cache/cache-base.ts b/lib/modules/datasource/github-releases/cache/cache-base.ts index 8e8ee6ae172e7d..3a846a31998ee1 100644 --- a/lib/modules/datasource/github-releases/cache/cache-base.ts +++ b/lib/modules/datasource/github-releases/cache/cache-base.ts @@ -1,5 +1,4 @@ import { DateTime, DurationLikeObject } from 'luxon'; -import { logger } from '../../../../logger'; import * as packageCache from '../../../../util/cache/package'; import type { GithubGraphqlResponse, @@ -177,115 +176,102 @@ export abstract class AbstractGithubDatasourceCache< cacheUpdatedAt = cache.updatedAt; } - try { - if (isExpired(now, cacheUpdatedAt, this.updateDuration)) { - const variables: GithubQueryParams = { - owner, - name, - cursor: null, - count: cacheDoesExist - ? this.itemsPerUpdatePage - : this.itemsPerPrefetchPage, - }; - - // Collect version values to determine deleted items - const checkedVersions = new Set(); - - // Page-by-page update loop - let pagesRemained = cacheDoesExist - ? this.maxUpdatePages - : this.maxPrefetchPages; - let stopIteration = false; - while (pagesRemained > 0 && !stopIteration) { - const graphqlRes = await this.http.postJson< - GithubGraphqlResponse> - >('/graphql', { - baseUrl, - body: { query: this.graphqlQuery, variables }, - }); - pagesRemained -= 1; - - const data = graphqlRes.body.data; - if (data) { - const { - nodes: fetchedItems, - pageInfo: { hasNextPage, endCursor }, - } = data.repository.payload; - - if (hasNextPage) { - variables.cursor = endCursor; - } else { - stopIteration = true; - } + if (isExpired(now, cacheUpdatedAt, this.updateDuration)) { + const variables: GithubQueryParams = { + owner, + name, + cursor: null, + count: cacheDoesExist + ? this.itemsPerUpdatePage + : this.itemsPerPrefetchPage, + }; + + // Collect version values to determine deleted items + const checkedVersions = new Set(); + + // Page-by-page update loop + let pagesRemained = cacheDoesExist + ? this.maxUpdatePages + : this.maxPrefetchPages; + let stopIteration = false; + while (pagesRemained > 0 && !stopIteration) { + const graphqlRes = await this.http.postJson< + GithubGraphqlResponse> + >('/graphql', { + baseUrl, + body: { query: this.graphqlQuery, variables }, + }); + pagesRemained -= 1; + + const data = graphqlRes.body.data; + if (data) { + const { + nodes: fetchedItems, + pageInfo: { hasNextPage, endCursor }, + } = data.repository.payload; + + if (hasNextPage) { + variables.cursor = endCursor; + } else { + stopIteration = true; + } - for (const item of fetchedItems) { - const newStoredItem = this.coerceFetched(item); - if (newStoredItem) { - const { version } = newStoredItem; - - // Stop earlier if the stored item have reached stability, - // which means `unstableDays` period have passed - const oldStoredItem = cacheItems[version]; - if ( - oldStoredItem && - isExpired( - now, - oldStoredItem.releaseTimestamp, - this.stabilityDuration - ) - ) { - stopIteration = true; - break; - } - - cacheItems[version] = newStoredItem; - checkedVersions.add(version); + for (const item of fetchedItems) { + const newStoredItem = this.coerceFetched(item); + if (newStoredItem) { + const { version } = newStoredItem; + + // Stop earlier if the stored item have reached stability, + // which means `unstableDays` period have passed + const oldStoredItem = cacheItems[version]; + if ( + oldStoredItem && + isExpired( + now, + oldStoredItem.releaseTimestamp, + this.stabilityDuration + ) + ) { + stopIteration = true; + break; } - } - } - } - // Detect removed items - for (const [version, item] of Object.entries(cacheItems)) { - if ( - !isExpired(now, item.releaseTimestamp, this.stabilityDuration) && - !checkedVersions.has(version) - ) { - delete cacheItems[version]; + cacheItems[version] = newStoredItem; + checkedVersions.add(version); + } } } + } - // Store cache - const expiry = DateTime.fromISO(cacheCreatedAt).plus( - this.resetDuration - ); - const { minutes: ttlMinutes } = expiry - .diff(now, ['minutes']) - .toObject(); - if (ttlMinutes && ttlMinutes > 0) { - const cacheValue: GithubDatasourceCache = { - items: cacheItems, - createdAt: cacheCreatedAt, - updatedAt: now.toISO(), - }; - await packageCache.set( - this.cacheNs, - cacheKey, - cacheValue, - ttlMinutes - ); + // Detect removed items + for (const [version, item] of Object.entries(cacheItems)) { + if ( + !isExpired(now, item.releaseTimestamp, this.stabilityDuration) && + !checkedVersions.has(version) + ) { + delete cacheItems[version]; } } - } catch (err) { - logger.debug( - { err }, - `GitHub datasource: error fetching cacheable GraphQL data` - ); - // On errors, return previous value (if valid) - if (cacheDoesExist) { - const cachedItems = Object.values(cache.items); - return cachedItems; + // Store cache + const expiry = DateTime.fromISO(cacheCreatedAt).plus( + this.resetDuration + ); + const { minutes: ttlMinutes } = expiry + .diff(now, ['minutes']) + .toObject(); + if (ttlMinutes && ttlMinutes > 0) { + const cacheValue: GithubDatasourceCache = { + items: cacheItems, + createdAt: cacheCreatedAt, + updatedAt: now.toISO(), + }; + await packageCache.set( + this.cacheNs, + cacheKey, + cacheValue, + ttlMinutes + ); } } } From 72f873080d6d8bb09605d752cde786bef5d42c7c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 4 Jun 2022 03:08:37 +0000 Subject: [PATCH 019/240] build(deps): update dependency commander to v9.3.0 (#15882) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index a8784690ed52e6..a63a2f8270cc08 100644 --- a/package.json +++ b/package.json @@ -151,7 +151,7 @@ "chalk": "4.1.2", "changelog-filename-regex": "2.0.1", "clean-git-ref": "2.0.1", - "commander": "9.2.0", + "commander": "9.3.0", "conventional-commits-detector": "1.0.3", "crypto-random-string": "3.3.1", "deepmerge": "4.2.2", diff --git a/yarn.lock b/yarn.lock index 4f0921333806b5..bd0feda43b8d54 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3781,10 +3781,10 @@ combined-stream@^1.0.8: dependencies: delayed-stream "~1.0.0" -commander@9.2.0: - version "9.2.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-9.2.0.tgz#6e21014b2ed90d8b7c9647230d8b7a94a4a419a9" - integrity sha512-e2i4wANQiSXgnrBlIatyHtP1odfUp0BbV5Y5nEGbxtIrStkEOAAzCUirvLBNXHLr7kwLvJl6V+4V3XV9x7Wd9w== +commander@9.3.0: + version "9.3.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-9.3.0.tgz#f619114a5a2d2054e0d9ff1b31d5ccf89255e26b" + integrity sha512-hv95iU5uXPbK83mjrJKuZyFM/LBAoCV/XhVGkS5Je6tl7sxr6A0ITMw5WoRV46/UaJ46Nllm3Xt7IaJhXTIkzw== commander@^2.19.0: version "2.20.3" From 2ec52306142f50e9cd7c7d25a6147873bc78c5dc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 4 Jun 2022 04:38:55 +0000 Subject: [PATCH 020/240] chore(deps): update dependency memfs to v3.4.4 (#15883) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index a63a2f8270cc08..d4852b00c55ae0 100644 --- a/package.json +++ b/package.json @@ -285,7 +285,7 @@ "jest-mock-extended": "2.0.6", "jest-silent-reporter": "0.5.0", "markdownlint-cli2": "0.4.0", - "memfs": "3.4.3", + "memfs": "3.4.4", "mock-fs": "5.1.2", "mockdate": "3.0.5", "nock": "13.2.4", diff --git a/yarn.lock b/yarn.lock index bd0feda43b8d54..6bd9d2c282b2aa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7079,10 +7079,10 @@ mdurl@^1.0.1: resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" integrity sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4= -memfs@3.4.3: - version "3.4.3" - resolved "https://registry.yarnpkg.com/memfs/-/memfs-3.4.3.tgz#fc08ac32363b6ea6c95381cabb4d67838180d4e1" - integrity sha512-eivjfi7Ahr6eQTn44nvTnR60e4a1Fs1Via2kCR5lHo/kyNoiMWaXCNJ/GpSd0ilXas2JSOl9B5FTIhflXu0hlg== +memfs@3.4.4: + version "3.4.4" + resolved "https://registry.yarnpkg.com/memfs/-/memfs-3.4.4.tgz#e8973cd8060548916adcca58a248e7805c715e89" + integrity sha512-W4gHNUE++1oSJVn8Y68jPXi+mkx3fXR5ITE/Ubz6EQ3xRpCN5k2CQ4AUR8094Z7211F876TyoBACGsIveqgiGA== dependencies: fs-monkey "1.0.3" From 3e51b5713a16baaa7850dcfd0232e86d55b68adb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 4 Jun 2022 04:50:41 +0000 Subject: [PATCH 021/240] chore(deps): update dependency eslint-plugin-jest to v26.3.0 (#15884) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index d4852b00c55ae0..b9a9ef4697d837 100644 --- a/package.json +++ b/package.json @@ -270,7 +270,7 @@ "eslint-formatter-gha": "1.4.1", "eslint-import-resolver-typescript": "2.7.1", "eslint-plugin-import": "2.26.0", - "eslint-plugin-jest": "26.2.2", + "eslint-plugin-jest": "26.3.0", "eslint-plugin-jest-formatting": "3.1.0", "eslint-plugin-promise": "6.0.0", "eslint-plugin-typescript-enum": "2.1.0", diff --git a/yarn.lock b/yarn.lock index 6bd9d2c282b2aa..6d69e6067680fd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4545,10 +4545,10 @@ eslint-plugin-jest-formatting@3.1.0: resolved "https://registry.yarnpkg.com/eslint-plugin-jest-formatting/-/eslint-plugin-jest-formatting-3.1.0.tgz#b26dd5a40f432b642dcc880021a771bb1c93dcd2" integrity sha512-XyysraZ1JSgGbLSDxjj5HzKKh0glgWf+7CkqxbTqb7zEhW7X2WHo5SBQ8cGhnszKN+2Lj3/oevBlHNbHezoc/A== -eslint-plugin-jest@26.2.2: - version "26.2.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-26.2.2.tgz#74e000544259f1ef0462a609a3fc9e5da3768f6c" - integrity sha512-etSFZ8VIFX470aA6kTqDPhIq7YWe0tjBcboFNV3WeiC18PJ/AVonGhuTwlmuz2fBkH8FJHA7JQ4k7GsQIj1Gew== +eslint-plugin-jest@26.3.0: + version "26.3.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-26.3.0.tgz#541598dafe78580737046a270734a413415b0fa9" + integrity sha512-Nst+lIIzCwVap2zxzEv+c0+ESvubEu96SyYuByYMpSQhtKF31DqQQ5PTprT2zbBvSLBAhgDXYWo69p4n+Bc/Ew== dependencies: "@typescript-eslint/utils" "^5.10.0" From dd84b9c7f38811724fe806b555fa6e3426cd254e Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Sat, 4 Jun 2022 07:04:33 +0200 Subject: [PATCH 022/240] fix(redis): valid integer for ttl --- lib/util/cache/package/redis.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/util/cache/package/redis.ts b/lib/util/cache/package/redis.ts index 3cbfaa09b61d14..17659c05b14fe9 100644 --- a/lib/util/cache/package/redis.ts +++ b/lib/util/cache/package/redis.ts @@ -1,4 +1,5 @@ /* istanbul ignore file */ +import is from '@sindresorhus/is'; import { DateTime } from 'luxon'; import { createClient } from 'redis'; import { logger } from '../../../logger'; @@ -54,14 +55,22 @@ export async function set( value: unknown, ttlMinutes = 5 ): Promise { - logger.trace({ namespace, key, ttlMinutes }, 'Saving cached value'); + let minutes = ttlMinutes; + if (!is.integer(minutes)) { + if (is.number(minutes)) { + minutes = Math.floor(minutes); + } else { + minutes = 5; + } + } + logger.trace({ namespace, key, minutes }, 'Saving cached value'); await client?.set( getKey(namespace, key), JSON.stringify({ value, - expiry: DateTime.local().plus({ minutes: ttlMinutes }), + expiry: DateTime.local().plus({ minutes }), }), - { EX: ttlMinutes * 60 } + { EX: minutes * 60 } ); } From c32b74bdeed92062c7ba48980798cfb6d753ba24 Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Sat, 4 Jun 2022 08:47:36 +0300 Subject: [PATCH 023/240] fix(redis): Fix TTL minutes type (#15886) --- lib/util/cache/package/redis.ts | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/lib/util/cache/package/redis.ts b/lib/util/cache/package/redis.ts index 17659c05b14fe9..02b6cbbfe58b87 100644 --- a/lib/util/cache/package/redis.ts +++ b/lib/util/cache/package/redis.ts @@ -1,5 +1,4 @@ /* istanbul ignore file */ -import is from '@sindresorhus/is'; import { DateTime } from 'luxon'; import { createClient } from 'redis'; import { logger } from '../../../logger'; @@ -55,22 +54,18 @@ export async function set( value: unknown, ttlMinutes = 5 ): Promise { - let minutes = ttlMinutes; - if (!is.integer(minutes)) { - if (is.number(minutes)) { - minutes = Math.floor(minutes); - } else { - minutes = 5; - } - } - logger.trace({ namespace, key, minutes }, 'Saving cached value'); + logger.trace({ namespace, key, ttlMinutes }, 'Saving cached value'); + + // Redis requires TTL to be integer, not float + const redisTTL = Math.floor(ttlMinutes * 60); + await client?.set( getKey(namespace, key), JSON.stringify({ value, - expiry: DateTime.local().plus({ minutes }), + expiry: DateTime.local().plus({ minutes: ttlMinutes }), }), - { EX: minutes * 60 } + { EX: redisTTL } ); } From c6e8fd19c86ae3fd9be9c1818e14c37bb882ff91 Mon Sep 17 00:00:00 2001 From: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Date: Sat, 4 Jun 2022 09:43:16 +0200 Subject: [PATCH 024/240] docs(nuget): rewrite (#15846) --- docs/usage/nuget.md | 46 ++++++++++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 15 deletions(-) diff --git a/docs/usage/nuget.md b/docs/usage/nuget.md index 8b55d8a75b301d..9ed2174b32f3df 100644 --- a/docs/usage/nuget.md +++ b/docs/usage/nuget.md @@ -5,33 +5,45 @@ description: NuGet (.NET) dependencies support in Renovate # NuGet -Renovate supports upgrading dependencies in `.csproj`, `.fsproj`, and `.vbproj` files. +Renovate can upgrade dependencies in these files: + +- `.csproj` +- `.fsproj` +- `.vbproj` ## Version Support -Only SDK-style `.csproj`/`.fsproj`/`.vbproj` files are currently supported. +Renovate only works with SDK-style `.csproj`, `.fsproj` or `.vbproj` files. By default, this includes: - .NET Core 1.0 and above - .NET Standard class libraries -- Any `.csproj`/`.fsproj`/`.vbproj` in the SDK-style syntax +- `.csproj`, `.fsproj` or `.vbproj` files that use the SDK-style syntax -To convert your .NET Framework `.csproj`/`.fsproj`/`.vbproj` into an SDK-style project, follow the steps in this [guide](https://natemcmaster.com/blog/2017/03/09/vs2015-to-vs2017-upgrade/). +To convert your .NET Framework `.csproj`, `.fsproj` or `.vbproj` files into an SDK-style project, follow the steps in this [guide](https://natemcmaster.com/blog/2017/03/09/vs2015-to-vs2017-upgrade/). ## How it works 1. Renovate searches in each repository for any files with a `.csproj`, `.fsproj`, or `.vbproj` extension 1. Existing dependencies are extracted from `` and `` tags -1. Renovate looks up the latest version on [nuget.org](https://nuget.org) (or on [alternate feeds](#Alternate%20feeds)) to determine if any upgrades are available -1. If the source package includes a GitHub URL as its source, and has either a "changelog" file or uses GitHub releases, then release notes for each version are embedded in the generated PR +1. Renovate looks up the latest version on [nuget.org](https://nuget.org) (or on [alternate feeds](#Alternate%20feeds)) to see if any upgrades are available +1. If the source package includes a GitHub URL as its source, and has either: + + - a "changelog" file, or + - uses GitHub releases + + then release notes for each version are embedded in the generated PR If your project file references a `packages.config` file, no dependencies will be extracted. Find out here how to [migrate from `packages.config` to `PackageReference`](https://docs.microsoft.com/en-us/nuget/consume-packages/migrate-packages-config-to-package-reference). ## Alternate feeds -By default Renovate performs all lookups on `https://api.nuget.org/v3/index.json`, but you can configure alternative NuGet feeds. -Alternative feeds can be specified either [in a `NuGet.config` file](https://docs.microsoft.com/en-us/nuget/reference/nuget-config-file#package-source-sections) within your repository (Renovate will not search outside the repository) or in Renovate configuration options: +By default Renovate performs all lookups on `https://api.nuget.org/v3/index.json`, but you can set alternative NuGet feeds. +You can set alternative feeds: + +- in a [`NuGet.config` file](https://docs.microsoft.com/en-us/nuget/reference/nuget-config-file#package-source-sections) within your repository (Renovate will not search outside the repository), or +- in a Renovate configuration options file like `renovate.json` ```json { @@ -45,17 +57,21 @@ Alternative feeds can be specified either [in a `NuGet.config` file](https://doc } ``` -In this example we defined 3 NuGet feeds. -The package resolving process uses the `merge` strategy to handle the 3 feeds. +In the example above we've set three NuGet feeds. +The package resolving process uses the `merge` strategy to handle the three feeds. All feeds are checked for dependency updates, and duplicate updates are merged/joined together into a single dependency update. If your project uses lockfiles (a `package.lock.json` exists), alternate feed settings must be defined in a `NuGet.config` only, as `registryUrls` are not passed through to the NuGet commands used. ### Protocol versions -NuGet supports two protocol versions, `v2` and `v3`, the NuGet client and server must use the same protocol version. -Renovate as a NuGet client supports both versions and will use `v2` unless the configured feed URL ends with `index.json` (which mirrors the behavior of the official NuGet client). -If you have a `v3` feed that does not match this pattern (e.g. JFrog Artifactory) you need to help Renovate by appending `#protocolVersion=3` to the registry URL: +NuGet supports two protocol versions, `v2` and `v3`. +The NuGet client and server must use the same version. + +Renovate as a NuGet client supports both `v2` and `v3` protocols, and will use `v2` unless the configured feed URL ends with `index.json`. +This mirrors the behavior of the official NuGet client. + +If you have a `v3` feed that doesn't end with `index.json`, like for example on the JFrog Artifactory, then you must append `#protocolVersion=3` to the registry URL: ```json { @@ -67,7 +83,7 @@ If you have a `v3` feed that does not match this pattern (e.g. JFrog Artifactory ## Authenticated feeds -Credentials for authenticated/private feeds can be provided via host rules in the configuration options (file or command line parameter). +Credentials for authenticated/private feeds can be given via host rules in the configuration options (file or command line parameter). ```json { @@ -84,7 +100,7 @@ Credentials for authenticated/private feeds can be provided via host rules in th !!! note - At the moment only Basic HTTP authentication (via username and password) is supported. + Only Basic HTTP authentication (via username and password) is supported. ## Future work From a73942ca9dfed6d91c2df31a679d44fbb96be2ca Mon Sep 17 00:00:00 2001 From: Gabriel-Ladzaretti <97394622+Gabriel-Ladzaretti@users.noreply.github.com> Date: Sat, 4 Jun 2022 10:53:24 +0300 Subject: [PATCH 025/240] fix(circleci): add android to machine image skipping (#15792) --- lib/modules/manager/circleci/extract.spec.ts | 19 +++++++++++++++---- lib/modules/manager/circleci/extract.ts | 4 +++- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/lib/modules/manager/circleci/extract.spec.ts b/lib/modules/manager/circleci/extract.spec.ts index 1d0ba0275a7ad9..b6c6fe1b77de5e 100644 --- a/lib/modules/manager/circleci/extract.spec.ts +++ b/lib/modules/manager/circleci/extract.spec.ts @@ -1,9 +1,9 @@ -import { loadFixture } from '../../../../test/util'; +import { Fixtures } from '../../../../test/fixtures'; import { extractPackageFile } from './extract'; -const file1 = loadFixture('config.yml'); -const file2 = loadFixture('config2.yml'); -const file3 = loadFixture('config3.yml'); +const file1 = Fixtures.get('config.yml'); +const file2 = Fixtures.get('config2.yml'); +const file3 = Fixtures.get('config3.yml'); describe('modules/manager/circleci/extract', () => { describe('extractPackageFile()', () => { @@ -53,5 +53,16 @@ describe('modules/manager/circleci/extract', () => { { currentValue: '14.8.0', depName: 'cimg/node' }, ]); }); + + it('extracts and exclude android images', () => { + expect( + extractPackageFile( + 'jobs:\n' + + ' build:\n' + + ' machine:\n' + + ' image: android:202102-01' + ) + ).toBeNull(); + }); }); }); diff --git a/lib/modules/manager/circleci/extract.ts b/lib/modules/manager/circleci/extract.ts index f3e85dd84406a6..6c03b1e69b7860 100644 --- a/lib/modules/manager/circleci/extract.ts +++ b/lib/modules/manager/circleci/extract.ts @@ -63,7 +63,9 @@ export function extractPackageFile(content: string): PackageFile | null { dep.versioning = 'docker'; if ( !dep.depName?.startsWith('ubuntu-') && - !dep.depName?.startsWith('windows-server-') + !dep.depName?.startsWith('windows-server-') && + !dep.depName?.startsWith('android-') && + dep.depName !== 'android' ) { deps.push(dep); } From 7f05729d5dc643fcd4368093802e9a623a92ba09 Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Sat, 4 Jun 2022 11:08:51 +0300 Subject: [PATCH 026/240] feat(github-tags): Leverage long-term cache for digest retrieval (#15888) --- .../datasource/github-tags/index.spec.ts | 78 +++++++------------ lib/modules/datasource/github-tags/index.ts | 37 +++------ lib/modules/datasource/github-tags/types.ts | 11 --- 3 files changed, 38 insertions(+), 88 deletions(-) delete mode 100644 lib/modules/datasource/github-tags/types.ts diff --git a/lib/modules/datasource/github-tags/index.spec.ts b/lib/modules/datasource/github-tags/index.spec.ts index e3315fa0844549..e93874312132a2 100644 --- a/lib/modules/datasource/github-tags/index.spec.ts +++ b/lib/modules/datasource/github-tags/index.spec.ts @@ -33,85 +33,63 @@ describe('modules/datasource/github-tags/index', () => { describe('getDigest', () => { const packageName = 'some/dep'; - const tag = 'v1.2.0'; - it('returns null if no token', async () => { + it('returns commit digest', async () => { httpMock .scope(githubApiHost) .get(`/repos/${packageName}/commits?per_page=1`) - .reply(200, []); + .reply(200, [{ sha: 'abcdef' }]); + const res = await github.getDigest({ packageName }, null); - expect(res).toBeNull(); + + expect(res).toBe('abcdef'); }); - it('returns digest', async () => { + it('returns null for missing commit', async () => { httpMock .scope(githubApiHost) .get(`/repos/${packageName}/commits?per_page=1`) - .reply(200, [{ sha: 'abcdef' }]); + .reply(200, []); + const res = await github.getDigest({ packageName }, null); - expect(res).toBe('abcdef'); - }); - it('returns commit digest', async () => { - httpMock - .scope(githubApiHost) - .get(`/repos/${packageName}/git/refs/tags/${tag}`) - .reply(200, { object: { type: 'commit', sha: 'ddd111' } }); - const res = await github.getDigest({ packageName }, tag); - expect(res).toBe('ddd111'); + expect(res).toBeNull(); }); - it('returns tagged commit digest', async () => { - httpMock - .scope(githubApiHost) - .get(`/repos/${packageName}/git/refs/tags/${tag}`) - .reply(200, { - object: { type: 'tag', url: `${githubApiHost}/some-url` }, - }) - .get('/some-url') - .reply(200, { object: { type: 'commit', sha: 'ddd111' } }); - const res = await github.getDigest({ packageName }, tag); - expect(res).toBe('ddd111'); - }); + it('returns tag digest', async () => { + tagsCacheGetItems.mockResolvedValueOnce([ + { version: 'v1.0.0', releaseTimestamp: '2021-01-01', hash: 'aaa' }, + { version: 'v2.0.0', releaseTimestamp: '2022-01-01', hash: 'bbb' }, + ]); - it('warns if unknown ref', async () => { - httpMock - .scope(githubApiHost) - .get(`/repos/${packageName}/git/refs/tags/${tag}`) - .reply(200, { object: { sha: 'ddd111' } }); - const res = await github.getDigest({ packageName }, tag); - expect(res).toBeNull(); + const res = await github.getDigest({ packageName }, 'v2.0.0'); + + expect(res).toBe('bbb'); }); - it('returns null for missed tagged digest', async () => { - httpMock - .scope(githubApiHost) - .get(`/repos/${packageName}/git/refs/tags/${tag}`) - .reply(200, {}); - const res = await github.getDigest({ packageName: 'some/dep' }, 'v1.2.0'); + it('returns null for missing tag', async () => { + tagsCacheGetItems.mockResolvedValueOnce([ + { version: 'v1.0.0', releaseTimestamp: '2021-01-01', hash: 'aaa' }, + { version: 'v2.0.0', releaseTimestamp: '2022-01-01', hash: 'bbb' }, + ]); + + const res = await github.getDigest({ packageName }, 'v3.0.0'); + expect(res).toBeNull(); }); - it('supports ghe', async () => { + it('supports GHE', async () => { httpMock .scope(githubEnterpriseApiHost) - .get(`/api/v3/repos/${packageName}/git/refs/tags/${tag}`) - .reply(200, { object: { type: 'commit', sha: 'ddd111' } }) .get(`/api/v3/repos/${packageName}/commits?per_page=1`) .reply(200, [{ sha: 'abcdef' }]); - const sha1 = await github.getDigest( + const res = await github.getDigest( { packageName, registryUrl: githubEnterpriseApiHost }, null ); - const sha2 = await github.getDigest( - { packageName: 'some/dep', registryUrl: githubEnterpriseApiHost }, - 'v1.2.0' - ); - expect(sha1).toBe('abcdef'); - expect(sha2).toBe('ddd111'); + expect(res).toBe('abcdef'); }); }); diff --git a/lib/modules/datasource/github-tags/index.ts b/lib/modules/datasource/github-tags/index.ts index 03a3bb573c35ab..dafdad72bbf9b0 100644 --- a/lib/modules/datasource/github-tags/index.ts +++ b/lib/modules/datasource/github-tags/index.ts @@ -9,7 +9,6 @@ import type { ReleaseResult, } from '../types'; import { CacheableGithubTags } from './cache'; -import type { TagResponse } from './types'; export class GithubTagsDatasource extends GithubReleasesDatasource { static override readonly id = 'github-tags'; @@ -21,37 +20,21 @@ export class GithubTagsDatasource extends GithubReleasesDatasource { this.tagsCache = new CacheableGithubTags(this.http); } - @cache({ - ttlMinutes: 120, - namespace: `datasource-${GithubTagsDatasource.id}`, - key: (registryUrl: string, githubRepo: string, tag: string) => - `${registryUrl}:${githubRepo}:tag-${tag}`, - }) async getTagCommit( registryUrl: string | undefined, - githubRepo: string, + packageName: string, tag: string ): Promise { - const apiBaseUrl = getApiBaseUrl(registryUrl); - let digest: string | null = null; - try { - const url = `${apiBaseUrl}repos/${githubRepo}/git/refs/tags/${tag}`; - const res = (await this.http.getJson(url)).body.object; - if (res.type === 'commit') { - digest = res.sha; - } else if (res.type === 'tag') { - digest = (await this.http.getJson(res.url)).body.object - .sha; - } else { - logger.warn({ res }, 'Unknown git tag refs type'); - } - } catch (err) { - logger.debug( - { githubRepo, err }, - 'Error getting tag commit from GitHub repo' - ); + let result: string | null = null; + const tagReleases = await this.tagsCache.getItems({ + packageName, + registryUrl, + }); + const tagRelease = tagReleases.find(({ version }) => version === tag); + if (tagRelease) { + result = tagRelease.hash; } - return digest; + return result; } @cache({ diff --git a/lib/modules/datasource/github-tags/types.ts b/lib/modules/datasource/github-tags/types.ts deleted file mode 100644 index e8b5888166c0b2..00000000000000 --- a/lib/modules/datasource/github-tags/types.ts +++ /dev/null @@ -1,11 +0,0 @@ -export interface TagResponse { - object: { - type: string; - url: string; - sha: string; - }; -} - -export interface GitHubTag { - name: string; -} From dbad9e5848026902d75210cd61eec88f6fedb194 Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Sat, 4 Jun 2022 13:26:11 +0300 Subject: [PATCH 027/240] fix(github-releases): Return `gitRef` field (#15890) --- lib/modules/datasource/github-releases/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/modules/datasource/github-releases/index.ts b/lib/modules/datasource/github-releases/index.ts index c28d774e083114..d96654e1529b14 100644 --- a/lib/modules/datasource/github-releases/index.ts +++ b/lib/modules/datasource/github-releases/index.ts @@ -245,7 +245,11 @@ export class GithubReleasesDatasource extends Datasource { sourceUrl: getSourceUrl(config.packageName, config.registryUrl), releases: releases.map((item) => { const { version, releaseTimestamp, isStable } = item; - const result: Release = { version, releaseTimestamp }; + const result: Release = { + version, + gitRef: version, + releaseTimestamp, + }; if (isStable !== undefined) { result.isStable = isStable; } From e4d5a0e2fd57daf7c4d27a54358fb2d3d940ee73 Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Sat, 4 Jun 2022 14:02:31 +0300 Subject: [PATCH 028/240] fix(github): Throw on GraphQL errors during cache fetching (#15891) --- .../github-releases/cache/cache-base.spec.ts | 24 ++++++++++++++++++- .../github-releases/cache/cache-base.ts | 8 ++++++- lib/util/http/github.ts | 1 - 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/lib/modules/datasource/github-releases/cache/cache-base.spec.ts b/lib/modules/datasource/github-releases/cache/cache-base.spec.ts index 640fcdcc7f2b78..b36e1ce61a544a 100644 --- a/lib/modules/datasource/github-releases/cache/cache-base.spec.ts +++ b/lib/modules/datasource/github-releases/cache/cache-base.spec.ts @@ -234,7 +234,7 @@ describe('modules/datasource/github-releases/cache/cache-base', () => { ]); }); - it('returns cached values on server errors', async () => { + it('throws for http errors', async () => { packageCache.get.mockResolvedValueOnce({ items: { v1: { version: 'v1', releaseTimestamp: t1, bar: 'aaa' }, @@ -257,4 +257,26 @@ describe('modules/datasource/github-releases/cache/cache-base', () => { expect(packageCache.get).toHaveBeenCalled(); expect(packageCache.set).not.toHaveBeenCalled(); }); + + it('throws for graphql errors', async () => { + packageCache.get.mockResolvedValueOnce({ + items: {}, + createdAt: t3, + updatedAt: t3, + }); + responses = [ + { + statusCode: 200, + headers: {}, + body: { errors: [{ message: 'Ooops' }] }, + }, + ]; + const cache = new TestCache(http, { resetDeltaMinutes: 0 }); + + await expect(cache.getItems({ packageName: 'foo/bar' })).rejects.toThrow( + 'Ooops' + ); + expect(packageCache.get).toHaveBeenCalled(); + expect(packageCache.set).not.toHaveBeenCalled(); + }); }); diff --git a/lib/modules/datasource/github-releases/cache/cache-base.ts b/lib/modules/datasource/github-releases/cache/cache-base.ts index 3a846a31998ee1..4ed5742ae27363 100644 --- a/lib/modules/datasource/github-releases/cache/cache-base.ts +++ b/lib/modules/datasource/github-releases/cache/cache-base.ts @@ -203,7 +203,13 @@ export abstract class AbstractGithubDatasourceCache< }); pagesRemained -= 1; - const data = graphqlRes.body.data; + const { data, errors } = graphqlRes.body; + + const errorMessage = errors?.[0]?.message; + if (errorMessage) { + throw Error(errorMessage); + } + if (data) { const { nodes: fetchedItems, diff --git a/lib/util/http/github.ts b/lib/util/http/github.ts index e4b43912763106..dfb697e9d4c439 100644 --- a/lib/util/http/github.ts +++ b/lib/util/http/github.ts @@ -50,7 +50,6 @@ export interface GithubGraphqlResponse { errors?: { type?: string; message: string; - locations: unknown; }[]; } From 4b6fc85146b6563f2da1633518c8c9c54afc2601 Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Sat, 4 Jun 2022 20:54:39 +0300 Subject: [PATCH 029/240] fix(github): Never return null results for `getReleases` (#15894) --- .../datasource/github-releases/index.ts | 36 +++++++++---------- lib/modules/datasource/github-tags/index.ts | 11 ++---- 2 files changed, 19 insertions(+), 28 deletions(-) diff --git a/lib/modules/datasource/github-releases/index.ts b/lib/modules/datasource/github-releases/index.ts index d96654e1529b14..8ed5f66920daab 100644 --- a/lib/modules/datasource/github-releases/index.ts +++ b/lib/modules/datasource/github-releases/index.ts @@ -237,26 +237,22 @@ export class GithubReleasesDatasource extends Datasource { * - Sanitize the versions if desired (e.g. strip out leading 'v') * - Return a dependency object containing sourceUrl string and releases array */ - async getReleases(config: GetReleasesConfig): Promise { - let result: ReleaseResult | null = null; + async getReleases(config: GetReleasesConfig): Promise { const releases = await this.releasesCache.getItems(config); - if (releases.length) { - result = { - sourceUrl: getSourceUrl(config.packageName, config.registryUrl), - releases: releases.map((item) => { - const { version, releaseTimestamp, isStable } = item; - const result: Release = { - version, - gitRef: version, - releaseTimestamp, - }; - if (isStable !== undefined) { - result.isStable = isStable; - } - return result; - }), - }; - } - return result; + return { + sourceUrl: getSourceUrl(config.packageName, config.registryUrl), + releases: releases.map((item) => { + const { version, releaseTimestamp, isStable } = item; + const result: Release = { + version, + gitRef: version, + releaseTimestamp, + }; + if (isStable !== undefined) { + result.isStable = isStable; + } + return result; + }), + }; } } diff --git a/lib/modules/datasource/github-tags/index.ts b/lib/modules/datasource/github-tags/index.ts index dafdad72bbf9b0..6b0ccdff0879dc 100644 --- a/lib/modules/datasource/github-tags/index.ts +++ b/lib/modules/datasource/github-tags/index.ts @@ -82,14 +82,9 @@ export class GithubTagsDatasource extends GithubReleasesDatasource { override async getReleases( config: GetReleasesConfig - ): Promise { + ): Promise { const tagReleases = await this.tagsCache.getItems(config); - // istanbul ignore if - if (!tagReleases.length) { - return null; - } - const tagsResult: ReleaseResult = { sourceUrl: getSourceUrl(config.packageName, config.registryUrl), releases: tagReleases.map((item) => ({ ...item, gitRef: item.version })), @@ -113,8 +108,8 @@ export class GithubTagsDatasource extends GithubReleasesDatasource { }); tagsResult.releases = mergedReleases; - } catch (e) { - // no-op + } catch (err) /* istanbul ignore next */ { + logger.debug({ err }, `Error fetching additional info for GitHub tags`); } return tagsResult; From a9a81275bf1fa40a4ba986601ab9fefd13fc9d41 Mon Sep 17 00:00:00 2001 From: RahulGautamSingh Date: Sun, 5 Jun 2022 20:50:48 +0530 Subject: [PATCH 030/240] refactor: runtime-config-narrowing (#15897) * refactor/runtime-config-narrowing * remove test * apply fixes * reorder tests --- lib/config/types.ts | 2 ++ .../repository/extract/manager-files.ts | 19 ++++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/lib/config/types.ts b/lib/config/types.ts index e49d86f2d5be65..ae24a89b6c310e 100644 --- a/lib/config/types.ts +++ b/lib/config/types.ts @@ -228,6 +228,8 @@ export interface RenovateConfig fetchReleaseNotes?: boolean; secrets?: Record; + aliases?: Record; + skipInstalls?: boolean; } export interface AllConfig extends RenovateConfig, GlobalOnlyConfig {} diff --git a/lib/workers/repository/extract/manager-files.ts b/lib/workers/repository/extract/manager-files.ts index 79a16b4543a348..5da2054742bfad 100644 --- a/lib/workers/repository/extract/manager-files.ts +++ b/lib/workers/repository/extract/manager-files.ts @@ -6,13 +6,26 @@ import { extractPackageFile, get, } from '../../../modules/manager'; -import type { PackageFile } from '../../../modules/manager/types'; +import type { + ExtractConfig, + PackageFile, +} from '../../../modules/manager/types'; import { readLocalFile } from '../../../util/fs'; +function getExtractConfig(config: WorkerExtractConfig): ExtractConfig { + return { + npmrc: config.npmrc, + aliases: config.aliases, + skipInstalls: config.skipInstalls, + npmrcMerge: config.npmrcMerge, + }; +} + export async function getManagerPackageFiles( config: WorkerExtractConfig ): Promise { const { enabled, manager, fileList } = config; + const extractConfig = getExtractConfig(config); logger.trace(`getPackageFiles(${manager})`); if (!enabled) { logger.debug(`${manager} is disabled`); @@ -32,7 +45,7 @@ export async function getManagerPackageFiles( if (get(manager, 'extractAllPackageFiles')) { const allPackageFiles = await extractAllPackageFiles( manager, - config, + extractConfig, fileList ); if (allPackageFiles) { @@ -54,7 +67,7 @@ export async function getManagerPackageFiles( manager, content, packageFile, - config + extractConfig ); if (res) { for (let index = 0; index < res.deps.length; index += 1) { From 47c187abf12298f994bff0d93014f2d3360683e0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 6 Jun 2022 02:46:42 +0000 Subject: [PATCH 031/240] docs: update references to renovate/renovate to v32.74.3 (#15904) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- docs/usage/docker.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/docker.md b/docs/usage/docker.md index c6b0c10e916911..344e1f9168c018 100644 --- a/docs/usage/docker.md +++ b/docs/usage/docker.md @@ -268,7 +268,7 @@ To get access to the token a custom Renovate Docker image is needed that include The Dockerfile to create such an image can look like this: ```Dockerfile -FROM renovate/renovate:32.64.2 +FROM renovate/renovate:32.74.3 # Include the "Docker tip" which you can find here https://cloud.google.com/sdk/docs/install # under "Installation" for "Debian/Ubuntu" RUN ... From 2bfc667e420e43818cff0893521dd88a0e471a6e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 6 Jun 2022 03:00:14 +0000 Subject: [PATCH 032/240] chore(deps): lock file maintenance (#15905) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 587 +++++++++++++++++++++++++++--------------------------- 1 file changed, 298 insertions(+), 289 deletions(-) diff --git a/yarn.lock b/yarn.lock index 6d69e6067680fd..2fd7f511acc7c8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1029,51 +1029,49 @@ integrity sha512-GZt/TCsG70Ms19gfZO1tM4CVnXsPgEPBCpJu+Qz3L0LUDsY5nZqFZglIoPC1kIYOtNBZlrnFT+klg12vFGZXrw== "@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.7.2", "@babel/core@^7.8.0": - version "7.18.0" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.18.0.tgz#c58d04d7c6fbfb58ea7681e2b9145cfb62726756" - integrity sha512-Xyw74OlJwDijToNi0+6BBI5mLLR5+5R3bcSH80LXzjzEGEUlvNzujEE71BaD/ApEZHAvFI/Mlmp4M5lIkdeeWw== + version "7.18.2" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.18.2.tgz#87b2fcd7cce9becaa7f5acebdc4f09f3dd19d876" + integrity sha512-A8pri1YJiC5UnkdrWcmfZTJTV85b4UXTAfImGmCfYmax4TR9Cw8sDS0MOk++Gp2mE/BefVJ5nwy5yzqNJbP/DQ== dependencies: "@ampproject/remapping" "^2.1.0" "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.18.0" - "@babel/helper-compilation-targets" "^7.17.10" + "@babel/generator" "^7.18.2" + "@babel/helper-compilation-targets" "^7.18.2" "@babel/helper-module-transforms" "^7.18.0" - "@babel/helpers" "^7.18.0" + "@babel/helpers" "^7.18.2" "@babel/parser" "^7.18.0" "@babel/template" "^7.16.7" - "@babel/traverse" "^7.18.0" - "@babel/types" "^7.18.0" + "@babel/traverse" "^7.18.2" + "@babel/types" "^7.18.2" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.1" semver "^6.3.0" -"@babel/generator@^7.18.0", "@babel/generator@^7.7.2": - version "7.18.0" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.18.0.tgz#46d28e8a18fc737b028efb25ab105d74473af43f" - integrity sha512-81YO9gGx6voPXlvYdZBliFXAZU8vZ9AZ6z+CjlmcnaeOcYSFbMTpdeDUO9xD9dh/68Vq03I8ZspfUTPfitcDHg== +"@babel/generator@^7.18.2", "@babel/generator@^7.7.2": + version "7.18.2" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.18.2.tgz#33873d6f89b21efe2da63fe554460f3df1c5880d" + integrity sha512-W1lG5vUwFvfMd8HVXqdfbuG7RuaSrTCCD8cl8fP8wOivdbtbIg2Db3IWUcgvfxKbbn6ZBGYRW/Zk1MIwK49mgw== dependencies: - "@babel/types" "^7.18.0" + "@babel/types" "^7.18.2" "@jridgewell/gen-mapping" "^0.3.0" jsesc "^2.5.1" -"@babel/helper-compilation-targets@^7.17.10": - version "7.17.10" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.17.10.tgz#09c63106d47af93cf31803db6bc49fef354e2ebe" - integrity sha512-gh3RxjWbauw/dFiU/7whjd0qN9K6nPJMqe6+Er7rOavFh0CQUSwhAE3IcTho2rywPJFxej6TUUHDkWcYI6gGqQ== +"@babel/helper-compilation-targets@^7.18.2": + version "7.18.2" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.18.2.tgz#67a85a10cbd5fc7f1457fec2e7f45441dc6c754b" + integrity sha512-s1jnPotJS9uQnzFtiZVBUxe67CuBa679oWFHpxYYnTpRL/1ffhyX44R9uYiXoa/pLXcY9H2moJta0iaanlk/rQ== dependencies: "@babel/compat-data" "^7.17.10" "@babel/helper-validator-option" "^7.16.7" browserslist "^4.20.2" semver "^6.3.0" -"@babel/helper-environment-visitor@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz#ff484094a839bde9d89cd63cba017d7aae80ecd7" - integrity sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag== - dependencies: - "@babel/types" "^7.16.7" +"@babel/helper-environment-visitor@^7.16.7", "@babel/helper-environment-visitor@^7.18.2": + version "7.18.2" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.2.tgz#8a6d2dedb53f6bf248e31b4baf38739ee4a637bd" + integrity sha512-14GQKWkX9oJzPiQQ7/J36FTXcD4kSp8egKjO9nINlSKiHITRA9q/R74qu8S9xlc/b/yjsJItQUeeh3xnGN0voQ== "@babel/helper-function-name@^7.17.9": version "7.17.9" @@ -1117,11 +1115,11 @@ integrity sha512-JDkf04mqtN3y4iAbO1hv9U2ARpPyPL1zqyWs/2WG1pgSq9llHFjStX5jdxb84himgJm+8Ng+x0oiWF/nw/XQKA== "@babel/helper-simple-access@^7.17.7": - version "7.17.7" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.17.7.tgz#aaa473de92b7987c6dfa7ce9a7d9674724823367" - integrity sha512-txyMCGroZ96i+Pxr3Je3lzEJjqwaRC9buMUgtomcrLe5Nd0+fk1h0LLA+ixUF5OW7AhHuQ7Es1WcQJZmZsz2XA== + version "7.18.2" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.18.2.tgz#4dc473c2169ac3a1c9f4a51cfcd091d1c36fcff9" + integrity sha512-7LIrjYzndorDY88MycupkpQLKS1AFfsVRm2k/9PtKScSy5tZq0McZTj+DiMRynboZfIqOKvo03pmhTaUgiD6fQ== dependencies: - "@babel/types" "^7.17.0" + "@babel/types" "^7.18.2" "@babel/helper-split-export-declaration@^7.16.7": version "7.16.7" @@ -1140,14 +1138,14 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz#b203ce62ce5fe153899b617c08957de860de4d23" integrity sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ== -"@babel/helpers@^7.18.0": - version "7.18.0" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.18.0.tgz#aff37c3590de42102b54842446146d0205946370" - integrity sha512-AE+HMYhmlMIbho9nbvicHyxFwhrO+xhKB6AhRxzl8w46Yj0VXTZjEsAoBVC7rB2I0jzX+yWyVybnO08qkfx6kg== +"@babel/helpers@^7.18.2": + version "7.18.2" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.18.2.tgz#970d74f0deadc3f5a938bfa250738eb4ac889384" + integrity sha512-j+d+u5xT5utcQSzrh9p+PaJX94h++KN+ng9b9WEJq7pkUPAd61FGqhjuUEdfknb3E/uDBb7ruwEeKkIxNJPIrg== dependencies: "@babel/template" "^7.16.7" - "@babel/traverse" "^7.18.0" - "@babel/types" "^7.18.0" + "@babel/traverse" "^7.18.2" + "@babel/types" "^7.18.2" "@babel/highlight@^7.16.7": version "7.17.12" @@ -1159,9 +1157,9 @@ js-tokens "^4.0.0" "@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.7", "@babel/parser@^7.18.0": - version "7.18.0" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.18.0.tgz#10a8d4e656bc01128d299a787aa006ce1a91e112" - integrity sha512-AqDccGC+m5O/iUStSJy3DGRIUFu7WbY/CppZYwrEUB4N0tZlnI8CSTsgL7v5fHVFmUbRv2sd+yy27o8Ydt4MGg== + version "7.18.4" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.18.4.tgz#6774231779dd700e0af29f6ad8d479582d7ce5ef" + integrity sha512-FDge0dFazETFcxGw/EXzOkN8uJp0PC7Qbm+Pe9T+av2zlBpOgunFHkQPPn+eRuClU73JF+98D531UgayY89tow== "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -1263,26 +1261,26 @@ "@babel/parser" "^7.16.7" "@babel/types" "^7.16.7" -"@babel/traverse@^7.18.0", "@babel/traverse@^7.7.2": - version "7.18.0" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.18.0.tgz#0e5ec6db098660b2372dd63d096bf484e32d27ba" - integrity sha512-oNOO4vaoIQoGjDQ84LgtF/IAlxlyqL4TUuoQ7xLkQETFaHkY1F7yazhB4Kt3VcZGL0ZF/jhrEpnXqUb0M7V3sw== +"@babel/traverse@^7.18.0", "@babel/traverse@^7.18.2", "@babel/traverse@^7.7.2": + version "7.18.2" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.18.2.tgz#b77a52604b5cc836a9e1e08dca01cba67a12d2e8" + integrity sha512-9eNwoeovJ6KH9zcCNnENY7DMFwTU9JdGCFtqNLfUAqtUHRCOsTOqWoffosP8vKmNYeSBUv3yVJXjfd8ucwOjUA== dependencies: "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.18.0" - "@babel/helper-environment-visitor" "^7.16.7" + "@babel/generator" "^7.18.2" + "@babel/helper-environment-visitor" "^7.18.2" "@babel/helper-function-name" "^7.17.9" "@babel/helper-hoist-variables" "^7.16.7" "@babel/helper-split-export-declaration" "^7.16.7" "@babel/parser" "^7.18.0" - "@babel/types" "^7.18.0" + "@babel/types" "^7.18.2" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.16.7", "@babel/types@^7.17.0", "@babel/types@^7.18.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3": - version "7.18.0" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.18.0.tgz#ef523ea349722849cb4bf806e9342ede4d071553" - integrity sha512-vhAmLPAiC8j9K2GnsnLPCIH5wCrPpYIVBCWRBFDCB7Y/BXLqi/O+1RSTTM2bsmg6U/551+FCf9PNPxjABmxHTw== +"@babel/types@^7.0.0", "@babel/types@^7.16.7", "@babel/types@^7.17.0", "@babel/types@^7.18.0", "@babel/types@^7.18.2", "@babel/types@^7.3.0", "@babel/types@^7.3.3": + version "7.18.4" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.18.4.tgz#27eae9b9fd18e9dccc3f9d6ad051336f307be354" + integrity sha512-ThN1mBcMq5pG/Vm2IcBmPPfyPXbd8S02rS+OBIDENdufvqC7Z/jHPCv9IcP01277aKtDI8g/2XysBN4hA8niiw== dependencies: "@babel/helper-validator-identifier" "^7.16.7" to-fast-properties "^2.0.0" @@ -1675,9 +1673,9 @@ fastq "^1.6.0" "@npmcli/arborist@^5.0.0", "@npmcli/arborist@^5.0.4": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@npmcli/arborist/-/arborist-5.2.0.tgz#ee40dfe1f81ae1524819ee39c8f3e7022b0d6269" - integrity sha512-zWV7scFGL0SmpvfQyIWnMFbU/0YgtMNyvJiJwR98kyjUSntJGWFFR0O600d5W+TrDcTg0GyDbY+HdzGEg+GXLg== + version "5.2.1" + resolved "https://registry.yarnpkg.com/@npmcli/arborist/-/arborist-5.2.1.tgz#4f38187cb694946f551a825df17e6efd565b8946" + integrity sha512-DNyTHov3lU7PtCGHABzrPqQOUiBdiYzZ5dLv3D0RD5I9KbmhTLcZI/rv3ddZY0K9vpDE/R+R48b+cU/dUkL0Tw== dependencies: "@isaacs/string-locale-compare" "^1.1.0" "@npmcli/installed-package-contents" "^1.0.7" @@ -1840,13 +1838,13 @@ infer-owner "^1.0.4" "@npmcli/run-script@^3.0.0", "@npmcli/run-script@^3.0.1": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@npmcli/run-script/-/run-script-3.0.2.tgz#3e9116d831f4539bf292d18b015977a6118997ee" - integrity sha512-vdjD/PMBl+OX9j9C9irx5sCCIKfp2PWkpPNH9zxvlJAfSZ3Qp5aU412v+O3PFJl3R1PFNwuyChCqHg4ma6ci2Q== + version "3.0.3" + resolved "https://registry.yarnpkg.com/@npmcli/run-script/-/run-script-3.0.3.tgz#66afa6e0c4c3484056195f295fa6c1d1a45ddf58" + integrity sha512-ZXL6qgC5NjwfZJ2nET+ZSLEz/PJgJ/5CU90C2S66dZY4Jw73DasS4ZCXuy/KHWYP0imjJ4VtA+Gebb5BxxKp9Q== dependencies: "@npmcli/node-gyp" "^2.0.0" "@npmcli/promise-spawn" "^3.0.0" - node-gyp "^9.0.0" + node-gyp "^8.4.1" read-package-json-fast "^2.0.3" "@octokit/auth-token@^2.4.4": @@ -2596,9 +2594,9 @@ "@types/node" "*" "@types/node@*": - version "17.0.35" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.35.tgz#635b7586086d51fb40de0a2ec9d1014a5283ba4a" - integrity sha512-vu1SrqBjbbZ3J6vwY17jBs8Sr/BKA+/a/WtjRG+whKg1iuLFOosq872EXS0eXWILdO36DHQQeku/ZcL6hz2fpg== + version "17.0.40" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.40.tgz#76ee88ae03650de8064a6cf75b8d95f9f4a16090" + integrity sha512-UXdBxNGqTMtm7hCwh9HtncFVLrXoqA3oJW30j6XWp5BH/wu3mVeaxo7cq5benFdBw34HB3XDT2TRPI7rXZ+mDg== "@types/node@16.11.36": version "16.11.36" @@ -2626,9 +2624,9 @@ integrity sha512-KbqcQLdRaawDOfXnwqr6nvhe1MV+Uv/Ww+ViSx7Ujgw9X5qCgObLP52B1ZSJqZD8FK1y/4o+bJQTUrZOynegcg== "@types/prettier@^2.1.5": - version "2.6.1" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.6.1.tgz#76e72d8a775eef7ce649c63c8acae1a0824bbaed" - integrity sha512-XFjFHmaLVifrAKaZ+EKghFHtHSUonyw8P2Qmy2/+osBnrKbH9UYtlK10zg8/kCt47MFilll/DEDKy3DHfJ0URw== + version "2.6.3" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.6.3.tgz#68ada76827b0010d0db071f739314fa429943d0a" + integrity sha512-ymZk3LEC/fsut+/Q5qejp6R9O1rMxz3XaRHDV6kX8MrGAhOSPqVARbDi+EZvInBpw+BnCX3TD240byVkOfQsHg== "@types/responselike@*", "@types/responselike@^1.0.0": version "1.0.0" @@ -2749,11 +2747,11 @@ tsutils "^3.21.0" "@typescript-eslint/experimental-utils@^5.3.0": - version "5.25.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.25.0.tgz#950ab2ab402852a8a2c02b4b254b06d411a6ba9e" - integrity sha512-YTe9rmslCh1xAvNa3X+uZe4L2lsyb8V3WIeK9z46nNiPswk/V/0SGLJSfo8W9Hj4R7ak7bolazXGn3DErmb8QA== + version "5.27.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.27.0.tgz#dfe4c6087f60be8950e32fa83f4a8f2fccd86e47" + integrity sha512-ZOn342bYh19IYvkiorrqnzNoRAr91h3GiFSSfa4tlHV+R9GgR8SxCwAi8PKMyT8+pfwMxfQdNbwKsMurbF9hzg== dependencies: - "@typescript-eslint/utils" "5.25.0" + "@typescript-eslint/utils" "5.27.0" "@typescript-eslint/parser@5.26.0": version "5.26.0" @@ -2765,14 +2763,6 @@ "@typescript-eslint/typescript-estree" "5.26.0" debug "^4.3.4" -"@typescript-eslint/scope-manager@5.25.0": - version "5.25.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.25.0.tgz#e78f1484bca7e484c48782075219c82c6b77a09f" - integrity sha512-p4SKTFWj+2VpreUZ5xMQsBMDdQ9XdRvODKXN4EksyBjFp2YvQdLkyHqOffakYZPuWJUDNu3jVXtHALDyTv3cww== - dependencies: - "@typescript-eslint/types" "5.25.0" - "@typescript-eslint/visitor-keys" "5.25.0" - "@typescript-eslint/scope-manager@5.26.0": version "5.26.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.26.0.tgz#44209c7f649d1a120f0717e0e82da856e9871339" @@ -2781,6 +2771,14 @@ "@typescript-eslint/types" "5.26.0" "@typescript-eslint/visitor-keys" "5.26.0" +"@typescript-eslint/scope-manager@5.27.0": + version "5.27.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.27.0.tgz#a272178f613050ed62f51f69aae1e19e870a8bbb" + integrity sha512-VnykheBQ/sHd1Vt0LJ1JLrMH1GzHO+SzX6VTXuStISIsvRiurue/eRkTqSrG0CexHQgKG8shyJfR4o5VYioB9g== + dependencies: + "@typescript-eslint/types" "5.27.0" + "@typescript-eslint/visitor-keys" "5.27.0" + "@typescript-eslint/type-utils@5.26.0": version "5.26.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.26.0.tgz#937dee97702361744a3815c58991acf078230013" @@ -2790,28 +2788,15 @@ debug "^4.3.4" tsutils "^3.21.0" -"@typescript-eslint/types@5.25.0": - version "5.25.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.25.0.tgz#dee51b1855788b24a2eceeae54e4adb89b088dd8" - integrity sha512-7fWqfxr0KNHj75PFqlGX24gWjdV/FDBABXL5dyvBOWHpACGyveok8Uj4ipPX/1fGU63fBkzSIycEje4XsOxUFA== - "@typescript-eslint/types@5.26.0": version "5.26.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.26.0.tgz#cb204bb154d3c103d9cc4d225f311b08219469f3" integrity sha512-8794JZFE1RN4XaExLWLI2oSXsVImNkl79PzTOOWt9h0UHROwJedNOD2IJyfL0NbddFllcktGIO2aOu10avQQyA== -"@typescript-eslint/typescript-estree@5.25.0": - version "5.25.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.25.0.tgz#a7ab40d32eb944e3fb5b4e3646e81b1bcdd63e00" - integrity sha512-MrPODKDych/oWs/71LCnuO7NyR681HuBly2uLnX3r5i4ME7q/yBqC4hW33kmxtuauLTM0OuBOhhkFaxCCOjEEw== - dependencies: - "@typescript-eslint/types" "5.25.0" - "@typescript-eslint/visitor-keys" "5.25.0" - debug "^4.3.4" - globby "^11.1.0" - is-glob "^4.0.3" - semver "^7.3.7" - tsutils "^3.21.0" +"@typescript-eslint/types@5.27.0": + version "5.27.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.27.0.tgz#c3f44b9dda6177a9554f94a74745ca495ba9c001" + integrity sha512-lY6C7oGm9a/GWhmUDOs3xAVRz4ty/XKlQ2fOLr8GAIryGn0+UBOoJDWyHer3UgrHkenorwvBnphhP+zPmzmw0A== "@typescript-eslint/typescript-estree@5.26.0": version "5.26.0" @@ -2826,17 +2811,18 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.25.0", "@typescript-eslint/utils@^5.10.0": - version "5.25.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.25.0.tgz#272751fd737733294b4ab95e16c7f2d4a75c2049" - integrity sha512-qNC9bhnz/n9Kba3yI6HQgQdBLuxDoMgdjzdhSInZh6NaDnFpTUlwNGxplUFWfY260Ya0TRPvkg9dd57qxrJI9g== +"@typescript-eslint/typescript-estree@5.27.0": + version "5.27.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.27.0.tgz#7965f5b553c634c5354a47dcce0b40b94611e995" + integrity sha512-QywPMFvgZ+MHSLRofLI7BDL+UczFFHyj0vF5ibeChDAJgdTV8k4xgEwF0geFhVlPc1p8r70eYewzpo6ps+9LJQ== dependencies: - "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.25.0" - "@typescript-eslint/types" "5.25.0" - "@typescript-eslint/typescript-estree" "5.25.0" - eslint-scope "^5.1.1" - eslint-utils "^3.0.0" + "@typescript-eslint/types" "5.27.0" + "@typescript-eslint/visitor-keys" "5.27.0" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + semver "^7.3.7" + tsutils "^3.21.0" "@typescript-eslint/utils@5.26.0": version "5.26.0" @@ -2850,13 +2836,17 @@ eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/visitor-keys@5.25.0": - version "5.25.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.25.0.tgz#33aa5fdcc5cedb9f4c8828c6a019d58548d4474b" - integrity sha512-yd26vFgMsC4h2dgX4+LR+GeicSKIfUvZREFLf3DDjZPtqgLx5AJZr6TetMNwFP9hcKreTTeztQYBTNbNoOycwA== +"@typescript-eslint/utils@5.27.0", "@typescript-eslint/utils@^5.10.0": + version "5.27.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.27.0.tgz#d0021cbf686467a6a9499bd0589e19665f9f7e71" + integrity sha512-nZvCrkIJppym7cIbP3pOwIkAefXOmfGPnCM0LQfzNaKxJHI6VjI8NC662uoiPlaf5f6ymkTy9C3NQXev2mdXmA== dependencies: - "@typescript-eslint/types" "5.25.0" - eslint-visitor-keys "^3.3.0" + "@types/json-schema" "^7.0.9" + "@typescript-eslint/scope-manager" "5.27.0" + "@typescript-eslint/types" "5.27.0" + "@typescript-eslint/typescript-estree" "5.27.0" + eslint-scope "^5.1.1" + eslint-utils "^3.0.0" "@typescript-eslint/visitor-keys@5.26.0": version "5.26.0" @@ -2866,6 +2856,14 @@ "@typescript-eslint/types" "5.26.0" eslint-visitor-keys "^3.3.0" +"@typescript-eslint/visitor-keys@5.27.0": + version "5.27.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.27.0.tgz#97aa9a5d2f3df8215e6d3b77f9d214a24db269bd" + integrity sha512-46cYrteA2MrIAjv9ai44OQDUoCZyHeGIc4lsjCUX2WT6r4C+kidz1bNiR4017wHOPUythYeH+Sc7/cFP97KEAA== + dependencies: + "@typescript-eslint/types" "5.27.0" + eslint-visitor-keys "^3.3.0" + "@yarnpkg/core@3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@yarnpkg/core/-/core-3.1.0.tgz#6bfc9b906df0d128e4627efe9c2d830c30610d48" @@ -3446,7 +3444,7 @@ bunyan@1.8.15: mv "~2" safe-json-stringify "~1" -cacache@16.1.0, cacache@^16.0.0, cacache@^16.0.6, cacache@^16.0.7, cacache@^16.1.0: +cacache@16.1.0: version "16.1.0" resolved "https://registry.yarnpkg.com/cacache/-/cacache-16.1.0.tgz#87a6bae558a511c9cb2a13768073e240ca76153a" integrity sha512-Pk4aQkwCW82A4jGKFvcGkQFqZcMspfP9YWq9Pr87/ldDvlWf718zeI6KWCdKt/jeihu6BytHRUicJPB1K2k8EQ== @@ -3494,6 +3492,30 @@ cacache@^15.2.0: tar "^6.0.2" unique-filename "^1.1.1" +cacache@^16.0.0, cacache@^16.0.6, cacache@^16.1.0: + version "16.1.1" + resolved "https://registry.yarnpkg.com/cacache/-/cacache-16.1.1.tgz#4e79fb91d3efffe0630d5ad32db55cc1b870669c" + integrity sha512-VDKN+LHyCQXaaYZ7rA/qtkURU+/yYhviUdvqEv2LT6QPZU8jpyzEkEVAcKlKLt5dJ5BRp11ym8lo3NKLluEPLg== + dependencies: + "@npmcli/fs" "^2.1.0" + "@npmcli/move-file" "^2.0.0" + chownr "^2.0.0" + fs-minipass "^2.1.0" + glob "^8.0.1" + infer-owner "^1.0.4" + lru-cache "^7.7.1" + minipass "^3.1.6" + minipass-collect "^1.0.2" + minipass-flush "^1.0.5" + minipass-pipeline "^1.2.4" + mkdirp "^1.0.4" + p-map "^4.0.0" + promise-inflight "^1.0.1" + rimraf "^3.0.2" + ssri "^9.0.0" + tar "^6.1.11" + unique-filename "^1.1.1" + cacheable-lookup@^5.0.3: version "5.0.4" resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz#5a6b865b2c44357be3d5ebc2a467b032719a7005" @@ -3550,9 +3572,9 @@ camelcase@^6.2.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001332: - version "1.0.30001342" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001342.tgz#87152b1e3b950d1fbf0093e23f00b6c8e8f1da96" - integrity sha512-bn6sOCu7L7jcbBbyNhLg0qzXdJ/PMbybZTH/BA6Roet9wxYRm6Tr9D0s0uhLkOZ6MSG+QU6txUgdpr3MXIVqjA== + version "1.0.30001346" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001346.tgz#e895551b46b9cc9cc9de852facd42f04839a8fbe" + integrity sha512-q6ibZUO2t88QCIPayP/euuDREq+aMAxFE5S70PkrLh0iTDj/zEhgvJRKC2+CvXY6EWc6oQwUR48lL5vCW6jiXQ== cardinal@^2.1.1: version "2.1.1" @@ -3706,14 +3728,14 @@ cliui@^7.0.2: clone-response@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" - integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws= + integrity sha512-yjLXh88P599UOyPTFX0POsd7WxnbsVsGohcwzHOLspIhhpalPw1BcqED8NblyZLKcGrL8dTgMlcaZxV2jAD41Q== dependencies: mimic-response "^1.0.0" clone@^1.0.2: version "1.0.4" resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" - integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4= + integrity sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg== cluster-key-slot@1.1.0: version "1.1.0" @@ -3730,7 +3752,7 @@ cmd-shim@^5.0.0: co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= + integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== collect-v8-coverage@^1.0.0: version "1.0.1" @@ -3754,7 +3776,7 @@ color-convert@^2.0.1: color-name@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== color-name@~1.1.4: version "1.1.4" @@ -3815,12 +3837,12 @@ compress-brotli@^1.3.8: concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== console-control-strings@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" - integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= + integrity sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ== conventional-changelog-angular@^5.0.0: version "5.0.13" @@ -4034,12 +4056,12 @@ debug@^3.2.7: debuglog@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492" - integrity sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI= + integrity sha512-syBZ+rnAK3EgMsH2aYEOLUW7mZSY9Gb+0wUMCFsZvcmiz+HigA0LOcq/HoQqVuGG+EKykunc7QG2bzrponfaSw== decamelize-keys@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/decamelize-keys/-/decamelize-keys-1.1.0.tgz#d171a87933252807eb3cb61dc1c1445d078df2d9" - integrity sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk= + integrity sha512-ocLWuYzRPoS9bfiSdDd3cxvrzovVMZnRDVEzAs+hWIVXGDbHxWMECij2OBuyB/An0FFW/nLuq6Kv1i/YC5Qfzg== dependencies: decamelize "^1.1.0" map-obj "^1.0.0" @@ -4047,7 +4069,7 @@ decamelize-keys@^1.1.0: decamelize@^1.1.0, decamelize@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= + integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== decimal.js@^10.2.1: version "10.3.1" @@ -4057,7 +4079,7 @@ decimal.js@^10.2.1: decode-uri-component@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= + integrity sha512-hjf+xovcEn31w/EUYdTXQh/8smFL/dzYjohQGEIgjyNavaJfBY2p5F527Bo1VPATxv0VYTUC2bOcXvqFwk78Og== decompress-response@^6.0.0: version "6.0.0" @@ -4069,7 +4091,7 @@ decompress-response@^6.0.0: dedent@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" - integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw= + integrity sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA== deep-extend@^0.6.0: version "0.6.0" @@ -4089,7 +4111,7 @@ deepmerge@4.2.2, deepmerge@^4.2.2: defaults@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" - integrity sha1-xlYFHpgX2f8I7YgUd/P+QBnz730= + integrity sha512-s82itHOnYrN0Ib8r+z7laQz3sdE+4FP3d9Q7VLO7U+KRT+CR0GsWuyHxzdAY82I7cXv0G/twrqomTJLOssO5HA== dependencies: clone "^1.0.2" @@ -4107,9 +4129,9 @@ define-properties@^1.1.3, define-properties@^1.1.4: object-keys "^1.1.1" del@^6.0.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/del/-/del-6.1.0.tgz#aa79a5b0a2a9ecc985c0a075e8ad9a5b23bf949c" - integrity sha512-OpcRktOt7G7HBfyxP0srBH4Djg4824EQORX8E1qvIhIzthNNArxxhrB/Mm7dRMiLi1nvFyUpDhzD2cTtbBhV8A== + version "6.1.1" + resolved "https://registry.yarnpkg.com/del/-/del-6.1.1.tgz#3b70314f1ec0aa325c6b14eb36b95786671edb7a" + integrity sha512-ua8BhapfP0JUJKC/zV9yHHDW/rDoDxP4Zhn3AkA6/xT6gY7jYXJiaeyBZznYVujhZZET+UgcbZiQ7sN3WqcImg== dependencies: globby "^11.0.1" graceful-fs "^4.2.4" @@ -4128,17 +4150,17 @@ delay@5.0.0: delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== delegates@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= + integrity sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ== depd@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= + integrity sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ== deprecation@^2.0.0, deprecation@^2.3.1: version "2.3.1" @@ -4178,7 +4200,7 @@ diff-sequences@^27.5.1: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.5.1.tgz#eaecc0d327fd68c8d9672a1e64ab8dccb2ef5327" integrity sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ== -diff@5.1.0: +diff@5.1.0, diff@^5.0.0: version "5.1.0" resolved "https://registry.yarnpkg.com/diff/-/diff-5.1.0.tgz#bc52d298c5ea8df9194800224445ed43ffc87e40" integrity sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw== @@ -4188,11 +4210,6 @@ diff@^4.0.1: resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== -diff@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" - integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== - dir-glob@^3.0.0, dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -4268,7 +4285,7 @@ dtrace-provider@~0.8: duplexer2@~0.1.0: version "0.1.4" resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1" - integrity sha1-ixLauHjA1p4+eJEFFmKjL8a93ME= + integrity sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA== dependencies: readable-stream "^2.0.2" @@ -4283,9 +4300,9 @@ editorconfig@0.15.3: sigmund "^1.0.1" electron-to-chromium@^1.4.118: - version "1.4.137" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.137.tgz#186180a45617283f1c012284458510cd99d6787f" - integrity sha512-0Rcpald12O11BUogJagX3HsCN3FE83DSqWjgXoHo5a72KUKMSfI39XBgJpgNNxS9fuGzytaFjE06kZkiVFy2qA== + version "1.4.146" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.146.tgz#fd20970c3def2f9e6b32ac13a2e7a6b64e1b0c48" + integrity sha512-4eWebzDLd+hYLm4csbyMU2EbBnqhwl8Oe9eF/7CBDPWcRxFmqzx4izxvHH+lofQxzieg8UbB8ZuzNTxeukzfTg== email-addresses@5.0.0: version "5.0.0" @@ -4339,7 +4356,7 @@ end-of-stream@^1.1.0: end-of-stream@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.1.0.tgz#e9353258baa9108965efc41cb0ef8ade2f3cfb07" - integrity sha1-6TUyWLqpEIll78QcsO+K3i88+wc= + integrity sha512-EoulkdKF/1xa92q25PbjuDcgJ9RDHYU2Rs3SCIvs2/dSQ3BpmxneNHmA/M7fe60M3PrV7nNGTTNbkK62l6vXiQ== dependencies: once "~1.3.0" @@ -4442,7 +4459,7 @@ escalade@^3.1.1: escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== escape-string-regexp@^2.0.0: version "2.0.0" @@ -4719,7 +4736,7 @@ execa@^5.0.0: exit@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" - integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= + integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== expect-more-jest@5.4.0: version "5.4.0" @@ -4797,7 +4814,7 @@ fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0: fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= + integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== fast-safe-stringify@2.1.1: version "2.1.1" @@ -4831,14 +4848,14 @@ fb-watchman@^2.0.0: fd-slicer@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e" - integrity sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4= + integrity sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g== dependencies: pend "~1.2.0" figures@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" - integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= + integrity sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA== dependencies: escape-string-regexp "^1.0.5" @@ -4866,7 +4883,7 @@ fill-range@^7.0.1: filter-obj@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/filter-obj/-/filter-obj-1.1.0.tgz#9b311112bc6c6127a16e016c6c5d7f19e0805c5b" - integrity sha1-mzERErxsYSehbgFsbF1/GeCAXFs= + integrity sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ== find-packages@9.0.2: version "9.0.2" @@ -4889,7 +4906,7 @@ find-up@5.0.0: find-up@^2.0.0, find-up@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" - integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= + integrity sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ== dependencies: locate-path "^2.0.0" @@ -4940,7 +4957,7 @@ form-data@^3.0.0: from2@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/from2/-/from2-2.3.0.tgz#8bfb5502bde4a4d36cfdeea007fcca21d7e382af" - integrity sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8= + integrity sha512-OMcX/4IC/uqEPVgGeyfN22LJk6AZrMkRZHxcHBMBvHScDGgwTm2GT2Wkgtocyd3JfZffjj2kYUDXXII0Fk9W0g== dependencies: inherits "^2.0.1" readable-stream "^2.0.0" @@ -4983,7 +5000,7 @@ fs-monkey@1.0.3: fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== fsevents@^2.3.2: version "2.3.2" @@ -5008,7 +5025,7 @@ function.prototype.name@^1.1.5: functional-red-black-tree@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" - integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= + integrity sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g== functions-have-names@^1.2.2: version "1.2.3" @@ -5081,7 +5098,7 @@ get-symbol-description@^1.0.0: git-log-parser@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/git-log-parser/-/git-log-parser-1.2.0.tgz#2e6a4c1b13fc00028207ba795a7ac31667b9fd4a" - integrity sha1-LmpMGxP8AAKCB7p5WnrDFme5/Uo= + integrity sha512-rnCVNfkTL8tdNryFuaY0fYiBWEBcgF748O6ZI61rslBvr2o7U65c2/6npCRqH40vuAhtgtDiqLTJjBVdrejCzA== dependencies: argv-formatter "~1.0.0" spawn-error-forwarder "~1.0.0" @@ -5119,7 +5136,7 @@ git-url-parse@11.6.0: github-url-from-git@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/github-url-from-git/-/github-url-from-git-1.5.0.tgz#f985fedcc0a9aa579dc88d7aff068d55cc6251a0" - integrity sha1-+YX+3MCpqledyI16/waNVcxiUaA= + integrity sha512-WWOec4aRI7YAykQ9+BHmzjyNlkfJFG8QLXnDTsLz/kZefq7qkzdfo4p6fkYYMIq1aj+gZcQs/1HQhQh3DPPxlQ== glob-parent@^5.1.2: version "5.1.2" @@ -5149,7 +5166,7 @@ glob@8.0.3, glob@^8.0.1: glob@^6.0.1: version "6.0.4" resolved "https://registry.yarnpkg.com/glob/-/glob-6.0.4.tgz#0f08860f6a155127b2fadd4f9ce24b1aab6e4d22" - integrity sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI= + integrity sha512-MKZeRNyYZAVVVG1oZeLaWie1uweH40m9AZwIwxyPbTSX4hHrVYSzLg0Ro5Z5R7XKkIX+Cc6oD1rqeDJnwsB8/A== dependencies: inflight "^1.0.4" inherits "2" @@ -5234,7 +5251,7 @@ good-enough-parser@1.1.7: klona "2.0.5" moo "0.5.1" -got@11.8.5: +got@11.8.5, got@^11.7.0: version "11.8.5" resolved "https://registry.yarnpkg.com/got/-/got-11.8.5.tgz#ce77d045136de56e8f024bebb82ea349bc730046" integrity sha512-o0Je4NvQObAuZPHLFoRSkdG2lTgtcynqymzg2Vupdx6PorhaT5MCbIyXG6d4D94kk8ZG57QeosgdiqfJWhEhlQ== @@ -5251,23 +5268,6 @@ got@11.8.5: p-cancelable "^2.0.0" responselike "^2.0.0" -got@^11.7.0: - version "11.8.3" - resolved "https://registry.yarnpkg.com/got/-/got-11.8.3.tgz#f496c8fdda5d729a90b4905d2b07dbd148170770" - integrity sha512-7gtQ5KiPh1RtGS9/Jbv1ofDpBFuq42gyfEib+ejaRBJuj/3tQFeR5+gw57e4ipaU8c/rCjvX6fkQz2lyDlGAOg== - dependencies: - "@sindresorhus/is" "^4.0.0" - "@szmarczak/http-timer" "^4.0.5" - "@types/cacheable-request" "^6.0.1" - "@types/responselike" "^1.0.0" - cacheable-lookup "^5.0.3" - cacheable-request "^7.0.2" - decompress-response "^6.0.0" - http2-wrapper "^1.0.0-beta.5.2" - lowercase-keys "^2.0.0" - p-cancelable "^2.0.0" - responselike "^2.0.0" - graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.10, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9: version "4.2.10" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" @@ -5313,7 +5313,7 @@ has-bigints@^1.0.1, has-bigints@^1.0.2: has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== has-flag@^4.0.0: version "4.0.0" @@ -5342,7 +5342,7 @@ has-tostringtag@^1.0.0: has-unicode@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" - integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= + integrity sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ== has@^1.0.3: version "1.0.3" @@ -5452,7 +5452,7 @@ human-signals@^2.1.0: humanize-ms@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed" - integrity sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0= + integrity sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ== dependencies: ms "^2.0.0" @@ -5490,7 +5490,7 @@ ignore@5.2.0, ignore@^5.1.4, ignore@^5.1.9, ignore@^5.2.0: immediate@~3.0.5: version "3.0.6" resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" - integrity sha1-nbHb0Pr43m++D13V5Wu2BigN5ps= + integrity sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ== import-fresh@^3.0.0, import-fresh@^3.2.1: version "3.3.0" @@ -5516,7 +5516,7 @@ import-local@^3.0.2: imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= + integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== indent-string@^4.0.0: version "4.0.0" @@ -5531,7 +5531,7 @@ infer-owner@^1.0.4: inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== dependencies: once "^1.3.0" wrappy "1" @@ -5625,7 +5625,7 @@ is-arguments@^1.0.4: is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= + integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== is-bigint@^1.0.1: version "1.0.4" @@ -5688,7 +5688,7 @@ is-decimal@^1.0.0: is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== is-fullwidth-code-point@^3.0.0: version "3.0.0" @@ -5722,7 +5722,7 @@ is-hexadecimal@^1.0.0: is-lambda@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-lambda/-/is-lambda-1.0.1.tgz#3d9877899e6a53efc0160504cde15f82e6f061d5" - integrity sha1-PZh3iZ5qU+/AFgUEzeFfgubwYdU= + integrity sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ== is-negative-zero@^2.0.2: version "2.0.2" @@ -5759,7 +5759,7 @@ is-path-inside@^3.0.2: is-plain-obj@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" - integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= + integrity sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg== is-plain-obj@^2.0.0: version "2.1.0" @@ -5820,7 +5820,7 @@ is-symbol@^1.0.2, is-symbol@^1.0.3: is-text-path@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-text-path/-/is-text-path-1.0.1.tgz#4e1aa0fb51bfbcb3e92688001397202c1775b66e" - integrity sha1-Thqg+1G/vLPpJogAE5cgLBd1tm4= + integrity sha512-xFuJpne9oFz5qDaodwmmG08e3CawH/2ZV8Qqza1Ko7Sk8POWbkRdwIoAWVhqvq0XeUzANEhKo2n0IXUGBm7A/w== dependencies: text-extensions "^1.0.0" @@ -5838,7 +5838,7 @@ is-typed-array@^1.1.3, is-typed-array@^1.1.9: is-typedarray@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" - integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= + integrity sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA== is-weakref@^1.0.2: version "1.0.2" @@ -5860,17 +5860,17 @@ is@^3.2.1: isarray@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" - integrity sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8= + integrity sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ== isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== issue-parser@^6.0.0: version "6.0.0" @@ -6501,7 +6501,7 @@ json-schema@^0.4.0: json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" - integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= + integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== json-stringify-nice@^1.1.4: version "1.1.4" @@ -6516,7 +6516,7 @@ json-stringify-pretty-compact@3.0.0: json-stringify-safe@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= + integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== json5@2.2.1, json5@2.x, json5@^2.1.3, json5@^2.2.1: version "2.2.1" @@ -6542,7 +6542,7 @@ jsonfile@^6.0.1: jsonparse@^1.2.0, jsonparse@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" - integrity sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA= + integrity sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg== just-diff-apply@^5.2.0: version "5.3.1" @@ -6550,9 +6550,9 @@ just-diff-apply@^5.2.0: integrity sha512-dgFenZnMsc1xGNqgdtgnh7DK+Oy352CE3VZLbzcbQpsBs9iI2K3M0IRrdgREZ72eItTjbl0suRyvKRdVQa9GbA== just-diff@^5.0.1: - version "5.0.2" - resolved "https://registry.yarnpkg.com/just-diff/-/just-diff-5.0.2.tgz#68854c94280c37d28cb266d8f29bdd2cd29f003e" - integrity sha512-uGd6F+eIZ4T95EinP8ubINGkbEy3jrgBym+6LjW+ja1UG1WQIcEcQ6FLeyXtVJZglk+bj7fvEn+Cu2LBxkgiYQ== + version "5.0.3" + resolved "https://registry.yarnpkg.com/just-diff/-/just-diff-5.0.3.tgz#4c9c514dec5526b25ab977590e3c39a0cf271554" + integrity sha512-a8p80xcpJ6sdurk5PxDKb4mav9MeKjA3zFKZpCWBIfvg8mznfnmb13MKZvlrwJ+Lhis0wM3uGAzE0ArhFHvIcg== just-extend@^4.0.2: version "4.2.1" @@ -6560,9 +6560,9 @@ just-extend@^4.0.2: integrity sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg== keyv@^4.0.0: - version "4.2.9" - resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.2.9.tgz#b8f25d4968b583ed7f07fceadab646d4baadad6b" - integrity sha512-vqRBrN4xQHud7UMAGzGGFbt96MtGB9pb0OOg8Dhtq5RtiswCb1pCFq878iqC4hdeOP6eDPnCoFxA+2TXx427Ow== + version "4.3.0" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.3.0.tgz#b4352e0e4fe7c94111947d6738a6d3fe7903027c" + integrity sha512-C30Un9+63J0CsR7Wka5quXKqYZsT6dcRQ2aOwGcSc3RiQ4HGWpTAHlCA+puNfw2jA/s11EsxA1nCXgZRuRKMQQ== dependencies: compress-brotli "^1.3.8" json-buffer "3.0.1" @@ -6598,7 +6598,7 @@ levn@^0.4.1: levn@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= + integrity sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA== dependencies: prelude-ls "~1.1.2" type-check "~0.3.2" @@ -6628,9 +6628,9 @@ libnpmdiff@^4.0.2: tar "^6.1.0" libnpmexec@^4.0.2: - version "4.0.5" - resolved "https://registry.yarnpkg.com/libnpmexec/-/libnpmexec-4.0.5.tgz#e488a1f47805b8d9af3c216ff4a5ea9c51111013" - integrity sha512-ykTsaAz0AV5mPr2HqmI6GCtQ5b6/OTJnnuXxZa78fJVMIGqJMfm4lAQZpBNNyH68Fs0oDIGZbnWaB5PfzyzSJg== + version "4.0.6" + resolved "https://registry.yarnpkg.com/libnpmexec/-/libnpmexec-4.0.6.tgz#600beffd6f265cf92a096a7f336f330bc0019e82" + integrity sha512-v1jAPJyFFex6R0YHYXuudR4liQ3tYJ7vVZ6eThOex4+WzQEnoShLVfK3MLyFbjdGNO85wCHcVWVpXaBOVnVa/w== dependencies: "@npmcli/arborist" "^5.0.0" "@npmcli/ci-detect" "^2.0.0" @@ -6669,13 +6669,13 @@ libnpmorg@^4.0.2: npm-registry-fetch "^13.0.0" libnpmpack@^4.0.2: - version "4.0.3" - resolved "https://registry.yarnpkg.com/libnpmpack/-/libnpmpack-4.0.3.tgz#0de60120a2456524b0cdb25bac58f454a1441c2e" - integrity sha512-/H4XXJp5S74palJfVhM5za/4dw8/1DRfU5g+t2taAojjr5+cSKyEoxxnHOnSRWu7zqqMeT8e4jX6Cz8lNUsbAw== + version "4.1.0" + resolved "https://registry.yarnpkg.com/libnpmpack/-/libnpmpack-4.1.0.tgz#93a170b67bc52e15edc7b1f2e09b2c36e532b897" + integrity sha512-BHwojfEbJvVVJXivZjOCe3Y0IzQ47p6c/bfebrpzazuFNRoS9XOsbkncRbl3f23+u9b51eplzwaPh/5xSOAWHg== dependencies: "@npmcli/run-script" "^3.0.0" npm-package-arg "^9.0.1" - pacote "^13.0.5" + pacote "^13.5.0" libnpmpublish@^6.0.2: version "6.0.4" @@ -6717,7 +6717,7 @@ libnpmversion@^3.0.1: lie@3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e" - integrity sha1-mkNrLMd0bKWd56QfpGmz77dr2H4= + integrity sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw== dependencies: immediate "~3.0.5" @@ -6743,7 +6743,7 @@ linkify-it@^4.0.1: load-json-file@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" - integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs= + integrity sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw== dependencies: graceful-fs "^4.1.2" parse-json "^4.0.0" @@ -6760,7 +6760,7 @@ localforage@^1.9.0: locate-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" - integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= + integrity sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA== dependencies: p-locate "^2.0.0" path-exists "^3.0.0" @@ -6782,37 +6782,37 @@ locate-path@^6.0.0: lodash.capitalize@^4.2.1: version "4.2.1" resolved "https://registry.yarnpkg.com/lodash.capitalize/-/lodash.capitalize-4.2.1.tgz#f826c9b4e2a8511d84e3aca29db05e1a4f3b72a9" - integrity sha1-+CbJtOKoUR2E46yinbBeGk87cqk= + integrity sha512-kZzYOKspf8XVX5AvmQF94gQW0lejFVgb80G85bU4ZWzoJ6C03PQg3coYAUpSTpQWelrZELd3XWgHzw4Ck5kaIw== lodash.escaperegexp@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz#64762c48618082518ac3df4ccf5d5886dae20347" - integrity sha1-ZHYsSGGAglGKw99Mz11YhtriA0c= + integrity sha512-TM9YBvyC84ZxE3rgfefxUWiQKLilstD6k7PTGt6wfbtXF8ixIJLOL3VYyV/z+ZiPLsVxAsKAFVwWlWeb2Y8Yyw== lodash.get@^4.4.2: version "4.4.2" resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" - integrity sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk= + integrity sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ== lodash.ismatch@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz#756cb5150ca3ba6f11085a78849645f188f85f37" - integrity sha1-dWy1FQyjum8RCFp4hJZF8Yj4Xzc= + integrity sha512-fPMfXjGQEV9Xsq/8MTSgUf255gawYRbjwMyDbcvDhXgV7enSZA0hynz6vMPnpAb5iONEzBHBPsT+0zes5Z301g== lodash.isplainobject@^4.0.6: version "4.0.6" resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb" - integrity sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs= + integrity sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA== lodash.isstring@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451" - integrity sha1-1SfftUVuynzJu5XV2ur4i6VKVFE= + integrity sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw== lodash.memoize@4.x: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" - integrity sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4= + integrity sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag== lodash.merge@^4.6.2: version "4.6.2" @@ -6822,12 +6822,12 @@ lodash.merge@^4.6.2: lodash.set@^4.3.2: version "4.3.2" resolved "https://registry.yarnpkg.com/lodash.set/-/lodash.set-4.3.2.tgz#d8757b1da807dde24816b0d6a84bea1a76230b23" - integrity sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM= + integrity sha512-4hNPN5jlm/N/HLMCO43v8BXKq9Z7QdAGc/VGrRD61w8gN9g/6jF9A4L1pbUgBLCffi0w9VsXfTOij5x8iTyFvg== lodash.uniqby@^4.7.0: version "4.7.0" resolved "https://registry.yarnpkg.com/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz#d99c07a669e9e6d24e1362dfe266c67616af1302" - integrity sha1-2ZwHpmnp5tJOE2Lf4mbGdhavEwI= + integrity sha512-e/zcLx6CSbmaEgFHCA7BnoQKyCtKMxnuWrJygbwPs/AIn+IMKl66L8/s+wBUn5LRw2pZx3bUHibiV1b6aTWIww== lodash@^4.17.15, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.7.0: version "4.17.21" @@ -6881,10 +6881,10 @@ make-error@1.x, make-error@^1.1.1: resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== -make-fetch-happen@^10.0.3, make-fetch-happen@^10.0.6, make-fetch-happen@^10.1.3: - version "10.1.5" - resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-10.1.5.tgz#d975c0a4373de41ea05236d8182f56333511c268" - integrity sha512-mucOj2H0Jn/ax7H9K9T1bf0p1nn/mBFa551Os7ed9xRfLEx20aZhZeLslmRYfAaAqXZUGipcs+m5KOKvOH0XKA== +make-fetch-happen@^10.0.3, make-fetch-happen@^10.0.6, make-fetch-happen@^10.1.6: + version "10.1.7" + resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-10.1.7.tgz#b1402cb3c9fad92b380ff3a863cdae5414a42f76" + integrity sha512-J/2xa2+7zlIUKqfyXDCXFpH3ypxO4k3rgkZHPSZkyUYcBT/hM80M3oyKLM/9dVriZFiGeGGS2Ei+0v2zfhqj3Q== dependencies: agentkeepalive "^4.2.1" cacache "^16.1.0" @@ -6900,7 +6900,7 @@ make-fetch-happen@^10.0.3, make-fetch-happen@^10.0.6, make-fetch-happen@^10.1.3: minipass-pipeline "^1.2.4" negotiator "^0.6.3" promise-retry "^2.0.1" - socks-proxy-agent "^6.1.1" + socks-proxy-agent "^7.0.0" ssri "^9.0.0" make-fetch-happen@^9.1.0: @@ -6935,7 +6935,7 @@ makeerror@1.0.12: map-obj@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" - integrity sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0= + integrity sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg== map-obj@^4.0.0: version "4.3.0" @@ -7077,7 +7077,7 @@ mdast-util-to-string@^2.0.0: mdurl@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" - integrity sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4= + integrity sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g== memfs@3.4.4: version "3.4.4" @@ -7089,7 +7089,7 @@ memfs@3.4.4: memorystream@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" - integrity sha1-htcJCzDORV1j+64S3aUaR93K+bI= + integrity sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw== meow@^7.0.0: version "7.1.1" @@ -7356,7 +7356,7 @@ mri@^1.1.5: ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== ms@2.1.2: version "2.1.2" @@ -7387,16 +7387,16 @@ mute-stream@~0.0.4: mv@~2: version "2.1.1" resolved "https://registry.yarnpkg.com/mv/-/mv-2.1.1.tgz#ae6ce0d6f6d5e0a4f7d893798d03c1ea9559b6a2" - integrity sha1-rmzg1vbV4KT32JN5jQPB6pVZtqI= + integrity sha512-at/ZndSy3xEGJ8i0ygALh8ru9qy7gWW1cmkaqBN29JmMlIvM//MEO9y1sk/avxuwnPcfhkejkLsuPxH81BrkSg== dependencies: mkdirp "~0.5.1" ncp "~2.0.0" rimraf "~2.4.0" nan@^2.14.0, nan@^2.15.0: - version "2.15.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.15.0.tgz#3f34a473ff18e15c1b5626b62903b5ad6e665fee" - integrity sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ== + version "2.16.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.16.0.tgz#664f43e45460fb98faf00edca0bb0d7b8dce7916" + integrity sha512-UdAqHyFngu7TfQKsCBgAA6pWDkT8MAO7d0jyOecVhN5354xbLqdn8mV9Tat9gepAupm0bt2DbeaSC8vS52MuFA== nanoid@3.3.4: version "3.3.4" @@ -7406,12 +7406,12 @@ nanoid@3.3.4: natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" - integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= + integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== ncp@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ncp/-/ncp-2.0.0.tgz#195a21d6c46e361d2fb1281ba38b91e9df7bdbb3" - integrity sha1-GVoh1sRuNh0vsSgbo4uR6d9727M= + integrity sha512-zIdGUrPRFTUELUvr3Gmc7KZ2Sw/h1PiVM0Af/oHB6zgnV1ikqSfRk+TOufi79aHYCW3NiOXmr1BP5nWbzojLaA== negotiator@^0.6.2, negotiator@^0.6.3: version "0.6.3" @@ -7426,7 +7426,7 @@ neo-async@^2.6.0: nerf-dart@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/nerf-dart/-/nerf-dart-1.0.0.tgz#e6dab7febf5ad816ea81cf5c629c5a0ebde72c1a" - integrity sha1-5tq3/r9a2Bbqgc9cYpxaDr3nLBo= + integrity sha512-EZSPZB70jiVsivaBLYDCyntd5eH8NTSMOn3rB+HxwdmKThGELLdYv8qVIMWvZEFy9w8ZZpW9h9OB32l1rGtj7g== nice-try@^1.0.4: version "1.0.5" @@ -7511,12 +7511,12 @@ node-html-parser@5.3.3: node-int64@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" - integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs= + integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== node-releases@^2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.4.tgz#f38252370c43854dc48aa431c766c6c398f40476" - integrity sha512-gbMzqQtTtDz/00jQzZ21PQzdI9PyLYqUSvD0p3naOhX4odFji0ZxYdnVwPTxmSwkmxhcFImpozceidSG+AgoPQ== + version "2.0.5" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.5.tgz#280ed5bc3eba0d96ce44897d8aee478bfb3d9666" + integrity sha512-U9h1NLROZTq9uE1SNffn6WuPDg8icmi3ns4rEl/oTfIle4iLjTliCzgTsbaIFMq/Xn078/lfY/BL0GWZ+psK4Q== node.extend@^2.0.0: version "2.0.2" @@ -7608,10 +7608,10 @@ npm-package-arg@^9.0.0, npm-package-arg@^9.0.1, npm-package-arg@^9.0.2: semver "^7.3.5" validate-npm-package-name "^4.0.0" -npm-packlist@^5.0.0: - version "5.0.4" - resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-5.0.4.tgz#b8a0635964dbf72baeeb7e69ec32e822f1c26159" - integrity sha512-G4sCWzzHokHC5oxGD46Q9vCe+eN2tFb+3RfADD/eZbx4nKa7Y1eku1xvIWrw5R3F3hWX7IM2BgdqbQsyBUa3IA== +npm-packlist@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-5.1.0.tgz#f3fd52903a021009913a133732022132eb355ce7" + integrity sha512-a04sqF6FbkyOAFA19AA0e94gS7Et5T2/IMj3VOT9nOF2RaRdVPQ1Q17Fb/HaDRFs+gbC7HOmhVZ29adpWgmDZg== dependencies: glob "^8.0.1" ignore-walk "^5.0.1" @@ -7677,9 +7677,9 @@ npm-user-validate@^1.0.1: integrity sha512-uQwcd/tY+h1jnEaze6cdX/LrhWhoBxfSknxentoqmIuStxUExxjWd3ULMLFPiFUrZKbOVMowH6Jq2FRWfmhcEw== npm@^8.3.0: - version "8.10.0" - resolved "https://registry.yarnpkg.com/npm/-/npm-8.10.0.tgz#f689aee00def914701952975249bd1e45ed8b266" - integrity sha512-6oo65q9Quv9mRPGZJufmSH+C/UFdgelwzRXiglT/2mDB50zdy/lZK5dFY0TJ9fJ/8gHqnxcX1NM206KLjTBMlQ== + version "8.12.1" + resolved "https://registry.yarnpkg.com/npm/-/npm-8.12.1.tgz#624064fa7a8e0730223f6b2effe087e7127d567b" + integrity sha512-0yOlhfgu1UzP6UijnaFuIS2bES2H9D90EA5OVsf2iOZw7VBrjntXKEwKfCaFA6vMVWkCP8qnPwCxxPdnDVwlNw== dependencies: "@isaacs/string-locale-compare" "^1.1.0" "@npmcli/arborist" "^5.0.4" @@ -7691,7 +7691,7 @@ npm@^8.3.0: "@npmcli/run-script" "^3.0.1" abbrev "~1.1.1" archy "~1.0.0" - cacache "^16.0.7" + cacache "^16.1.0" chalk "^4.1.2" chownr "^2.0.0" cli-columns "^4.0.0" @@ -7716,7 +7716,7 @@ npm@^8.3.0: libnpmsearch "^5.0.2" libnpmteam "^4.0.2" libnpmversion "^3.0.1" - make-fetch-happen "^10.1.3" + make-fetch-happen "^10.1.6" minipass "^3.1.6" minipass-pipeline "^1.2.4" mkdirp "^1.0.4" @@ -7733,7 +7733,7 @@ npm@^8.3.0: npm-user-validate "^1.0.1" npmlog "^6.0.2" opener "^1.5.2" - pacote "^13.3.0" + pacote "^13.6.0" parse-conflict-json "^2.0.2" proc-log "^2.0.1" qrcode-terminal "^0.12.0" @@ -7743,7 +7743,7 @@ npm@^8.3.0: readdir-scoped-modules "^1.1.0" rimraf "^3.0.2" semver "^7.3.7" - ssri "^9.0.0" + ssri "^9.0.1" tar "^6.1.11" text-table "~0.2.0" tiny-relative-date "^1.3.0" @@ -7763,9 +7763,9 @@ npmlog@^6.0.0, npmlog@^6.0.2: set-blocking "^2.0.0" nth-check@^2.0.1: - version "2.1.0" - resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-2.1.0.tgz#0cd91c5c08967b58b409fa76282e13851a33fa47" - integrity sha512-/sJnahgHzXT7OGgQeAPJ5WDcxs7teA2FU1wo6fEoYqjoHBU+AQi3Qz5hecKPlnOr1YjnSYwJTlBXADbEsaBMLg== + version "2.1.1" + resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-2.1.1.tgz#c9eab428effce36cd6b92c924bdb000ef1f1ed1d" + integrity sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w== dependencies: boolbase "^1.0.0" @@ -7775,9 +7775,9 @@ nwsapi@^2.2.0: integrity sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ== object-inspect@^1.12.0, object-inspect@^1.9.0: - version "1.12.1" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.1.tgz#28a661153bad7e470e4b01479ef1cb91ce511191" - integrity sha512-Y/jF6vnvEtOPGiKD1+q+X0CiUYRQtEHp89MLLUJ7TUivtH8Ugn2+3A7Rynqk7BRsAoqeOQWnFnjpDrKSxDgIGA== + version "1.12.2" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.2.tgz#c0641f26394532f28ab8d796ab954e43c009a8ea" + integrity sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ== object-keys@^1.1.1: version "1.1.1" @@ -7806,14 +7806,14 @@ object.values@^1.1.5: once@^1.3.0, once@^1.3.1, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== dependencies: wrappy "1" once@~1.3.0: version "1.3.3" resolved "https://registry.yarnpkg.com/once/-/once-1.3.3.tgz#b2e261557ce4c314ec8304f3fa82663e4297ca20" - integrity sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA= + integrity sha512-6vaNInhu+CHxtONf3zw3vq4SP2DOQhjBvIa3rNcG0+P7eKWlYH6Peu7rHizSloRU2EwMz6GraLieis9Ac9+p1w== dependencies: wrappy "1" @@ -7887,7 +7887,7 @@ p-filter@^2.0.0, p-filter@^2.1.0: p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" - integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= + integrity sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow== p-is-promise@^3.0.0: version "3.0.0" @@ -7918,7 +7918,7 @@ p-limit@^3.0.2: p-locate@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" - integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= + integrity sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg== dependencies: p-limit "^1.1.0" @@ -7979,17 +7979,17 @@ p-timeout@^3.2.0: p-try@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" - integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= + integrity sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww== p-try@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== -pacote@^13.0.3, pacote@^13.0.5, pacote@^13.3.0: - version "13.4.1" - resolved "https://registry.yarnpkg.com/pacote/-/pacote-13.4.1.tgz#b6610bf8903abc075bfffa02a2cedafe81a97293" - integrity sha512-FqlSWlD8n+ejCE17GF/lf0yasztMGFl4UFzYQk5njaK/qPPWfVDWnfQwqmqeXObWLSmIBew+O+CFD24vxkVDjg== +pacote@^13.0.3, pacote@^13.0.5, pacote@^13.5.0, pacote@^13.6.0: + version "13.6.0" + resolved "https://registry.yarnpkg.com/pacote/-/pacote-13.6.0.tgz#79ea3d3ae5a2b29e2994dcf18d75494e8d888032" + integrity sha512-zHmuCwG4+QKnj47LFlW3LmArwKoglx2k5xtADiMCivVWPgNRP5QyLDGOIjGjwOe61lhl1rO63m/VxT16pEHLWg== dependencies: "@npmcli/git" "^3.0.0" "@npmcli/installed-package-contents" "^1.0.7" @@ -8002,7 +8002,7 @@ pacote@^13.0.3, pacote@^13.0.5, pacote@^13.3.0: minipass "^3.1.6" mkdirp "^1.0.4" npm-package-arg "^9.0.0" - npm-packlist "^5.0.0" + npm-packlist "^5.1.0" npm-pick-manifest "^7.0.0" npm-registry-fetch "^13.0.1" proc-log "^2.0.0" @@ -8044,7 +8044,7 @@ parse-entities@^2.0.0: parse-json@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" - integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= + integrity sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw== dependencies: error-ex "^1.3.1" json-parse-better-errors "^1.0.1" @@ -8094,7 +8094,7 @@ parse5@6.0.1: path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" - integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= + integrity sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ== path-exists@^4.0.0: version "4.0.0" @@ -8104,12 +8104,12 @@ path-exists@^4.0.0: path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== path-key@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" - integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= + integrity sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw== path-key@^3.0.0, path-key@^3.1.0: version "3.1.1" @@ -8143,7 +8143,7 @@ path-type@^4.0.0: pend@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" - integrity sha1-elfrVQpng/kRUzH89GY9XI4AelA= + integrity sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg== picocolors@^1.0.0: version "1.0.0" @@ -8163,7 +8163,7 @@ pidtree@^0.3.0: pify@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" - integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= + integrity sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg== pirates@^4.0.4: version "4.0.5" @@ -8173,7 +8173,7 @@ pirates@^4.0.4: pkg-conf@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/pkg-conf/-/pkg-conf-2.1.0.tgz#2126514ca6f2abfebd168596df18ba57867f0058" - integrity sha1-ISZRTKbyq/69FoWW3xi6V4Z/AFg= + integrity sha512-C+VUP+8jis7EsQZIhDYmS5qlNtjv2yP4SNtjXK9AP1ZcTRlnSfuumaTnRfYZnYgUUYVIKqL0fRvmUGDV2fmp6g== dependencies: find-up "^2.0.0" load-json-file "^4.0.0" @@ -8198,7 +8198,7 @@ prelude-ls@^1.2.1: prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= + integrity sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w== prettier@2.6.2: version "2.6.2" @@ -8261,7 +8261,7 @@ promise-deferred@^2.0.3: promise-inflight@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" - integrity sha1-mEcocL8igTL8vdhoEputEsPAKeM= + integrity sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g== promise-retry@^2.0.1: version "2.0.1" @@ -8297,7 +8297,7 @@ prompts@^2.0.1: promzard@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/promzard/-/promzard-0.3.0.tgz#26a5d6ee8c7dee4cb12208305acfb93ba382a9ee" - integrity sha1-JqXW7ox97kyxIggwWs+5O6OCqe4= + integrity sha512-JZeYqd7UAcHCwI+sTOeUDYkvEU+1bQ7iE0UT1MgB/tERkAPkesW46MrpIySzODi+owTjZtiF8Ay5j9m60KmMBw== dependencies: read "1" @@ -8314,7 +8314,7 @@ protocols@^1.1.0, protocols@^1.4.0: pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" - integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= + integrity sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ== psl@^1.1.33: version "1.8.0" @@ -8337,7 +8337,7 @@ punycode@^2.1.0, punycode@^2.1.1: q@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" - integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= + integrity sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw== qrcode-terminal@^0.12.0: version "0.12.0" @@ -8932,10 +8932,19 @@ smart-buffer@^4.2.0: resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.2.0.tgz#6e1d71fa4f18c05f7d0ff216dd16a481d0e8d9ae" integrity sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg== -socks-proxy-agent@^6.0.0, socks-proxy-agent@^6.1.1: - version "6.2.0" - resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-6.2.0.tgz#f6b5229cc0cbd6f2f202d9695f09d871e951c85e" - integrity sha512-wWqJhjb32Q6GsrUqzuFkukxb/zzide5quXYcMVpIjxalDBBYy2nqKCFQ/9+Ie4dvOYSQdOk3hUlZSdzZOd3zMQ== +socks-proxy-agent@^6.0.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-6.2.1.tgz#2687a31f9d7185e38d530bef1944fe1f1496d6ce" + integrity sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ== + dependencies: + agent-base "^6.0.2" + debug "^4.3.3" + socks "^2.6.2" + +socks-proxy-agent@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-7.0.0.tgz#dc069ecf34436621acb41e3efa66ca1b5fed15b6" + integrity sha512-Fgl0YPZ902wEsAyiQ+idGd1A7rSFx/ayC1CQVMw5P+EQx2V0SgpGtf6OKFhVjPflPUl9YMmEOnmfjCdMUsygww== dependencies: agent-base "^6.0.2" debug "^4.3.3" @@ -8970,9 +8979,9 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== source-map@^0.7.3: - version "0.7.3" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" - integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== + version "0.7.4" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656" + integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA== spawn-error-forwarder@~1.0.0: version "1.0.0" @@ -9048,7 +9057,7 @@ ssri@^8.0.0, ssri@^8.0.1: dependencies: minipass "^3.1.1" -ssri@^9.0.0: +ssri@^9.0.0, ssri@^9.0.1: version "9.0.1" resolved "https://registry.yarnpkg.com/ssri/-/ssri-9.0.1.tgz#544d4c357a8d7b71a19700074b6883fcb4eae057" integrity sha512-o57Wcn66jMQvfHG1FlYbWeZWW/dHZhJXjpIcTfXldXEk5nz5lStPo3mK0OJQfGR3RbZUlbISexbljkJzuEj/8Q== @@ -9553,9 +9562,9 @@ type-fest@^1.0.2: integrity sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA== typed-rest-client@^1.8.4: - version "1.8.6" - resolved "https://registry.yarnpkg.com/typed-rest-client/-/typed-rest-client-1.8.6.tgz#d8facd6abd98cbd8ad14cccf056ca5cc306919d7" - integrity sha512-xcQpTEAJw2DP7GqVNECh4dD+riS+C1qndXLfBCJ3xk0kqprtGN491P5KlmrDbKdtuW8NEcP/5ChxiJI3S9WYTA== + version "1.8.9" + resolved "https://registry.yarnpkg.com/typed-rest-client/-/typed-rest-client-1.8.9.tgz#e560226bcadfe71b0fb5c416b587f8da3b8f92d8" + integrity sha512-uSmjE38B80wjL85UFX3sTYEUlvZ1JgCRhsWj/fJ4rZ0FqDUFoIuodtiVeE+cUqiVTOKPdKrp/sdftD15MDek6g== dependencies: qs "^6.9.1" tunnel "0.0.6" @@ -9594,9 +9603,9 @@ unbox-primitive@^1.0.2: which-boxed-primitive "^1.0.2" underscore@^1.12.1: - version "1.13.3" - resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.13.3.tgz#54bc95f7648c5557897e5e968d0f76bc062c34ee" - integrity sha512-QvjkYpiD+dJJraRA8+dGAU4i7aBbb2s0S3jA45TFOvg2VgqvdCDd/3N6CqA8gluk1W91GLoXg5enMUx560QzuA== + version "1.13.4" + resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.13.4.tgz#7886b46bbdf07f768e0052f1828e1dcab40c0dee" + integrity sha512-BQFnUDuAQ4Yf/cYY5LNrK9NCJFKriaRbD9uR1fTeXnBeoa97W0i41qkZfGO9pSo8I5KzjAcSY2XYtdf0oKd7KQ== unified@9.2.2, unified@^9.1.0: version "9.2.2" @@ -9943,9 +9952,9 @@ write-yaml-file@^4.2.0: write-file-atomic "^3.0.3" ws@^7.4.6: - version "7.5.7" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.7.tgz#9e0ac77ee50af70d58326ecff7e85eb3fa375e67" - integrity sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A== + version "7.5.8" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.8.tgz#ac2729881ab9e7cbaf8787fe3469a48c5c7f636a" + integrity sha512-ri1Id1WinAX5Jqn9HejiGb8crfRio0Qgu8+MtL36rlTA6RLsMdWt1Az/19A2Qij6uSHUMphEFaTKa4WG+UNHNw== xml-name-validator@^3.0.0: version "3.0.0" From 44c67da0e18c4657b2369f594542088dca488fcf Mon Sep 17 00:00:00 2001 From: Johannes Feichtner Date: Mon, 6 Jun 2022 07:47:17 +0200 Subject: [PATCH 033/240] feat(dockerfile): add support for escape chars and ARG instructions (#15751) --- .../dockerfile/__fixtures__/3.Dockerfile | 14 + .../dockerfile/__fixtures__/4.Dockerfile | 28 + .../manager/dockerfile/extract.spec.ts | 500 +++++++++++++++++- lib/modules/manager/dockerfile/extract.ts | 276 ++++++++-- 4 files changed, 734 insertions(+), 84 deletions(-) create mode 100644 lib/modules/manager/dockerfile/__fixtures__/3.Dockerfile create mode 100644 lib/modules/manager/dockerfile/__fixtures__/4.Dockerfile diff --git a/lib/modules/manager/dockerfile/__fixtures__/3.Dockerfile b/lib/modules/manager/dockerfile/__fixtures__/3.Dockerfile new file mode 100644 index 00000000000000..ef4344c0ec17b7 --- /dev/null +++ b/lib/modules/manager/dockerfile/__fixtures__/3.Dockerfile @@ -0,0 +1,14 @@ + ARG \ + # multi-line arg + ALPINE_VERSION=alpine:3.15.4 + +FROM \ +${ALPINE_VERSION} as stage1 + +ARG \ + \ + # multi-line arg + # and multi-line comment + nginx_version="nginx:1.18.0-alpine@sha256:ca9fac83c6c89a09424279de522214e865e322187b22a1a29b12747a4287b7bd" + +FROM $nginx_version as stage2 diff --git a/lib/modules/manager/dockerfile/__fixtures__/4.Dockerfile b/lib/modules/manager/dockerfile/__fixtures__/4.Dockerfile new file mode 100644 index 00000000000000..1480cad0cc3c07 --- /dev/null +++ b/lib/modules/manager/dockerfile/__fixtures__/4.Dockerfile @@ -0,0 +1,28 @@ +# syntax=docker/dockerfile:1 + # EsCaPe=` + ARG ` + # multi-line arg + ALPINE_VERSION=alpine:3.15.4 + +FROM ` +${ALPINE_VERSION} as stage1 + +ARG ` + ` + # multi-line arg + # and multi-line comment + nginx_version="nginx:18.04@sha256:abcdef" + +FROM $nginx_version as stage2 + + FROM ` + ` + image5 ` + #comment5 + as name3 + + COPY ` + ` + --from=image12 a ` + #comment5 + b diff --git a/lib/modules/manager/dockerfile/extract.spec.ts b/lib/modules/manager/dockerfile/extract.spec.ts index 81c8a91e4e464f..38f0487483bd4f 100644 --- a/lib/modules/manager/dockerfile/extract.spec.ts +++ b/lib/modules/manager/dockerfile/extract.spec.ts @@ -1,8 +1,10 @@ -import { loadFixture } from '../../../../test/util'; -import { extractPackageFile, getDep } from './extract'; +import { Fixtures } from '../../../../test/fixtures'; +import { extractPackageFile, extractVariables, getDep } from './extract'; -const d1 = loadFixture('1.Dockerfile'); -const d2 = loadFixture('2.Dockerfile'); +const d1 = Fixtures.get('1.Dockerfile'); +const d2 = Fixtures.get('2.Dockerfile'); +const d3 = Fixtures.get('3.Dockerfile'); +const d4 = Fixtures.get('4.Dockerfile'); describe('modules/manager/dockerfile/extract', () => { describe('extractPackageFile()', () => { @@ -647,6 +649,377 @@ describe('modules/manager/dockerfile/extract', () => { ] `); }); + + it('handles implausible line continuation', () => { + const res = extractPackageFile( + 'FROM alpine:3.5\n\nRUN something \\' + ).deps; + expect(res).toMatchInlineSnapshot(` + Array [ + Object { + "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", + "currentDigest": undefined, + "currentValue": "3.5", + "datasource": "docker", + "depName": "alpine", + "depType": "final", + "replaceString": "alpine:3.5", + }, + ] + `); + }); + + it('handles multi-line FROM with space after escape character', () => { + const res = extractPackageFile('FROM \\ \nnginx:1.20\n').deps; + expect(res).toMatchInlineSnapshot(` + Array [ + Object { + "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", + "currentDigest": undefined, + "currentValue": "1.20", + "datasource": "docker", + "depName": "nginx", + "depType": "final", + "replaceString": "nginx:1.20", + }, + ] + `); + }); + + it('handles FROM without ARG default value', () => { + const res = extractPackageFile('ARG img_base\nFROM $img_base\n').deps; + expect(res).toMatchInlineSnapshot(` + Array [ + Object { + "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", + "datasource": "docker", + "depType": "final", + "replaceString": "$img_base", + "skipReason": "contains-variable", + }, + ] + `); + }); + + it('handles FROM with empty ARG default value', () => { + const res = extractPackageFile( + 'ARG patch1=""\nARG patch2=\nFROM nginx:1.20${patch1}$patch2\n' + ).deps; + expect(res).toMatchInlineSnapshot(` + Array [ + Object { + "autoReplaceStringTemplate": "FROM nginx:{{#if newValue}}{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}\${patch1}$patch2", + "currentDigest": undefined, + "currentValue": "1.20", + "datasource": "docker", + "depName": "nginx", + "depType": "final", + "replaceString": "FROM nginx:1.20\${patch1}$patch2", + }, + ] + `); + }); + + it('handles FROM with version in ARG value', () => { + const res = extractPackageFile( + 'ARG\tVARIANT="1.60.0-bullseye"\nFROM\trust:${VARIANT}\n' + ).deps; + expect(res).toMatchInlineSnapshot(` + Array [ + Object { + "autoReplaceStringTemplate": "ARG\tVARIANT=\\"{{#if newValue}}{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}\\"", + "currentDigest": undefined, + "currentValue": "1.60.0-bullseye", + "datasource": "docker", + "depName": "rust", + "depType": "final", + "replaceString": "ARG\tVARIANT=\\"1.60.0-bullseye\\"", + }, + ] + `); + }); + + it('handles FROM with version in ARG default value', () => { + const res = extractPackageFile( + 'ARG IMAGE_VERSION=${IMAGE_VERSION:-ubuntu:xenial}\nfrom ${IMAGE_VERSION} as base\n' + ).deps; + expect(res).toMatchInlineSnapshot(` + Array [ + Object { + "autoReplaceStringTemplate": "ARG IMAGE_VERSION=\${IMAGE_VERSION:-ubuntu:{{#if newValue}}{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}}", + "currentValue": "xenial", + "datasource": "docker", + "depName": "ubuntu", + "depType": "final", + "replaceString": "ARG IMAGE_VERSION=\${IMAGE_VERSION:-ubuntu:xenial}", + "versioning": "ubuntu", + }, + ] + `); + }); + + it('handles FROM with digest in ARG default value', () => { + const res = extractPackageFile( + 'ARG sha_digest=sha256:ab37242e81cbc031b2600eef4440fe87055a05c14b40686df85078cc5086c98f\n' + + ' FROM gcr.io/distroless/java17@$sha_digest' + ).deps; + expect(res).toMatchInlineSnapshot(` + Array [ + Object { + "autoReplaceStringTemplate": "ARG sha_digest={{#if newDigest}}{{newDigest}}{{/if}}", + "currentDigest": "sha256:ab37242e81cbc031b2600eef4440fe87055a05c14b40686df85078cc5086c98f", + "currentValue": undefined, + "datasource": "docker", + "depName": "gcr.io/distroless/java17", + "depType": "final", + "replaceString": "ARG sha_digest=sha256:ab37242e81cbc031b2600eef4440fe87055a05c14b40686df85078cc5086c98f", + }, + ] + `); + }); + + it('handles FROM with overwritten ARG value', () => { + const res = extractPackageFile( + 'ARG base=nginx:1.19\nFROM $base as stage1\nARG base=nginx:1.20\nFROM --platform=amd64 $base as stage2\n' + ).deps; + expect(res).toMatchInlineSnapshot(` + Array [ + Object { + "autoReplaceStringTemplate": "ARG base=nginx:{{#if newValue}}{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", + "currentDigest": undefined, + "currentValue": "1.19", + "datasource": "docker", + "depName": "nginx", + "depType": "stage", + "replaceString": "ARG base=nginx:1.19", + }, + Object { + "autoReplaceStringTemplate": "ARG base=nginx:{{#if newValue}}{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", + "currentDigest": undefined, + "currentValue": "1.20", + "datasource": "docker", + "depName": "nginx", + "depType": "final", + "replaceString": "ARG base=nginx:1.20", + }, + ] + `); + }); + + it('handles FROM with multiple ARG values', () => { + const res = extractPackageFile( + 'ARG CUDA=9.2\nARG LINUX_VERSION ubuntu16.04\nFROM nvidia/cuda:${CUDA}-devel-${LINUX_VERSION}\n' + ).deps; + expect(res).toMatchInlineSnapshot(` + Array [ + Object { + "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", + "currentDigest": undefined, + "currentValue": "9.2-devel-ubuntu16.04", + "datasource": "docker", + "depName": "nvidia/cuda", + "depType": "final", + "replaceString": "nvidia/cuda:9.2-devel-ubuntu16.04", + }, + ] + `); + }); + + it('skips scratch if provided in ARG value', () => { + const res = extractPackageFile('ARG img="scratch"\nFROM $img as base\n'); + expect(res).toBeNull(); + }); + + it('extracts images from multi-line ARG statements', () => { + const res = extractPackageFile(d3).deps; + expect(res).toEqual([ + { + autoReplaceStringTemplate: + ' ARG \\\n' + + '\t# multi-line arg\n' + + ' ALPINE_VERSION=alpine:{{#if newValue}}{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}', + currentDigest: undefined, + currentValue: '3.15.4', + datasource: 'docker', + depName: 'alpine', + depType: 'stage', + replaceString: + ' ARG \\\n' + + '\t# multi-line arg\n' + + ' ALPINE_VERSION=alpine:3.15.4', + }, + { + autoReplaceStringTemplate: + 'ARG \\\n' + + ' \\\n' + + ' # multi-line arg\n' + + ' # and multi-line comment\n' + + ' nginx_version="nginx:{{#if newValue}}{{newValue}}{{/if}}@{{#if newDigest}}{{newDigest}}{{/if}}"', + currentDigest: + 'sha256:ca9fac83c6c89a09424279de522214e865e322187b22a1a29b12747a4287b7bd', + currentValue: '1.18.0-alpine', + datasource: 'docker', + depName: 'nginx', + depType: 'final', + replaceString: + 'ARG \\\n' + + ' \\\n' + + ' # multi-line arg\n' + + ' # and multi-line comment\n' + + ' nginx_version="nginx:1.18.0-alpine@sha256:ca9fac83c6c89a09424279de522214e865e322187b22a1a29b12747a4287b7bd"', + }, + ]); + }); + + it('ignores parser directives in wrong order', () => { + const res = extractPackageFile( + '# dummy\n# escape = `\n\nFROM\\\nnginx:1.20' + ).deps; + expect(res).toMatchInlineSnapshot(` + Array [ + Object { + "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", + "currentDigest": undefined, + "currentValue": "1.20", + "datasource": "docker", + "depName": "nginx", + "depType": "final", + "replaceString": "nginx:1.20", + }, + ] + `); + }); + + it('handles an alternative escape character', () => { + const res = extractPackageFile(d4).deps; + expect(res).toEqual([ + { + autoReplaceStringTemplate: + ' ARG `\n' + + '\t# multi-line arg\n' + + ' ALPINE_VERSION=alpine:{{#if newValue}}{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}', + currentDigest: undefined, + currentValue: '3.15.4', + datasource: 'docker', + depName: 'alpine', + depType: 'stage', + replaceString: + ' ARG `\n' + + '\t# multi-line arg\n' + + ' ALPINE_VERSION=alpine:3.15.4', + }, + { + autoReplaceStringTemplate: + 'ARG `\n' + + ' `\n' + + ' # multi-line arg\n' + + ' # and multi-line comment\n' + + ' nginx_version="nginx:{{#if newValue}}{{newValue}}{{/if}}@{{#if newDigest}}{{newDigest}}{{/if}}"', + currentDigest: 'sha256:abcdef', + currentValue: '18.04', + datasource: 'docker', + depName: 'nginx', + depType: 'stage', + replaceString: + 'ARG `\n' + + ' `\n' + + ' # multi-line arg\n' + + ' # and multi-line comment\n' + + ' nginx_version="nginx:18.04@sha256:abcdef"', + }, + { + autoReplaceStringTemplate: + '{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}', + currentDigest: undefined, + currentValue: undefined, + datasource: 'docker', + depName: 'image5', + depType: 'stage', + replaceString: 'image5', + }, + { + autoReplaceStringTemplate: + '{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}', + currentDigest: undefined, + currentValue: undefined, + datasource: 'docker', + depName: 'image12', + depType: 'final', + replaceString: 'image12', + }, + ]); + }); + + it('handles FROM with version in ARG default value and quotes', () => { + const res = extractPackageFile( + 'ARG REF_NAME=${REF_NAME:-"gcr.io/distroless/static-debian11:nonroot@sha256:abc"}\nfrom ${REF_NAME}' + ).deps; + expect(res).toMatchInlineSnapshot(` + Array [ + Object { + "autoReplaceStringTemplate": "ARG REF_NAME=\${REF_NAME:-\\"gcr.io/distroless/static-debian11:{{#if newValue}}{{newValue}}{{/if}}@{{#if newDigest}}{{newDigest}}{{/if}}\\"}", + "currentDigest": "sha256:abc", + "currentValue": "nonroot", + "datasource": "docker", + "depName": "gcr.io/distroless/static-debian11", + "depType": "final", + "replaceString": "ARG REF_NAME=\${REF_NAME:-\\"gcr.io/distroless/static-debian11:nonroot@sha256:abc\\"}", + }, + ] + `); + }); + + it('handles version in ARG and digest in FROM with CRLF linefeed', () => { + const res = extractPackageFile( + 'ARG IMAGE_TAG=14.04\r\n#something unrelated\r\nFROM ubuntu:$IMAGE_TAG@sha256:abc\r\n' + ).deps; + expect(res).toEqual([ + { + autoReplaceStringTemplate: + 'ARG IMAGE_TAG={{#if newValue}}{{newValue}}{{/if}}\r\n#something unrelated\r\nFROM ubuntu:$IMAGE_TAG@{{#if newDigest}}{{newDigest}}{{/if}}', + currentDigest: 'sha256:abc', + currentValue: '14.04', + datasource: 'docker', + depName: 'ubuntu', + depType: 'final', + replaceString: + 'ARG IMAGE_TAG=14.04\r\n#something unrelated\r\nFROM ubuntu:$IMAGE_TAG@sha256:abc', + versioning: 'ubuntu', + }, + ]); + }); + + it('handles updates of multiple ARG values', () => { + const res = extractPackageFile( + '# random comment\n\n' + + 'ARG NODE_IMAGE_HASH="@sha256:ba9c961513b853210ae0ca1524274eafa5fd94e20b856343887ca7274c8450e4"\n' + + 'ARG NODE_IMAGE_HOST="docker.io/library/"\n' + + 'ARG NODE_IMAGE_NAME=node\n' + + 'ARG NODE_IMAGE_TAG="16.14.2-alpine3.14"\n' + + 'ARG DUMMY_PREFIX=\n' + + 'FROM ${DUMMY_PREFIX}${NODE_IMAGE_HOST}${NODE_IMAGE_NAME}:${NODE_IMAGE_TAG}${NODE_IMAGE_HASH} as yarn\n' + ).deps; + expect(res).toEqual([ + { + autoReplaceStringTemplate: + 'ARG NODE_IMAGE_HASH="@{{#if newDigest}}{{newDigest}}{{/if}}"\n' + + 'ARG NODE_IMAGE_HOST="docker.io/library/"\n' + + 'ARG NODE_IMAGE_NAME=node\n' + + 'ARG NODE_IMAGE_TAG="{{#if newValue}}{{newValue}}{{/if}}"', + currentDigest: + 'sha256:ba9c961513b853210ae0ca1524274eafa5fd94e20b856343887ca7274c8450e4', + currentValue: '16.14.2-alpine3.14', + datasource: 'docker', + depName: 'docker.io/library/node', + depType: 'final', + replaceString: + 'ARG NODE_IMAGE_HASH="@sha256:ba9c961513b853210ae0ca1524274eafa5fd94e20b856343887ca7274c8450e4"\n' + + 'ARG NODE_IMAGE_HOST="docker.io/library/"\n' + + 'ARG NODE_IMAGE_NAME=node\n' + + 'ARG NODE_IMAGE_TAG="16.14.2-alpine3.14"', + }, + ]); + }); }); describe('getDep()', () => { @@ -657,37 +1030,63 @@ describe('modules/manager/dockerfile/extract', () => { it('handles default environment variable values', () => { const res = getDep('${REDIS_IMAGE:-redis:5.0.0@sha256:abcd}'); expect(res).toMatchInlineSnapshot(` -Object { - "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", - "currentDigest": "sha256:abcd", - "currentValue": "5.0.0", - "datasource": "docker", - "depName": "redis", - "replaceString": "redis:5.0.0@sha256:abcd", -} -`); + Object { + "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", + "currentDigest": "sha256:abcd", + "currentValue": "5.0.0", + "datasource": "docker", + "depName": "redis", + "replaceString": "redis:5.0.0@sha256:abcd", + } + `); const res2 = getDep('${REDIS_IMAGE:-redis:5.0.0}'); expect(res2).toMatchInlineSnapshot(` -Object { - "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", - "currentValue": "5.0.0", - "datasource": "docker", - "depName": "redis", - "replaceString": "redis:5.0.0", -} -`); + Object { + "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", + "currentValue": "5.0.0", + "datasource": "docker", + "depName": "redis", + "replaceString": "redis:5.0.0", + } + `); const res3 = getDep('${REDIS_IMAGE:-redis@sha256:abcd}'); expect(res3).toMatchInlineSnapshot(` -Object { - "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", - "currentDigest": "sha256:abcd", - "datasource": "docker", - "depName": "redis", - "replaceString": "redis@sha256:abcd", -} -`); + Object { + "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", + "currentDigest": "sha256:abcd", + "datasource": "docker", + "depName": "redis", + "replaceString": "redis@sha256:abcd", + } + `); + + const res4 = getDep( + '${REF_NAME:-"gcr.io/distroless/static-debian11:nonroot@sha256:abc"}' + ); + expect(res4).toMatchInlineSnapshot(` + Object { + "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", + "currentDigest": "sha256:abc", + "currentValue": "nonroot", + "datasource": "docker", + "depName": "gcr.io/distroless/static-debian11", + "replaceString": "gcr.io/distroless/static-debian11:nonroot@sha256:abc", + } + `); + + const res5 = getDep( + '${REF_NAME:+-gcr.io/distroless/static-debian11:nonroot@sha256:abc}' + ); + expect(res5).toMatchInlineSnapshot(` + Object { + "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", + "datasource": "docker", + "replaceString": "\${REF_NAME:+-gcr.io/distroless/static-debian11:nonroot@sha256:abc}", + "skipReason": "contains-variable", + } + `); }); it('skips tag containing a variable', () => { @@ -750,4 +1149,47 @@ Object { `); }); }); + + describe('extractVariables()', () => { + it('handles no variable', () => { + expect(extractVariables('nginx:latest')).toBeEmpty(); + }); + + it('handles simple variable', () => { + expect(extractVariables('nginx:$version')).toMatchObject({ + $version: 'version', + }); + }); + + it('handles escaped variable', () => { + expect(extractVariables('nginx:\\$version')).toMatchObject({ + '\\$version': 'version', + }); + }); + + it('handles complex variable', () => { + expect(extractVariables('ubuntu:${ubuntu_version}')).toMatchObject({ + '${ubuntu_version}': 'ubuntu_version', + }); + }); + + it('handles complex variable with static default value', () => { + expect(extractVariables('${var1:-nginx}:latest')).toMatchObject({ + '${var1:-nginx}': 'var1', + }); + }); + + it('handles complex variable with other variable as default value', () => { + expect(extractVariables('${VAR1:-$var2}:latest')).toMatchObject({ + '${VAR1:-$var2}': 'VAR1', + }); + }); + + it('handles multiple variables', () => { + expect(extractVariables('${var1:-$var2}:$version')).toMatchObject({ + '${var1:-$var2}': 'var1', + $version: 'version', + }); + }); + }); }); diff --git a/lib/modules/manager/dockerfile/extract.ts b/lib/modules/manager/dockerfile/extract.ts index 6dc2b0d869cd9a..f27f7461a8f7d6 100644 --- a/lib/modules/manager/dockerfile/extract.ts +++ b/lib/modules/manager/dockerfile/extract.ts @@ -1,6 +1,6 @@ import is from '@sindresorhus/is'; import { logger } from '../../../logger'; -import { regEx } from '../../../util/regex'; +import { newlineRegex, regEx } from '../../../util/regex'; import { DockerDatasource } from '../../datasource/docker'; import * as debianVersioning from '../../versioning/debian'; import * as ubuntuVersioning from '../../versioning/ubuntu'; @@ -11,6 +11,90 @@ const variableOpen = '${'; const variableClose = '}'; const variableDefaultValueSplit = ':-'; +export function extractVariables(image: string): Record { + const variables: Record = {}; + const variableRegex = regEx( + /(?\\?\$(?\w+)|\\?\${(?\w+)(?::.+?)?}+)/gi + ); + + let match: RegExpExecArray | null; + do { + match = variableRegex.exec(image); + if (match?.groups?.fullvariable) { + variables[match.groups.fullvariable] = + match.groups?.simplearg || match.groups?.complexarg; + } + } while (match); + + return variables; +} + +function getAutoReplaceTemplate(dep: PackageDependency): string | undefined { + let template = dep.replaceString; + + if (dep.currentValue) { + let placeholder = '{{#if newValue}}{{newValue}}{{/if}}'; + if (!dep.currentDigest) { + placeholder += '{{#if newDigest}}@{{newDigest}}{{/if}}'; + } + template = template?.replace(dep.currentValue, placeholder); + } + + if (dep.currentDigest) { + template = template?.replace( + dep.currentDigest, + '{{#if newDigest}}{{newDigest}}{{/if}}' + ); + } + + return template; +} + +function processDepForAutoReplace( + dep: PackageDependency, + lineNumberRanges: number[][], + lines: string[], + linefeed: string +): void { + const lineNumberRangesToReplace: number[][] = []; + for (const lineNumberRange of lineNumberRanges) { + for (const lineNumber of lineNumberRange) { + if ( + (dep.currentValue && lines[lineNumber].includes(dep.currentValue)) || + (dep.currentDigest && lines[lineNumber].includes(dep.currentDigest)) + ) { + lineNumberRangesToReplace.push(lineNumberRange); + } + } + } + + lineNumberRangesToReplace.sort((a, b) => { + return a[0] - b[0]; + }); + + const minLine = lineNumberRangesToReplace[0]?.[0]; + const maxLine = + lineNumberRangesToReplace[lineNumberRangesToReplace.length - 1]?.[1]; + if ( + lineNumberRanges.length === 1 || + minLine === undefined || + maxLine === undefined + ) { + return; + } + + const unfoldedLineNumbers = Array.from( + { length: maxLine - minLine + 1 }, + (_v, k) => k + minLine + ); + + dep.replaceString = unfoldedLineNumbers + .map((lineNumber) => lines[lineNumber]) + .join(linefeed); + + dep.autoReplaceStringTemplate = getAutoReplaceTemplate(dep); +} + export function splitImageParts(currentFrom: string): PackageDependency { // Check if we have a variable in format of "${VARIABLE:-:@}" // If so, remove everything except the image, defaultVal and digest. @@ -41,6 +125,7 @@ export function splitImageParts(currentFrom: string): PackageDependency { cleanedCurrentFrom.indexOf(variableDefaultValueSplit) + variableDefaultValueSplit.length ); + cleanedCurrentFrom = cleanedCurrentFrom.replace(regEx(/^"(.*)"$/), '$1'); } const [currentDepTag, currentDigest] = cleanedCurrentFrom.split('@'); @@ -58,7 +143,7 @@ export function splitImageParts(currentFrom: string): PackageDependency { } if (depName?.includes(variableMarker)) { - // If depName contains a variable, after cleaning, e.g. "$REGISTRY/alpine", we currently not support this. + // If depName contains a variable, after cleaning, e.g. "$REGISTRY/alpine", we do not support this. return { skipReason: 'contains-variable', }; @@ -162,69 +247,150 @@ export function getDep( export function extractPackageFile(content: string): PackageFile | null { const deps: PackageDependency[] = []; const stageNames: string[] = []; + const args: Record = {}; + const argsLines: Record = {}; - const fromMatches = content.matchAll( - /^[ \t]*FROM(?:\\\r?\n| |\t|#.*?\r?\n|[ \t]--[a-z]+=\S+?)*[ \t](?\S+)(?:(?:\\\r?\n| |\t|#.*\r?\n)+as[ \t]+(?\S+))?/gim // TODO #12875 complex for re2 has too many not supported groups - ); + let escapeChar = '\\\\'; + let lookForEscapeChar = true; + + const lineFeed = content.indexOf('\r\n') >= 0 ? '\r\n' : '\n'; + const lines = content.split(newlineRegex); + for (let lineNumber = 0; lineNumber < lines.length; ) { + const lineNumberInstrStart = lineNumber; + let instruction = lines[lineNumber]; - for (const fromMatch of fromMatches) { - if (fromMatch.groups?.name) { - logger.debug('Found a multistage build stage name'); - stageNames.push(fromMatch.groups.name); + if (lookForEscapeChar) { + const directivesMatch = regEx( + /^[ \t]*#[ \t]*(?syntax|escape)[ \t]*=[ \t]*(?\S)/i + ).exec(instruction); + if (!directivesMatch) { + lookForEscapeChar = false; + } else if (directivesMatch.groups?.directive.toLowerCase() === 'escape') { + if (directivesMatch.groups?.escapeChar === '`') { + escapeChar = '`'; + } + lookForEscapeChar = false; + } } - if (fromMatch.groups?.image === 'scratch') { - logger.debug('Skipping scratch'); - } else if ( - fromMatch.groups?.image && - stageNames.includes(fromMatch.groups.image) + + const lineContinuationRegex = regEx(escapeChar + '[ \\t]*$|^[ \\t]*#', 'm'); + let lineLookahead = instruction; + while ( + !lookForEscapeChar && + !instruction.trimStart().startsWith('#') && + lineContinuationRegex.test(lineLookahead) ) { - logger.debug({ image: fromMatch.groups.image }, 'Skipping alias FROM'); - } else { - const dep = getDep(fromMatch.groups?.image); - logger.trace( - { - depName: dep.depName, - currentValue: dep.currentValue, - currentDigest: dep.currentDigest, - }, - 'Dockerfile FROM' - ); - deps.push(dep); + lineLookahead = lines[++lineNumber] || ''; + instruction += '\n' + lineLookahead; } - } - const copyFromMatches = content.matchAll( - /^[ \t]*COPY(?:\\\r?\n| |\t|#.*\r?\n|[ \t]--[a-z]+=\w+?)*[ \t]--from=(?\S+)/gim // TODO #12875 complex for re2 has too many not supported groups - ); + const argRegex = regEx( + '^[ \\t]*ARG(?:' + + escapeChar + + '[ \\t]*\\r?\\n| |\\t|#.*?\\r?\\n)+(?\\S+)[ =](?.*)', + 'im' + ); + const argMatch = argRegex.exec(instruction); + if (argMatch?.groups?.name) { + argsLines[argMatch.groups.name] = [lineNumberInstrStart, lineNumber]; + let argMatchValue = argMatch.groups?.value; + + if ( + argMatchValue.charAt(0) === '"' && + argMatchValue.charAt(argMatchValue.length - 1) === '"' + ) { + argMatchValue = argMatchValue.slice(1, -1); + } - for (const copyFromMatch of copyFromMatches) { - // istanbul ignore if: will never happen - if (!copyFromMatch.groups?.image) { - continue; + args[argMatch.groups.name] = argMatchValue || ''; } - if (stageNames.includes(copyFromMatch.groups.image)) { - logger.debug( - { image: copyFromMatch.groups.image }, - 'Skipping alias COPY --from' - ); - } else if (Number.isNaN(Number(copyFromMatch.groups.image))) { - const dep = getDep(copyFromMatch.groups.image); - logger.debug( - { - depName: dep.depName, - currentValue: dep.currentValue, - currentDigest: dep.currentDigest, - }, - 'Dockerfile COPY --from' - ); - deps.push(dep); - } else { - logger.debug( - { image: copyFromMatch.groups.image }, - 'Skipping index reference COPY --from' - ); + + const fromRegex = new RegExp( + '^[ \\t]*FROM(?:' + + escapeChar + + '[ \\t]*\\r?\\n| |\\t|#.*?\\r?\\n|--platform=\\S+)+(?\\S+)(?:(?:' + + escapeChar + + '[ \\t]*\\r?\\n| |\\t|#.*?\\r?\\n)+as[ \\t]+(?\\S+))?', + 'im' + ); // TODO #12875 complex for re2 has too many not supported groups + const fromMatch = instruction.match(fromRegex); + if (fromMatch?.groups?.image) { + let fromImage = fromMatch.groups.image; + const lineNumberRanges: number[][] = [[lineNumberInstrStart, lineNumber]]; + + if (fromImage.includes(variableMarker)) { + const variables = extractVariables(fromImage); + for (const [fullVariable, argName] of Object.entries(variables)) { + const resolvedArgValue = args[argName]; + if (resolvedArgValue || resolvedArgValue === '') { + fromImage = fromImage.replace(fullVariable, resolvedArgValue); + lineNumberRanges.push(argsLines[argName]); + } + } + } + + if (fromMatch.groups?.name) { + logger.debug('Found a multistage build stage name'); + stageNames.push(fromMatch.groups.name); + } + if (fromImage === 'scratch') { + logger.debug('Skipping scratch'); + } else if (fromImage && stageNames.includes(fromImage)) { + logger.debug({ image: fromImage }, 'Skipping alias FROM'); + } else { + const dep = getDep(fromImage); + processDepForAutoReplace(dep, lineNumberRanges, lines, lineFeed); + logger.trace( + { + depName: dep.depName, + currentValue: dep.currentValue, + currentDigest: dep.currentDigest, + }, + 'Dockerfile FROM' + ); + deps.push(dep); + } + } + + const copyFromRegex = new RegExp( + '^[ \\t]*COPY(?:' + + escapeChar + + '[ \\t]*\\r?\\n| |\\t|#.*?\\r?\\n|--[a-z]+=[a-zA-Z0-9_.:-]+?)+--from=(?\\S+)', + 'im' + ); // TODO #12875 complex for re2 has too many not supported groups + const copyFromMatch = instruction.match(copyFromRegex); + if (copyFromMatch?.groups?.image) { + if (stageNames.includes(copyFromMatch.groups.image)) { + logger.debug( + { image: copyFromMatch.groups.image }, + 'Skipping alias COPY --from' + ); + } else if (Number.isNaN(Number(copyFromMatch.groups.image))) { + const dep = getDep(copyFromMatch.groups.image); + const lineNumberRanges: number[][] = [ + [lineNumberInstrStart, lineNumber], + ]; + processDepForAutoReplace(dep, lineNumberRanges, lines, lineFeed); + logger.debug( + { + depName: dep.depName, + currentValue: dep.currentValue, + currentDigest: dep.currentDigest, + }, + 'Dockerfile COPY --from' + ); + deps.push(dep); + } else { + logger.debug( + { image: copyFromMatch.groups.image }, + 'Skipping index reference COPY --from' + ); + } } + + lineNumber += 1; } + if (!deps.length) { return null; } From 244e18ab77865a908ca3309cab16e4d76851dfa3 Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Mon, 6 Jun 2022 09:23:25 +0300 Subject: [PATCH 034/240] feat(github): Different cache update frequency for fresh packages (#15901) --- .../github-releases/cache/cache-base.spec.ts | 75 +++++++++++++++++ .../github-releases/cache/cache-base.ts | 81 ++++++++++++++++++- .../datasource/github-releases/cache/types.ts | 22 +++++ 3 files changed, 175 insertions(+), 3 deletions(-) diff --git a/lib/modules/datasource/github-releases/cache/cache-base.spec.ts b/lib/modules/datasource/github-releases/cache/cache-base.spec.ts index b36e1ce61a544a..fcb2831567952b 100644 --- a/lib/modules/datasource/github-releases/cache/cache-base.spec.ts +++ b/lib/modules/datasource/github-releases/cache/cache-base.spec.ts @@ -115,6 +115,7 @@ describe('modules/datasource/github-releases/cache/cache-base', () => { { createdAt: now.toISO(), updatedAt: now.toISO(), + lastReleasedAt: t3, items: { v1: { bar: 'aaa', releaseTimestamp: t1, version: 'v1' }, v2: { bar: 'bbb', releaseTimestamp: t2, version: 'v2' }, @@ -174,6 +175,7 @@ describe('modules/datasource/github-releases/cache/cache-base', () => { { createdAt: t3, updatedAt: now.toISO(), + lastReleasedAt: t3, items: { v1: { bar: 'aaa', releaseTimestamp: t1, version: 'v1' }, v2: { bar: 'bbb', releaseTimestamp: t2, version: 'v2' }, @@ -184,6 +186,69 @@ describe('modules/datasource/github-releases/cache/cache-base', () => { ); }); + it('does not update non-fresh packages earlier than 120 minutes ago', async () => { + const releaseTimestamp = now.minus({ days: 7 }).toISO(); + const createdAt = now.minus({ minutes: 119 }).toISO(); + packageCache.get.mockResolvedValueOnce({ + items: { v1: { version: 'v1', releaseTimestamp, bar: 'aaa' } }, + createdAt: createdAt, + updatedAt: createdAt, + }); + responses = [ + resp([ + { name: 'v1', createdAt: releaseTimestamp, foo: 'aaa' }, + { name: 'v2', createdAt: now.toISO(), foo: 'bbb' }, + ]), + ]; + const cache = new TestCache(http, { resetDeltaMinutes: 0 }); + + const res = await cache.getItems({ packageName: 'foo/bar' }); + + expect(sortItems(res)).toMatchObject([ + { version: 'v1', releaseTimestamp, bar: 'aaa' }, + ]); + expect(httpPostJson).not.toHaveBeenCalled(); + }); + + it('updates non-fresh packages after 120 minutes', async () => { + const releaseTimestamp = now.minus({ days: 7 }).toISO(); + const recentTimestamp = now.toISO(); + const createdAt = now.minus({ minutes: 120 }).toISO(); + packageCache.get.mockResolvedValueOnce({ + items: { v1: { version: 'v1', releaseTimestamp, bar: 'aaa' } }, + createdAt: createdAt, + updatedAt: createdAt, + }); + responses = [ + resp([ + { name: 'v1', createdAt: releaseTimestamp, foo: 'aaa' }, + { name: 'v2', createdAt: recentTimestamp, foo: 'bbb' }, + ]), + ]; + const cache = new TestCache(http, { resetDeltaMinutes: 0 }); + + const res = await cache.getItems({ packageName: 'foo/bar' }); + + expect(sortItems(res)).toMatchObject([ + { version: 'v1', releaseTimestamp, bar: 'aaa' }, + { version: 'v2', releaseTimestamp: recentTimestamp, bar: 'bbb' }, + ]); + expect(packageCache.set).toHaveBeenCalledWith( + 'test-cache', + 'https://api.github.com/:foo:bar', + { + createdAt: createdAt, + items: { + v1: { bar: 'aaa', releaseTimestamp, version: 'v1' }, + v2: { bar: 'bbb', releaseTimestamp: recentTimestamp, version: 'v2' }, + }, + lastReleasedAt: recentTimestamp, + updatedAt: recentTimestamp, + }, + 60 * 24 * 7 - 120 + ); + }); + it('stops updating once stability period have passed', async () => { packageCache.get.mockResolvedValueOnce({ items: { @@ -279,4 +344,14 @@ describe('modules/datasource/github-releases/cache/cache-base', () => { expect(packageCache.get).toHaveBeenCalled(); expect(packageCache.set).not.toHaveBeenCalled(); }); + + it('finds latest release timestamp correctly', () => { + const cache = new TestCache(http); + const ts = cache.getLastReleaseTimestamp({ + v2: { bar: 'bbb', releaseTimestamp: t2, version: 'v2' }, + v3: { bar: 'ccc', releaseTimestamp: t3, version: 'v3' }, + v1: { bar: 'aaa', releaseTimestamp: t1, version: 'v1' }, + }); + expect(ts).toEqual(t3); + }); }); diff --git a/lib/modules/datasource/github-releases/cache/cache-base.ts b/lib/modules/datasource/github-releases/cache/cache-base.ts index 4ed5742ae27363..11b2797a8d4c5d 100644 --- a/lib/modules/datasource/github-releases/cache/cache-base.ts +++ b/lib/modules/datasource/github-releases/cache/cache-base.ts @@ -21,7 +21,26 @@ const cacheDefaults: Required = { /** * How many minutes to wait until next cache update */ - updateAfterMinutes: 30, + updateAfterMinutes: 120, + + /** + * If package was released recently, we assume higher + * probability of having one more release soon. + * + * In this case, we use `updateAfterMinutesFresh` option. + */ + packageFreshDays: 7, + + /** + * If package was released recently, we assume higher + * probability of having one more release soon. + * + * In this case, this option will be used + * instead of `updateAfterMinutes`. + * + * Fresh period is configured via `freshDays` option. + */ + updateAfterMinutesFresh: 30, /** * How many days to wait until full cache reset (for single package). @@ -80,6 +99,8 @@ export abstract class AbstractGithubDatasourceCache< FetchedItem = unknown > { private updateDuration: DurationLikeObject; + private packageFreshDaysDuration: DurationLikeObject; + private updateDurationFresh: DurationLikeObject; private resetDuration: DurationLikeObject; private stabilityDuration: DurationLikeObject; @@ -94,6 +115,8 @@ export abstract class AbstractGithubDatasourceCache< constructor(private http: GithubHttp, opts: CacheOptions = {}) { const { updateAfterMinutes, + packageFreshDays, + updateAfterMinutesFresh, resetAfterDays, unstableDays, maxPrefetchPages, @@ -107,6 +130,8 @@ export abstract class AbstractGithubDatasourceCache< }; this.updateDuration = { minutes: updateAfterMinutes }; + this.packageFreshDaysDuration = { days: packageFreshDays }; + this.updateDurationFresh = { minutes: updateAfterMinutesFresh }; this.resetDuration = { days: resetAfterDays }; this.stabilityDuration = { days: unstableDays }; @@ -168,15 +193,27 @@ export abstract class AbstractGithubDatasourceCache< const cacheDoesExist = cache && !isExpired(now, cache.createdAt, this.resetDuration); + let lastReleasedAt: string | null = null; + let updateDuration = this.updateDuration; if (cacheDoesExist) { // Keeping the the original `cache` value intact // in order to be used in exception handler cacheItems = { ...cache.items }; cacheCreatedAt = cache.createdAt; cacheUpdatedAt = cache.updatedAt; + lastReleasedAt = + cache.lastReleasedAt ?? this.getLastReleaseTimestamp(cacheItems); + + // Release is considered fresh, so we'll check it earlier + if ( + lastReleasedAt && + !isExpired(now, lastReleasedAt, this.packageFreshDaysDuration) + ) { + updateDuration = this.updateDurationFresh; + } } - if (isExpired(now, cacheUpdatedAt, this.updateDuration)) { + if (isExpired(now, cacheUpdatedAt, updateDuration)) { const variables: GithubQueryParams = { owner, name, @@ -225,7 +262,7 @@ export abstract class AbstractGithubDatasourceCache< for (const item of fetchedItems) { const newStoredItem = this.coerceFetched(item); if (newStoredItem) { - const { version } = newStoredItem; + const { version, releaseTimestamp } = newStoredItem; // Stop earlier if the stored item have reached stability, // which means `unstableDays` period have passed @@ -244,6 +281,18 @@ export abstract class AbstractGithubDatasourceCache< cacheItems[version] = newStoredItem; checkedVersions.add(version); + + lastReleasedAt ??= releaseTimestamp; + // It may be tempting to optimize the code and + // remove the check, as we're fetching fresh releases here. + // That's wrong, because some items are already cached, + // and they obviously aren't latest. + if ( + DateTime.fromISO(releaseTimestamp) > + DateTime.fromISO(lastReleasedAt) + ) { + lastReleasedAt = releaseTimestamp; + } } } } @@ -272,6 +321,11 @@ export abstract class AbstractGithubDatasourceCache< createdAt: cacheCreatedAt, updatedAt: now.toISO(), }; + + if (lastReleasedAt) { + cacheValue.lastReleasedAt = lastReleasedAt; + } + await packageCache.set( this.cacheNs, cacheKey, @@ -290,4 +344,25 @@ export abstract class AbstractGithubDatasourceCache< const rnd = Math.random(); return Math.floor(rnd * this.resetDeltaMinutes); } + + public getLastReleaseTimestamp( + items: Record + ): string | null { + let result: string | null = null; + let latest: DateTime | null = null; + + for (const { releaseTimestamp } of Object.values(items)) { + const timestamp = DateTime.fromISO(releaseTimestamp); + + result ??= releaseTimestamp; + latest ??= timestamp; + + if (timestamp > latest) { + result = releaseTimestamp; + latest = timestamp; + } + } + + return result; + } } diff --git a/lib/modules/datasource/github-releases/cache/types.ts b/lib/modules/datasource/github-releases/cache/types.ts index 898aa724e62f1d..047aa14daf4bdd 100644 --- a/lib/modules/datasource/github-releases/cache/types.ts +++ b/lib/modules/datasource/github-releases/cache/types.ts @@ -50,6 +50,9 @@ export interface GithubDatasourceCache { /** Cache soft updates are performed depending on `updatedAt` value. */ updatedAt: string; + + /** Latest release timestamp (`releaseTimestamp`) of all releases. */ + lastReleasedAt?: string; } /** @@ -61,6 +64,25 @@ export interface CacheOptions { */ updateAfterMinutes?: number; + /** + * If package was released recently, we assume higher + * probability of having one more release soon. + * + * In this case, we use `updateAfterMinutesFresh` option. + */ + packageFreshDays?: number; + + /** + * If package was released recently, we assume higher + * probability of having one more release soon. + * + * In this case, this option will be used + * instead of `updateAfterMinutes`. + * + * Fresh period is configured via `freshDays` option. + */ + updateAfterMinutesFresh?: number; + /** * How many days to wait until full cache reset (for single package). */ From bc631ee94d9ce36212dcb0e250036c3067f56d0d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 6 Jun 2022 12:05:02 +0000 Subject: [PATCH 035/240] chore(deps): update dependency @ls-lint/ls-lint to v1.11.2 (#15908) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index b9a9ef4697d837..f2ad67e2c1f61c 100644 --- a/package.json +++ b/package.json @@ -219,7 +219,7 @@ "@jest/globals": "27.5.1", "@jest/reporters": "27.5.1", "@jest/test-result": "27.5.1", - "@ls-lint/ls-lint": "1.11.1", + "@ls-lint/ls-lint": "1.11.2", "@openpgp/web-stream-tools": "0.0.10", "@renovate/eslint-plugin": "https://github.com/renovatebot/eslint-plugin#v0.0.4", "@semantic-release/exec": "6.0.3", diff --git a/yarn.lock b/yarn.lock index 2fd7f511acc7c8..5e070fcd25e8ad 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1641,10 +1641,10 @@ resolved "https://registry.yarnpkg.com/@kwsites/promise-deferred/-/promise-deferred-1.1.1.tgz#8ace5259254426ccef57f3175bc64ed7095ed919" integrity sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw== -"@ls-lint/ls-lint@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@ls-lint/ls-lint/-/ls-lint-1.11.1.tgz#e27d8772610bbbe7b1cc0e5dfd895d01bda8d8c8" - integrity sha512-RPGuchhS7mkupXwnHnSLyeuCitUvqam1BDngFNReWM67sZeyoAg538rOB6Btxk5cQKhqJAzeJQKB8ela4O+MKQ== +"@ls-lint/ls-lint@1.11.2": + version "1.11.2" + resolved "https://registry.yarnpkg.com/@ls-lint/ls-lint/-/ls-lint-1.11.2.tgz#fa7e8c404b7c2f9f7fe3e92b7d69fe37a15c0e1c" + integrity sha512-kX+CCjgNz+NHCaOcFyJLSBLRgAoyOxN18QFLpgucz5ILvbr60BGjwKaoPYTv/rBV/77L+Oz82lpP24mzJ2wGsQ== "@mattiasbuelens/web-streams-adapter@~0.1.0": version "0.1.0" From a5b0adb0cd79d6931a31586c879059553928a935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20=C5=81=C4=85giewka?= Date: Mon, 6 Jun 2022 15:46:28 +0200 Subject: [PATCH 036/240] docs: note gitPrivateKey passphrase-less requirement (#15871) --- docs/usage/self-hosted-configuration.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/usage/self-hosted-configuration.md b/docs/usage/self-hosted-configuration.md index 6b4a84336f5406..0ab15970d53771 100644 --- a/docs/usage/self-hosted-configuration.md +++ b/docs/usage/self-hosted-configuration.md @@ -363,6 +363,10 @@ To learn more about Git hooks, read the [Pro Git 2 book, section on Git Hooks](h This should be an armored private key, so the type you get from running `gpg --export-secret-keys --armor 92066A17F0D1707B4E96863955FEF5171C45FAE5 > private.key`. Replace the newlines with `\n` before adding the resulting single-line value to your bot's config. + +!!! note + The private key can't be protected with a passphrase if running in a headless environment. Renovate will not be able to handle entering the passphrase. + It will be loaded _lazily_. Before the first commit in a repository, Renovate will: From 50d4f1e7a5a1b0f1b4b4c228c8797b17f6994585 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 6 Jun 2022 14:29:39 +0000 Subject: [PATCH 037/240] chore(deps): update actions/setup-node action to v3.3.0 (#15911) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/build.yml | 6 +++--- .github/workflows/release-npm.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0a8ed7dd662591..c04941cbf2933c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -59,7 +59,7 @@ jobs: fetch-depth: 2 - name: Set up Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@17f8bd926464a1afa4c6a11669539e9c1ba77048 # tag=v3.2.0 + uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # tag=v3.3.0 with: node-version: ${{ env.NODE_VERSION }} cache: yarn @@ -105,7 +105,7 @@ jobs: fetch-depth: 2 - name: Set up Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@17f8bd926464a1afa4c6a11669539e9c1ba77048 # tag=v3.2.0 + uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # tag=v3.3.0 with: node-version: ${{ env.NODE_VERSION }} cache: yarn @@ -155,7 +155,7 @@ jobs: fetch-depth: 0 - name: Set up Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@17f8bd926464a1afa4c6a11669539e9c1ba77048 # tag=v3.2.0 + uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # tag=v3.3.0 with: node-version: ${{ env.NODE_VERSION }} cache: yarn diff --git a/.github/workflows/release-npm.yml b/.github/workflows/release-npm.yml index 6dbf76a3801d73..c79203ae203fb4 100644 --- a/.github/workflows/release-npm.yml +++ b/.github/workflows/release-npm.yml @@ -40,7 +40,7 @@ jobs: ref: ${{ env.GIT_SHA }} - name: Set up Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@17f8bd926464a1afa4c6a11669539e9c1ba77048 # tag=v3.2.0 + uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # tag=v3.3.0 with: node-version: ${{ env.NODE_VERSION }} cache: yarn From 143d72c6004d1d9099c51f6d35899bd9f9d25289 Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Mon, 6 Jun 2022 19:07:50 +0200 Subject: [PATCH 038/240] fix: Revert "refactor: runtime-config-narrowing" (#15915) Revert "refactor: runtime-config-narrowing (#15897)" This reverts commit a9a81275bf1fa40a4ba986601ab9fefd13fc9d41. --- lib/config/types.ts | 2 -- .../repository/extract/manager-files.ts | 19 +++---------------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/lib/config/types.ts b/lib/config/types.ts index ae24a89b6c310e..e49d86f2d5be65 100644 --- a/lib/config/types.ts +++ b/lib/config/types.ts @@ -228,8 +228,6 @@ export interface RenovateConfig fetchReleaseNotes?: boolean; secrets?: Record; - aliases?: Record; - skipInstalls?: boolean; } export interface AllConfig extends RenovateConfig, GlobalOnlyConfig {} diff --git a/lib/workers/repository/extract/manager-files.ts b/lib/workers/repository/extract/manager-files.ts index 5da2054742bfad..79a16b4543a348 100644 --- a/lib/workers/repository/extract/manager-files.ts +++ b/lib/workers/repository/extract/manager-files.ts @@ -6,26 +6,13 @@ import { extractPackageFile, get, } from '../../../modules/manager'; -import type { - ExtractConfig, - PackageFile, -} from '../../../modules/manager/types'; +import type { PackageFile } from '../../../modules/manager/types'; import { readLocalFile } from '../../../util/fs'; -function getExtractConfig(config: WorkerExtractConfig): ExtractConfig { - return { - npmrc: config.npmrc, - aliases: config.aliases, - skipInstalls: config.skipInstalls, - npmrcMerge: config.npmrcMerge, - }; -} - export async function getManagerPackageFiles( config: WorkerExtractConfig ): Promise { const { enabled, manager, fileList } = config; - const extractConfig = getExtractConfig(config); logger.trace(`getPackageFiles(${manager})`); if (!enabled) { logger.debug(`${manager} is disabled`); @@ -45,7 +32,7 @@ export async function getManagerPackageFiles( if (get(manager, 'extractAllPackageFiles')) { const allPackageFiles = await extractAllPackageFiles( manager, - extractConfig, + config, fileList ); if (allPackageFiles) { @@ -67,7 +54,7 @@ export async function getManagerPackageFiles( manager, content, packageFile, - extractConfig + config ); if (res) { for (let index = 0; index < res.deps.length; index += 1) { From 381481ace1fae9407a10295520643af4bfd4fca0 Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Tue, 7 Jun 2022 07:50:46 +0200 Subject: [PATCH 039/240] fix: log GHES version --- lib/modules/platform/github/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/modules/platform/github/index.ts b/lib/modules/platform/github/index.ts index 56cdd258561427..80b2911ee10a74 100644 --- a/lib/modules/platform/github/index.ts +++ b/lib/modules/platform/github/index.ts @@ -108,6 +108,9 @@ export async function detectGhe(token: string): Promise { ([k]) => k.toLowerCase() === gheHeaderKey ) ?? []; platformConfig.gheVersion = semver.valid(gheVersion as string) ?? null; + logger.debug( + `Detected GitHub Enterprise Server, version: ${platformConfig.gheVersion}` + ); } } From 561c08d5452685335e5d824672fa446c36304368 Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Tue, 7 Jun 2022 09:12:23 +0200 Subject: [PATCH 040/240] fix(github): filter vulnerability states only for >=3.5 (#15920) Closes #14431 --- lib/modules/platform/github/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/modules/platform/github/index.ts b/lib/modules/platform/github/index.ts index 80b2911ee10a74..31a92292d3116f 100644 --- a/lib/modules/platform/github/index.ts +++ b/lib/modules/platform/github/index.ts @@ -1564,7 +1564,7 @@ export async function getVulnerabilityAlerts(): Promise { // semver not null safe, accepts null and undefined // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion platformConfig.gheVersion!, - '~3.0.25 || ~3.1.17 || ~3.2.9 || >=3.3.4' + '>=3.5' ); const filterByState = !platformConfig.isGhe || gheSupportsStateFilter; const query = vulnerabilityAlertsQuery(filterByState); From d40a8a97459a66c6d0063ec7ebbe9174c4a8ea64 Mon Sep 17 00:00:00 2001 From: Johannes Feichtner Date: Tue, 7 Jun 2022 09:47:50 +0200 Subject: [PATCH 041/240] feat(manager/gradle): add support for registry URL interpolation and additional properties delimiters (#15903) --- lib/modules/manager/gradle/extract.spec.ts | 61 ++++++++++++++++++++-- lib/modules/manager/gradle/parser.spec.ts | 44 +++++++++------- lib/modules/manager/gradle/parser.ts | 40 +++++++++++--- 3 files changed, 115 insertions(+), 30 deletions(-) diff --git a/lib/modules/manager/gradle/extract.spec.ts b/lib/modules/manager/gradle/extract.spec.ts index d1ebe3cea1353c..22f0f566302412 100644 --- a/lib/modules/manager/gradle/extract.spec.ts +++ b/lib/modules/manager/gradle/extract.spec.ts @@ -1,4 +1,5 @@ -import { fs, loadFixture } from '../../../../test/util'; +import { Fixtures } from '../../../../test/fixtures'; +import { fs } from '../../../../test/util'; import type { ExtractConfig } from '../types'; import { extractAllPackageFiles } from '.'; @@ -191,8 +192,60 @@ describe('modules/manager/gradle/extract', () => { ]); }); + it('interpolates repository URLs', async () => { + const buildFile = ` + repositories { + mavenCentral() + maven { + url = "\${repositoryBaseURL}/repository-build" + } + } + + dependencies { + implementation "com.google.protobuf:protobuf-java:2.17.0" + } + `; + + mockFs({ + 'build.gradle': buildFile, + 'gradle.properties': 'repositoryBaseURL: https://dummy.org/whatever', + }); + + const res = await extractAllPackageFiles({} as ExtractConfig, [ + 'build.gradle', + 'gradle.properties', + ]); + + expect(res).toMatchObject([ + { + packageFile: 'gradle.properties', + datasource: 'maven', + deps: [], + }, + { + packageFile: 'build.gradle', + datasource: 'maven', + deps: [ + { + depName: 'com.google.protobuf:protobuf-java', + currentValue: '2.17.0', + managerData: { + fileReplacePosition: 227, + packageFile: 'build.gradle', + }, + fileReplacePosition: 227, + registryUrls: [ + 'https://repo.maven.apache.org/maven2', + 'https://dummy.org/whatever/repository-build', + ], + }, + ], + }, + ]); + }); + it('works with dependency catalogs', async () => { - const tomlFile = loadFixture('1/libs.versions.toml'); + const tomlFile = Fixtures.get('1/libs.versions.toml'); const fsMock = { 'gradle/libs.versions.toml': tomlFile, }; @@ -315,7 +368,7 @@ describe('modules/manager/gradle/extract', () => { }); it("can run Javier's example", async () => { - const tomlFile = loadFixture('2/libs.versions.toml'); + const tomlFile = Fixtures.get('2/libs.versions.toml'); const fsMock = { 'gradle/libs.versions.toml': tomlFile, }; @@ -507,7 +560,7 @@ describe('modules/manager/gradle/extract', () => { }); it('should change the dependency version not the comment version', async () => { - const tomlFile = loadFixture('3/libs.versions.toml'); + const tomlFile = Fixtures.get('3/libs.versions.toml'); const fsMock = { 'gradle/libs.versions.toml': tomlFile, }; diff --git a/lib/modules/manager/gradle/parser.spec.ts b/lib/modules/manager/gradle/parser.spec.ts index d33ed1ee31d924..79d660d319f836 100644 --- a/lib/modules/manager/gradle/parser.spec.ts +++ b/lib/modules/manager/gradle/parser.spec.ts @@ -1,4 +1,4 @@ -import { loadFixture } from '../../../../test/util'; +import { Fixtures } from '../../../../test/fixtures'; import { GOOGLE_REPO, GRADLE_PLUGIN_PORTAL_REPO, @@ -105,23 +105,29 @@ describe('modules/manager/gradle/parser', () => { describe('registryUrls', () => { test.each` - input | url - ${'url ""'} | ${null} - ${'url "#!@"'} | ${null} - ${'url "https://example.com"'} | ${'https://example.com'} - ${'url("https://example.com")'} | ${'https://example.com'} - ${'mavenCentral()'} | ${MAVEN_REPO} - ${'jcenter()'} | ${JCENTER_REPO} - ${'google()'} | ${GOOGLE_REPO} - ${'google { content { includeGroup "foo" } }'} | ${GOOGLE_REPO} - ${'gradlePluginPortal()'} | ${GRADLE_PLUGIN_PORTAL_REPO} - ${'maven("https://foo.bar/baz/qux")'} | ${'https://foo.bar/baz/qux'} - ${'maven { url = uri("https://foo.bar/baz")'} | ${'https://foo.bar/baz'} - ${"maven { url 'https://foo.bar/baz'"} | ${'https://foo.bar/baz'} - ${"maven { url = 'https://foo.bar/baz'"} | ${'https://foo.bar/baz'} - `('$input', ({ input, url }) => { + def | input | url + ${''} | ${'url ""'} | ${null} + ${''} | ${'url "#!@"'} | ${null} + ${''} | ${'url "https://example.com"'} | ${'https://example.com'} + ${'base="https://foo.bar"'} | ${'url "${base}/baz"'} | ${'https://foo.bar/baz'} + ${''} | ${'url("https://example.com")'} | ${'https://example.com'} + ${'base="https://foo.bar"'} | ${'url("${base}/baz")'} | ${'https://foo.bar/baz'} + ${''} | ${'mavenCentral()'} | ${MAVEN_REPO} + ${''} | ${'jcenter()'} | ${JCENTER_REPO} + ${''} | ${'google()'} | ${GOOGLE_REPO} + ${''} | ${'google { content { includeGroup "foo" } }'} | ${GOOGLE_REPO} + ${''} | ${'gradlePluginPortal()'} | ${GRADLE_PLUGIN_PORTAL_REPO} + ${''} | ${'maven("https://foo.bar/baz/qux")'} | ${'https://foo.bar/baz/qux'} + ${'base="https://foo.bar"'} | ${'maven("${base}/baz/qux")'} | ${'https://foo.bar/baz/qux'} + ${''} | ${'maven { url = uri("https://foo.bar/baz")'} | ${'https://foo.bar/baz'} + ${'base="https://foo.bar"'} | ${'maven { url = uri("${base}/baz")'} | ${'https://foo.bar/baz'} + ${''} | ${"maven { url 'https://foo.bar/baz'"} | ${'https://foo.bar/baz'} + ${'base="https://foo.bar"'} | ${'maven { url "${base}/baz"'} | ${'https://foo.bar/baz'} + ${''} | ${"maven { url = 'https://foo.bar/baz'"} | ${'https://foo.bar/baz'} + ${'base="https://foo.bar"'} | ${'maven { url = "${base}/baz"'} | ${'https://foo.bar/baz'} + `('$def | $input', ({ def, input, url }) => { const expected = [url].filter(Boolean); - const { urls } = parseGradle(input); + const { urls } = parseGradle([def, input].join('\n')); expect(urls).toStrictEqual(expected); }); }); @@ -138,7 +144,7 @@ describe('modules/manager/gradle/parser', () => { }); it('parses fixture from "gradle" manager', () => { - const content = loadFixture('build.gradle.example1'); + const content = Fixtures.get('build.gradle.example1'); const { deps } = parseGradle(content, {}, 'build.gradle'); const replacementIndices = deps.map(({ managerData, currentValue }) => content.slice(managerData.fileReplacePosition).indexOf(currentValue) @@ -154,6 +160,8 @@ describe('modules/manager/gradle/parser', () => { ${'foo=bar'} | ${'foo'} | ${'bar'} | ${4} ${' foo = bar '} | ${'foo'} | ${'bar'} | ${7} ${'foo.bar=baz'} | ${'foo.bar'} | ${'baz'} | ${8} + ${'foo.bar:baz'} | ${'foo.bar'} | ${'baz'} | ${8} + ${'foo.bar baz'} | ${'foo.bar'} | ${'baz'} | ${8} `('$input', ({ input, key, value, fileReplacePosition }) => { expect(parseProps(input)).toMatchObject({ vars: { [key]: { key, value, fileReplacePosition } }, diff --git a/lib/modules/manager/gradle/parser.ts b/lib/modules/manager/gradle/parser.ts index 3a8c45399cc2fd..6ecb2daf9d2eb6 100644 --- a/lib/modules/manager/gradle/parser.ts +++ b/lib/modules/manager/gradle/parser.ts @@ -278,8 +278,14 @@ function processPlugin({ function processCustomRegistryUrl({ tokenMap, + variables, }: SyntaxHandlerInput): SyntaxHandlerOutput { - const registryUrl = tokenMap.registryUrl?.value; + let registryUrl: string | null = tokenMap.registryUrl?.value; + if (tokenMap.registryUrl?.type === TokenType.StringInterpolation) { + const token = tokenMap.registryUrl as StringInterpolation; + registryUrl = interpolateString(token.children, variables); + } + try { if (registryUrl) { const { host, protocol } = url.parse(registryUrl); @@ -530,7 +536,10 @@ const matcherConfigs: SyntaxMatchConfig[] = [ matchValue: 'maven', }, { matchType: TokenType.LeftParen }, - { matchType: TokenType.String, tokenMapKey: 'registryUrl' }, + { + matchType: [TokenType.String, TokenType.StringInterpolation], + tokenMapKey: 'registryUrl', + }, { matchType: TokenType.RightParen }, endOfInstruction, ], @@ -549,7 +558,10 @@ const matcherConfigs: SyntaxMatchConfig[] = [ matchValue: 'url', }, { matchType: TokenType.Assignment }, - { matchType: TokenType.String, tokenMapKey: 'registryUrl' }, + { + matchType: [TokenType.String, TokenType.StringInterpolation], + tokenMapKey: 'registryUrl', + }, endOfInstruction, ], handler: processCustomRegistryUrl, @@ -572,7 +584,10 @@ const matcherConfigs: SyntaxMatchConfig[] = [ matchValue: 'uri', }, { matchType: TokenType.LeftParen }, - { matchType: TokenType.String, tokenMapKey: 'registryUrl' }, + { + matchType: [TokenType.String, TokenType.StringInterpolation], + tokenMapKey: 'registryUrl', + }, { matchType: TokenType.RightParen }, endOfInstruction, ], @@ -590,7 +605,10 @@ const matcherConfigs: SyntaxMatchConfig[] = [ matchType: TokenType.Word, matchValue: 'url', }, - { matchType: TokenType.String, tokenMapKey: 'registryUrl' }, + { + matchType: [TokenType.String, TokenType.StringInterpolation], + tokenMapKey: 'registryUrl', + }, endOfInstruction, ], handler: processCustomRegistryUrl, @@ -599,7 +617,10 @@ const matcherConfigs: SyntaxMatchConfig[] = [ // url 'https://repo.spring.io/snapshot/' matchers: [ { matchType: TokenType.Word, matchValue: ['uri', 'url'] }, - { matchType: TokenType.String, tokenMapKey: 'registryUrl' }, + { + matchType: [TokenType.String, TokenType.StringInterpolation], + tokenMapKey: 'registryUrl', + }, endOfInstruction, ], handler: processCustomRegistryUrl, @@ -609,7 +630,10 @@ const matcherConfigs: SyntaxMatchConfig[] = [ matchers: [ { matchType: TokenType.Word, matchValue: ['uri', 'url'] }, { matchType: TokenType.LeftParen }, - { matchType: TokenType.String, tokenMapKey: 'registryUrl' }, + { + matchType: [TokenType.String, TokenType.StringInterpolation], + tokenMapKey: 'registryUrl', + }, { matchType: TokenType.RightParen }, endOfInstruction, ], @@ -895,7 +919,7 @@ export function parseGradle( const propWord = '[a-zA-Z_][a-zA-Z0-9_]*(?:\\.[a-zA-Z_][a-zA-Z0-9_]*)*'; const propRegex = regEx( - `^(?\\s*(?${propWord})\\s*=\\s*['"]?)(?[^\\s'"]+)['"]?\\s*$` + `^(?\\s*(?${propWord})\\s*[= :]\\s*['"]?)(?[^\\s'"]+)['"]?\\s*$` ); export function parseProps( From ea8ab7ca22bb850d5a58411bad579aa5158c16c6 Mon Sep 17 00:00:00 2001 From: Gabriel-Ladzaretti <97394622+Gabriel-Ladzaretti@users.noreply.github.com> Date: Tue, 7 Jun 2022 11:19:08 +0300 Subject: [PATCH 042/240] fix(dashboard): undefined currentValue (#15917) --- .../__fixtures__/package-files-digest.json | 42 +++++++++++++++++++ .../dependency-dashboard.spec.ts.snap | 40 ++++++++++++++++++ .../repository/dependency-dashboard.spec.ts | 14 +++++++ lib/workers/repository/package-files.ts | 11 ++++- 4 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 lib/workers/repository/__fixtures__/package-files-digest.json diff --git a/lib/workers/repository/__fixtures__/package-files-digest.json b/lib/workers/repository/__fixtures__/package-files-digest.json new file mode 100644 index 00000000000000..daa16bee354c14 --- /dev/null +++ b/lib/workers/repository/__fixtures__/package-files-digest.json @@ -0,0 +1,42 @@ +{ + "dockerfile": [ + { + "packageFile": "ver-and-digest/Dockerfile", + "deps": [ + { + "depName": "ubuntu", + "currentValue": "18.04", + "currentDigest": "sha256:a7ed45c4a95fbe19f9c5fb9d1ca58b2431b2a4984754be2f50ccec99d9428b79" + } + ] + }, + { + "packageFile": "no-ver-no-digest/Dockerfile", + "deps": [ + { + "depName": "ubuntu", + "replaceString": "ubuntu", + "skipReason": "invalid-value" + } + ] + }, + { + "packageFile": "ver-only/Dockerfile", + "deps": [ + { + "depName": "ubuntu", + "currentValue": "20.04" + } + ] + }, + { + "packageFile": "digest-only/Dockerfile", + "deps": [ + { + "depName": "ubuntu", + "currentDigest": "sha256:06b5d30fabc1fc574f2ecab87375692299d45f8f190d9b71f512deb494114e1f" + } + ] + } + ] +} diff --git a/lib/workers/repository/__snapshots__/dependency-dashboard.spec.ts.snap b/lib/workers/repository/__snapshots__/dependency-dashboard.spec.ts.snap index 0b9db9fe45078f..c6409f13eed631 100644 --- a/lib/workers/repository/__snapshots__/dependency-dashboard.spec.ts.snap +++ b/lib/workers/repository/__snapshots__/dependency-dashboard.spec.ts.snap @@ -319,6 +319,46 @@ None detected " `; +exports[`workers/repository/dependency-dashboard ensureDependencyDashboard() checks detected dependencies section single base branch repo shows different combinations of version+digest for a given dependency 1`] = ` +"This issue provides visibility into Renovate updates and their statuses. [Learn more](https://docs.renovatebot.com/key-concepts/dashboard/) + +This repository currently has no open or pending branches. + +## Detected dependencies + +
dockerfile +
+ +
ver-and-digest/Dockerfile + + - \`ubuntu 18.04@sha256:a7ed45c4a95fbe19f9c5fb9d1ca58b2431b2a4984754be2f50ccec99d9428b79\` + +
+ +
no-ver-no-digest/Dockerfile + + - \`ubuntu no version found\` + +
+ +
ver-only/Dockerfile + + - \`ubuntu 20.04\` + +
+ +
digest-only/Dockerfile + + - \`ubuntu sha256:06b5d30fabc1fc574f2ecab87375692299d45f8f190d9b71f512deb494114e1f\` + +
+ +
+
+ +" +`; + exports[`workers/repository/dependency-dashboard ensureDependencyDashboard() contains logged problems 1`] = ` "This issue provides visibility into Renovate updates and their statuses. [Learn more](https://docs.renovatebot.com/key-concepts/dashboard/) diff --git a/lib/workers/repository/dependency-dashboard.spec.ts b/lib/workers/repository/dependency-dashboard.spec.ts index 27813342157a5f..0c7d8e61c945af 100644 --- a/lib/workers/repository/dependency-dashboard.spec.ts +++ b/lib/workers/repository/dependency-dashboard.spec.ts @@ -558,6 +558,9 @@ describe('workers/repository/dependency-dashboard', () => { describe('checks detected dependencies section', () => { const packageFiles = Fixtures.getJson('./package-files.json'); + const packageFilesWithDigest = Fixtures.getJson( + './package-files-digest.json' + ); let config: RenovateConfig; beforeAll(() => { @@ -608,6 +611,17 @@ describe('workers/repository/dependency-dashboard', () => { // same with dry run await dryRun(branches, platform); }); + + it('shows different combinations of version+digest for a given dependency', async () => { + const branches: BranchConfig[] = []; + PackageFiles.add('main', packageFilesWithDigest); + await dependencyDashboard.ensureDependencyDashboard(config, branches); + expect(platform.ensureIssue).toHaveBeenCalledTimes(1); + expect(platform.ensureIssue.mock.calls[0][0].body).toMatchSnapshot(); + + // same with dry run + await dryRun(branches, platform); + }); }); describe('multi base branch repo', () => { diff --git a/lib/workers/repository/package-files.ts b/lib/workers/repository/package-files.ts index c86553a830fe8c..23a492e1a57b45 100644 --- a/lib/workers/repository/package-files.ts +++ b/lib/workers/repository/package-files.ts @@ -46,12 +46,21 @@ export class PackageFiles { deps += pad ? '\n\n\n' : ''; continue; } + + const placeHolder = `no version found`; + for (const manager of managers) { deps += `
${manager}\n
\n\n`; for (const packageFile of packageFiles[manager]) { deps += `
${packageFile.packageFile}\n\n`; for (const dep of packageFile.deps) { - deps += ` - \`${dep.depName} ${dep.currentValue}\`\n`; + const ver = dep.currentValue; + const digest = dep.currentDigest; + const version = + ver && digest + ? `${ver}@${digest}` + : `${digest ?? ver ?? placeHolder}`; + deps += ` - \`${dep.depName} ${version}\`\n`; } deps += '\n
\n\n'; } From f35048f9df57571c6bf05fa7ee1ded301e2c825f Mon Sep 17 00:00:00 2001 From: Gabriel-Ladzaretti <97394622+Gabriel-Ladzaretti@users.noreply.github.com> Date: Tue, 7 Jun 2022 11:52:50 +0300 Subject: [PATCH 043/240] feat(preset): Replacement presets for Material-UI (#15825) --- .../internal/auto-generate-replacements.ts | 51 +++++++++++++++++++ lib/config/presets/internal/replacements.ts | 46 ++++++++++++----- 2 files changed, 84 insertions(+), 13 deletions(-) create mode 100644 lib/config/presets/internal/auto-generate-replacements.ts diff --git a/lib/config/presets/internal/auto-generate-replacements.ts b/lib/config/presets/internal/auto-generate-replacements.ts new file mode 100644 index 00000000000000..688449e93b6f43 --- /dev/null +++ b/lib/config/presets/internal/auto-generate-replacements.ts @@ -0,0 +1,51 @@ +import type { PackageRule } from '../../types'; +import type { Preset } from '../types'; + +export type Replacement = [string[], string]; + +export interface AutoPackageRules { + matchCurrentVersion: string; + matchDatasources: string[]; + replacements: Replacement[]; + replacementVersion: string; +} + +export interface PresetTemplate { + title: string; + description: string; + packageRules: AutoPackageRules; +} + +function generatePackageRules({ + matchCurrentVersion, + matchDatasources, + replacements, + replacementVersion, +}: AutoPackageRules): PackageRule[] { + const rules: PackageRule[] = []; + for (const replacement of replacements) { + const [matchPackageNames, replacementName] = replacement; + rules.push({ + matchCurrentVersion, + matchDatasources, + matchPackageNames, + replacementName, + replacementVersion, + }); + } + return rules; +} + +export function addPresets( + presets: Record, + template: PresetTemplate +): void { + const { title, description, packageRules } = template; + presets[title] = { + description, + packageRules: generatePackageRules(packageRules), + }; + const ext = presets.all?.extends ?? []; + ext.push(`replacements:${title}`); + ext.sort(); +} diff --git a/lib/config/presets/internal/replacements.ts b/lib/config/presets/internal/replacements.ts index ae2d0f90478f64..a6ff5d047663bc 100644 --- a/lib/config/presets/internal/replacements.ts +++ b/lib/config/presets/internal/replacements.ts @@ -1,4 +1,9 @@ import type { Preset } from '../types'; +import { + PresetTemplate, + Replacement, + addPresets, +} from './auto-generate-replacements'; /* eslint sort-keys: ["error", "asc", {"caseSensitive": false, "natural": true}] */ export const presets: Record = { @@ -11,7 +16,6 @@ export const presets: Record = { 'replacements:jade-to-pug', 'replacements:joi-to-scoped', 'replacements:joi-to-unscoped', - 'replacements:material-ui-to-mui', 'replacements:renovate-pep440-to-renovatebot-pep440', 'replacements:rollup-node-resolve-to-scoped', 'replacements:xmldom-to-scoped', @@ -87,18 +91,6 @@ export const presets: Record = { }, ], }, - 'material-ui-to-mui': { - description: 'the @material-ui/core monorepo was renamed to @mui/material', - packageRules: [ - { - matchCurrentVersion: '>=4.0.0 <5.0.0', - matchDatasources: ['npm'], - matchPackageNames: ['@material-ui/core'], - replacementName: '@mui/material', - replacementVersion: '5.0.0', - }, - ], - }, 'redux-devtools-extension-to-scope': { description: 'the redux-devtools-extension package was renamed to @redux-devtools/extension', @@ -146,3 +138,31 @@ export const presets: Record = { ], }, }; + +const muiReplacement: Replacement[] = [ + [['@material-ui/codemod'], '@mui/codemod'], + [['@material-ui/core'], '@mui/material'], + [['@material-ui/icons'], '@mui/icons-material'], + [['@material-ui/lab'], '@mui/labs'], + [['@material-ui/private-theming'], '@mui/private-theming'], + [['@material-ui/styled-engine'], '@mui/styled-engine'], + [['@material-ui/styled-engine-sc'], '@mui/styled-engine-sc'], + [['@material-ui/styles'], '@mui/styles'], + [['@material-ui/system'], '@mui/system'], + [['@material-ui/types'], '@mui/types'], + [['@material-ui/unstyled'], '@mui/core'], +]; + +const mui: PresetTemplate = { + description: + 'the material-ui monorepo org was renamed from @material-ui to @mui/', + packageRules: { + matchCurrentVersion: '>=4.0.0 <5.0.0', + matchDatasources: ['npm'], + replacements: muiReplacement, + replacementVersion: '5.0.0', + }, + title: 'material-ui-to-mui', +}; + +addPresets(presets, mui); From a10e4ce91560bdf87389c2a502b013598ee6f8de Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Tue, 7 Jun 2022 13:33:51 +0200 Subject: [PATCH 044/240] fix: set global config before validating local presets (#15926) --- lib/workers/global/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/workers/global/index.ts b/lib/workers/global/index.ts index 9354be86d85fe1..f88d724791eee3 100644 --- a/lib/workers/global/index.ts +++ b/lib/workers/global/index.ts @@ -118,6 +118,9 @@ export async function start(): Promise { // initialize all submodules config = await globalInitialize(config); + // Set platform and endpoint in case local presets are used + GlobalConfig.set({ platform: config.platform, endpoint: config.endpoint }); + await validatePresets(config); checkEnv(); From 4aa9a6c3e600e05a07e08fa9b159bc7e9d067607 Mon Sep 17 00:00:00 2001 From: Gabriel-Ladzaretti <97394622+Gabriel-Ladzaretti@users.noreply.github.com> Date: Tue, 7 Jun 2022 19:06:38 +0300 Subject: [PATCH 045/240] docs: add per manager known list of issues (#15791) --- tools/docs/github-query-items.ts | 16 +++++ tools/docs/manager.ts | 111 +++++++++++++++++++++++++++++++ 2 files changed, 127 insertions(+) create mode 100644 tools/docs/github-query-items.ts diff --git a/tools/docs/github-query-items.ts b/tools/docs/github-query-items.ts new file mode 100644 index 00000000000000..f9668ce59bbe18 --- /dev/null +++ b/tools/docs/github-query-items.ts @@ -0,0 +1,16 @@ +export type GithubApiQueryResponse = { + total_count: number; + incomplete_results: boolean; + items: ItemsEntity[]; +}; + +export type ItemsEntity = { + html_url: string; + number: number; + title: string; + labels: LabelsEntity[]; +}; + +export type LabelsEntity = { + name: string; +}; diff --git a/tools/docs/manager.ts b/tools/docs/manager.ts index b8bb426982b174..bbf6ce0a420209 100644 --- a/tools/docs/manager.ts +++ b/tools/docs/manager.ts @@ -1,8 +1,20 @@ +import { DateTime } from 'luxon'; import type { RenovateConfig } from '../../lib/config/types'; +import { logger } from '../../lib/logger'; import { getManagers } from '../../lib/modules/manager'; +import { GithubHttp } from '../../lib/util/http/github'; +import { getQueryString } from '../../lib/util/url'; import { readFile, updateFile } from '../utils'; +import type { GithubApiQueryResponse, ItemsEntity } from './github-query-items'; import { getDisplayName, getNameWithUrl, replaceContent } from './utils'; +const gitHubApiUrl = 'https://api.github.com/search/issues?'; + +interface ManagerIssues { + bugs: ItemsEntity[]; + features: ItemsEntity[]; +} + function getTitle(manager: string, displayName: string): string { if (manager === 'regex') { return `Custom Manager Support using Regex`; @@ -14,8 +26,84 @@ function getManagerLink(manager: string): string { return `[\`${manager}\`](${manager}/)`; } +function stringifyIssues(items: ItemsEntity[]): [string, number] { + if (!items) { + return ['', 0]; + } + let list = ''; + for (const item of items) { + list += ` - ${item.title} [#${item.number}](${item.html_url})\n`; + } + return [list, items.length]; +} + +function extractIssues( + managerIssuesMap: Record, + items: ItemsEntity[] +): void { + if (!items || !managerIssuesMap) { + return; + } + for (const item of items) { + const type = item.labels + .find((l) => l.name.startsWith('type:')) + ?.name.split(':')[1]; + if (!type) { + continue; + } + const manager = item.labels + .find((l) => l.name.startsWith('manager:')) + ?.name.split(':')[1]; + if (!manager) { + continue; + } + if (!managerIssuesMap[manager]) { + managerIssuesMap[manager] = { bugs: [], features: [] }; + } + switch (type) { + case 'bug': + managerIssuesMap[manager].bugs.push(item); + break; + case 'feature': + managerIssuesMap[manager].features.push(item); + break; + default: + break; + } + } +} + +export async function getManagersGitHubIssues(): Promise< + Record +> { + const q = `repo:renovatebot/renovate type:issue is:open -label:priority-5-triage`; + const per_page = 100; + const managerIssuesMap: Record = {}; + const githubApi = new GithubHttp('manager-issues'); + try { + const query = getQueryString({ q, per_page }); + const res = await githubApi.getJson( + gitHubApiUrl + query, + { + paginationField: 'items', + paginate: true, + } + ); + const items = res.body?.items ?? []; + extractIssues( + managerIssuesMap, + items.sort((a, b) => a.number - b.number) + ); + } catch (err) { + logger.error({ err }, 'Error getting query results'); + throw err; + } + return managerIssuesMap; +} + export async function generateManagers(dist: string): Promise { const managers = getManagers(); + const managerIssuesMap = await getManagersGitHubIssues(); const allLanguages: Record = {}; for (const [manager, definition] of managers) { const language = definition.language ?? 'other'; @@ -73,6 +161,29 @@ sidebar_label: ${displayName} } md += managerReadmeContent + '\n\n'; + const [featureList] = stringifyIssues(managerIssuesMap[manager]?.features); + if (featureList) { + md += '## Open feature requests\n\n'; + md += featureList; + md += '\n'; + } + + const [bugList] = stringifyIssues(managerIssuesMap[manager]?.bugs); + if (bugList) { + md += '## Open bug reports\n\n'; + md += bugList; + md += '\n'; + } + + if (featureList || bugList) { + const now = DateTime.utc().toFormat('MMMM dd, yyyy'); + const lists = `list of ${featureList ? 'features' : ''}${ + featureList && bugList ? ' and ' : '' + }${bugList ? 'bugs' : ''}`; + md += '\n\n'; + md += `The above ${lists} were current when this page was generated on ${now}.\n`; + } + await updateFile(`${dist}/modules/manager/${manager}/index.md`, md); } const languages = Object.keys(allLanguages).filter( From 9c2ee2d55cf39a763cfec773a2f33f55334cf768 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 7 Jun 2022 21:59:09 +0000 Subject: [PATCH 046/240] chore(deps): update dependency @types/node to v16.11.38 (#15931) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index f2ad67e2c1f61c..f642e7a3fbe7eb 100644 --- a/package.json +++ b/package.json @@ -247,7 +247,7 @@ "@types/marshal": "0.5.1", "@types/moo": "0.5.5", "@types/nock": "10.0.3", - "@types/node": "16.11.36", + "@types/node": "16.11.38", "@types/parse-link-header": "2.0.0", "@types/semver": "7.3.9", "@types/semver-stable": "3.0.0", diff --git a/yarn.lock b/yarn.lock index 5e070fcd25e8ad..6c9131741dd778 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2598,10 +2598,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.40.tgz#76ee88ae03650de8064a6cf75b8d95f9f4a16090" integrity sha512-UXdBxNGqTMtm7hCwh9HtncFVLrXoqA3oJW30j6XWp5BH/wu3mVeaxo7cq5benFdBw34HB3XDT2TRPI7rXZ+mDg== -"@types/node@16.11.36": - version "16.11.36" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.36.tgz#9ab9f8276987132ed2b225cace2218ba794fc751" - integrity sha512-FR5QJe+TaoZ2GsMHkjuwoNabr+UrJNRr2HNOo+r/7vhcuntM6Ee/pRPOnRhhL2XE9OOvX9VLEq+BcXl3VjNoWA== +"@types/node@16.11.38": + version "16.11.38" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.38.tgz#be0edd097b23eace6c471c525a74b3f98803017f" + integrity sha512-hjO/0K140An3GWDw2HJfq7gko3wWeznbjXgg+rzPdVzhe198hp4x2i1dgveAOEiFKd8sOilAxzoSJiVv5P/CUg== "@types/node@^13.7.0": version "13.13.52" From 15e349540e6da8917d15ca1f60c48e2b974d1a86 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 7 Jun 2022 22:11:54 +0000 Subject: [PATCH 047/240] chore(deps): update node.js to 0f29671 (#15930) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .devcontainer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 5225a1b6bd8aa0..317f44854f124a 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM containerbase/node:14.19.3@sha256:d2020d09554fff425904cb6165271b7411cfe2cf39b7b3509ba395e8dd8b6e85 +FROM containerbase/node:14.19.3@sha256:0f29671cfd515e27ab91c69c3221f38c1db5859e60185bf137a192eb818a42c0 USER root From 13d59ede850d2e47d7885021313440d663868d9f Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Wed, 8 Jun 2022 09:43:05 +0200 Subject: [PATCH 048/240] chore: Revert "docs: add per manager known list of issues" (#15936) --- tools/docs/github-query-items.ts | 16 ----- tools/docs/manager.ts | 111 ------------------------------- 2 files changed, 127 deletions(-) delete mode 100644 tools/docs/github-query-items.ts diff --git a/tools/docs/github-query-items.ts b/tools/docs/github-query-items.ts deleted file mode 100644 index f9668ce59bbe18..00000000000000 --- a/tools/docs/github-query-items.ts +++ /dev/null @@ -1,16 +0,0 @@ -export type GithubApiQueryResponse = { - total_count: number; - incomplete_results: boolean; - items: ItemsEntity[]; -}; - -export type ItemsEntity = { - html_url: string; - number: number; - title: string; - labels: LabelsEntity[]; -}; - -export type LabelsEntity = { - name: string; -}; diff --git a/tools/docs/manager.ts b/tools/docs/manager.ts index bbf6ce0a420209..b8bb426982b174 100644 --- a/tools/docs/manager.ts +++ b/tools/docs/manager.ts @@ -1,20 +1,8 @@ -import { DateTime } from 'luxon'; import type { RenovateConfig } from '../../lib/config/types'; -import { logger } from '../../lib/logger'; import { getManagers } from '../../lib/modules/manager'; -import { GithubHttp } from '../../lib/util/http/github'; -import { getQueryString } from '../../lib/util/url'; import { readFile, updateFile } from '../utils'; -import type { GithubApiQueryResponse, ItemsEntity } from './github-query-items'; import { getDisplayName, getNameWithUrl, replaceContent } from './utils'; -const gitHubApiUrl = 'https://api.github.com/search/issues?'; - -interface ManagerIssues { - bugs: ItemsEntity[]; - features: ItemsEntity[]; -} - function getTitle(manager: string, displayName: string): string { if (manager === 'regex') { return `Custom Manager Support using Regex`; @@ -26,84 +14,8 @@ function getManagerLink(manager: string): string { return `[\`${manager}\`](${manager}/)`; } -function stringifyIssues(items: ItemsEntity[]): [string, number] { - if (!items) { - return ['', 0]; - } - let list = ''; - for (const item of items) { - list += ` - ${item.title} [#${item.number}](${item.html_url})\n`; - } - return [list, items.length]; -} - -function extractIssues( - managerIssuesMap: Record, - items: ItemsEntity[] -): void { - if (!items || !managerIssuesMap) { - return; - } - for (const item of items) { - const type = item.labels - .find((l) => l.name.startsWith('type:')) - ?.name.split(':')[1]; - if (!type) { - continue; - } - const manager = item.labels - .find((l) => l.name.startsWith('manager:')) - ?.name.split(':')[1]; - if (!manager) { - continue; - } - if (!managerIssuesMap[manager]) { - managerIssuesMap[manager] = { bugs: [], features: [] }; - } - switch (type) { - case 'bug': - managerIssuesMap[manager].bugs.push(item); - break; - case 'feature': - managerIssuesMap[manager].features.push(item); - break; - default: - break; - } - } -} - -export async function getManagersGitHubIssues(): Promise< - Record -> { - const q = `repo:renovatebot/renovate type:issue is:open -label:priority-5-triage`; - const per_page = 100; - const managerIssuesMap: Record = {}; - const githubApi = new GithubHttp('manager-issues'); - try { - const query = getQueryString({ q, per_page }); - const res = await githubApi.getJson( - gitHubApiUrl + query, - { - paginationField: 'items', - paginate: true, - } - ); - const items = res.body?.items ?? []; - extractIssues( - managerIssuesMap, - items.sort((a, b) => a.number - b.number) - ); - } catch (err) { - logger.error({ err }, 'Error getting query results'); - throw err; - } - return managerIssuesMap; -} - export async function generateManagers(dist: string): Promise { const managers = getManagers(); - const managerIssuesMap = await getManagersGitHubIssues(); const allLanguages: Record = {}; for (const [manager, definition] of managers) { const language = definition.language ?? 'other'; @@ -161,29 +73,6 @@ sidebar_label: ${displayName} } md += managerReadmeContent + '\n\n'; - const [featureList] = stringifyIssues(managerIssuesMap[manager]?.features); - if (featureList) { - md += '## Open feature requests\n\n'; - md += featureList; - md += '\n'; - } - - const [bugList] = stringifyIssues(managerIssuesMap[manager]?.bugs); - if (bugList) { - md += '## Open bug reports\n\n'; - md += bugList; - md += '\n'; - } - - if (featureList || bugList) { - const now = DateTime.utc().toFormat('MMMM dd, yyyy'); - const lists = `list of ${featureList ? 'features' : ''}${ - featureList && bugList ? ' and ' : '' - }${bugList ? 'bugs' : ''}`; - md += '\n\n'; - md += `The above ${lists} were current when this page was generated on ${now}.\n`; - } - await updateFile(`${dist}/modules/manager/${manager}/index.md`, md); } const languages = Object.keys(allLanguages).filter( From 956a94da24a3f2a2125b5f84172347356a33c211 Mon Sep 17 00:00:00 2001 From: Gregor Dschung Date: Wed, 8 Jun 2022 13:56:20 +0200 Subject: [PATCH 049/240] docs(schedule): add note regarding the relation to the dependency dashboard (#15941) --- docs/usage/configuration-options.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index 480458356dc7a4..91c5c11c0b65b2 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -2584,6 +2584,10 @@ Read the parser documentation at [breejs.github.io/later/parsers.html#text](http To parse Cron syntax, Renovate uses [@cheap-glitch/mi-cron](https://github.com/cheap-glitch/mi-cron). Renovate does not support scheduled minutes or "at an exact time" granularity. + +!!! note + Actions triggered via the [Dependency Dashboard](https://docs.renovatebot.com/configuration-options/#dependencydashboard) are not restricted by a configured schedule. + ## semanticCommitScope By default you will see Angular-style commit prefixes like `"chore(deps):"`. From d78b45a14d83296d0a7d0f4a22f69c8f5fb269f4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 8 Jun 2022 18:54:18 +0000 Subject: [PATCH 050/240] chore(deps): update dependency @types/jest to v27.5.2 (#15952) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index f642e7a3fbe7eb..ead5615d824cb7 100644 --- a/package.json +++ b/package.json @@ -237,7 +237,7 @@ "@types/github-url-from-git": "1.5.1", "@types/global-agent": "2.1.1", "@types/ini": "1.3.31", - "@types/jest": "27.5.1", + "@types/jest": "27.5.2", "@types/js-yaml": "4.0.5", "@types/json-dup-key-validator": "1.0.0", "@types/linkify-markdown": "1.0.1", diff --git a/yarn.lock b/yarn.lock index 6c9131741dd778..e9a8b04f3302c4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2484,10 +2484,10 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/jest@27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.5.1.tgz#2c8b6dc6ff85c33bcd07d0b62cb3d19ddfdb3ab9" - integrity sha512-fUy7YRpT+rHXto1YlL+J9rs0uLGyiqVt3ZOTQR+4ROc47yNl8WLdVLgUloBRhOxP1PZvguHl44T3H0wAWxahYQ== +"@types/jest@27.5.2": + version "27.5.2" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.5.2.tgz#ec49d29d926500ffb9fd22b84262e862049c026c" + integrity sha512-mpT8LJJ4CMeeahobofYWIjFo0xonRS/HfxnVEPMPFSQdGUt1uHCnoPT7Zhb+sjDU2wz0oKV0OLUR0WzrHNgfeA== dependencies: jest-matcher-utils "^27.0.0" pretty-format "^27.0.0" From d99914c316c85940ba782d2d8be8ffa99b695e0b Mon Sep 17 00:00:00 2001 From: Greg Schueler Date: Wed, 8 Jun 2022 12:47:08 -0700 Subject: [PATCH 051/240] docs: Update prConcurrentLimit with security exception (#15950) --- docs/usage/configuration-options.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index 91c5c11c0b65b2..55a4f24d45fe31 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -2025,6 +2025,9 @@ This setting - if enabled - limits Renovate to a maximum of x concurrent PRs ope This limit is enforced on a per-repository basis. +Note: Renovate always creates security PRs, even if the concurrent PR limit is already reached. +Security PRs have `[SECURITY]` in their PR title. + ## prCreation This setting tells Renovate when you would like it to raise PRs: From 7306c401d84a18efca9150550196f217d8788dcb Mon Sep 17 00:00:00 2001 From: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Date: Thu, 9 Jun 2022 06:59:57 +0200 Subject: [PATCH 052/240] docs(config options): improve introduction section (#15690) --- docs/usage/configuration-options.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index 55a4f24d45fe31..d2161a9bb28b7a 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -5,10 +5,10 @@ description: Configuration Options usable in renovate.json or package.json # Configuration Options -This document describes all the configuration options you may configure in a Renovate configuration file. +This document describes all the configuration options you may use in a Renovate configuration file. Any config you define applies to the whole repository (e.g. if you have a monorepo). -You can store your Renovate configuration file in one of the following locations: +You can store your Renovate configuration file in one of these locations: 1. `renovate.json` 1. `renovate.json5` From 0bbf62eb3dcdb27d2a3f3839a5794b0bb1421903 Mon Sep 17 00:00:00 2001 From: Johannes Feichtner Date: Thu, 9 Jun 2022 07:12:01 +0200 Subject: [PATCH 053/240] refactor(dockerfile): rewrite splitImageParts() (#15933) --- lib/modules/manager/dockerfile/extract.ts | 74 ++++++----------------- 1 file changed, 19 insertions(+), 55 deletions(-) diff --git a/lib/modules/manager/dockerfile/extract.ts b/lib/modules/manager/dockerfile/extract.ts index f27f7461a8f7d6..3eae1cd46dfbd5 100644 --- a/lib/modules/manager/dockerfile/extract.ts +++ b/lib/modules/manager/dockerfile/extract.ts @@ -7,9 +7,6 @@ import * as ubuntuVersioning from '../../versioning/ubuntu'; import type { PackageDependency, PackageFile } from '../types'; const variableMarker = '$'; -const variableOpen = '${'; -const variableClose = '}'; -const variableDefaultValueSplit = ':-'; export function extractVariables(image: string): Record { const variables: Record = {}; @@ -96,36 +93,26 @@ function processDepForAutoReplace( } export function splitImageParts(currentFrom: string): PackageDependency { + let isVariable = false; + let cleanedCurrentFrom = currentFrom; + // Check if we have a variable in format of "${VARIABLE:-:@}" // If so, remove everything except the image, defaultVal and digest. - let isVariable = false; - let cleanedCurrentFrom: string = currentFrom; - if ( - currentFrom.startsWith(variableOpen) && - currentFrom.endsWith(variableClose) - ) { - isVariable = true; + if (cleanedCurrentFrom?.includes(variableMarker)) { + const defaultValueRegex = regEx(/^\${.+?:-"?(?.*?)"?}$/); + const defaultValueMatch = + defaultValueRegex.exec(cleanedCurrentFrom)?.groups; + if (defaultValueMatch?.value) { + isVariable = true; + cleanedCurrentFrom = defaultValueMatch.value; + } - // If the variable contains exactly one $ and has the default value, we consider it as a valid dependency; - // otherwise skip it. - if ( - currentFrom.split('$').length !== 2 || - currentFrom.indexOf(variableDefaultValueSplit) === -1 - ) { + if (cleanedCurrentFrom?.includes(variableMarker)) { + // If cleanedCurrentFrom contains a variable, after cleaning, e.g. "$REGISTRY/alpine", we do not support this. return { skipReason: 'contains-variable', }; } - - cleanedCurrentFrom = currentFrom.substr( - variableOpen.length, - currentFrom.length - (variableClose.length + 2) - ); - cleanedCurrentFrom = cleanedCurrentFrom.substr( - cleanedCurrentFrom.indexOf(variableDefaultValueSplit) + - variableDefaultValueSplit.length - ); - cleanedCurrentFrom = cleanedCurrentFrom.replace(regEx(/^"(.*)"$/), '$1'); } const [currentDepTag, currentDigest] = cleanedCurrentFrom.split('@'); @@ -142,30 +129,14 @@ export function splitImageParts(currentFrom: string): PackageDependency { depName = depTagSplit.join(':'); } - if (depName?.includes(variableMarker)) { - // If depName contains a variable, after cleaning, e.g. "$REGISTRY/alpine", we do not support this. - return { - skipReason: 'contains-variable', - }; - } - - if (currentValue?.includes(variableMarker)) { - // If tag contains a variable, e.g. "5.0${VERSION_SUFFIX}", we do not support this. - return { - skipReason: 'contains-variable', - }; - } + const dep: PackageDependency = { + depName, + currentValue, + currentDigest, + }; if (isVariable) { - // If we have the variable and it contains the default value, we need to return - // it as a valid dependency. - - const dep: PackageDependency = { - depName, - currentValue, - currentDigest, - replaceString: cleanedCurrentFrom, - }; + dep.replaceString = cleanedCurrentFrom; if (!dep.currentValue) { delete dep.currentValue; @@ -174,15 +145,8 @@ export function splitImageParts(currentFrom: string): PackageDependency { if (!dep.currentDigest) { delete dep.currentDigest; } - - return dep; } - const dep: PackageDependency = { - depName, - currentValue, - currentDigest, - }; return dep; } From a2000bb69da411ecc11902dcadddbd8549449302 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 9 Jun 2022 08:47:42 +0200 Subject: [PATCH 054/240] chore(deps): update linters (#15895) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 6 ++-- yarn.lock | 94 ++++++++++++++-------------------------------------- 2 files changed, 27 insertions(+), 73 deletions(-) diff --git a/package.json b/package.json index ead5615d824cb7..cca6b0565f2ef8 100644 --- a/package.json +++ b/package.json @@ -257,8 +257,8 @@ "@types/url-join": "4.0.1", "@types/validate-npm-package-name": "3.0.3", "@types/xmldoc": "1.1.6", - "@typescript-eslint/eslint-plugin": "5.26.0", - "@typescript-eslint/parser": "5.26.0", + "@typescript-eslint/eslint-plugin": "5.27.0", + "@typescript-eslint/parser": "5.27.0", "aws-sdk-client-mock": "0.6.2", "callsite": "1.0.0", "conventional-changelog-conventionalcommits": "4.6.3", @@ -270,7 +270,7 @@ "eslint-formatter-gha": "1.4.1", "eslint-import-resolver-typescript": "2.7.1", "eslint-plugin-import": "2.26.0", - "eslint-plugin-jest": "26.3.0", + "eslint-plugin-jest": "26.4.6", "eslint-plugin-jest-formatting": "3.1.0", "eslint-plugin-promise": "6.0.0", "eslint-plugin-typescript-enum": "2.1.0", diff --git a/yarn.lock b/yarn.lock index e9a8b04f3302c4..f256b3346f2fc2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2731,14 +2731,14 @@ dependencies: "@types/node" "*" -"@typescript-eslint/eslint-plugin@5.26.0": - version "5.26.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.26.0.tgz#c1f98ccba9d345e38992975d3ca56ed6260643c2" - integrity sha512-oGCmo0PqnRZZndr+KwvvAUvD3kNE4AfyoGCwOZpoCncSh4MVD06JTE8XQa2u9u+NX5CsyZMBTEc2C72zx38eYA== - dependencies: - "@typescript-eslint/scope-manager" "5.26.0" - "@typescript-eslint/type-utils" "5.26.0" - "@typescript-eslint/utils" "5.26.0" +"@typescript-eslint/eslint-plugin@5.27.0": + version "5.27.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.27.0.tgz#23d82a4f21aaafd8f69dbab7e716323bb6695cc8" + integrity sha512-DDrIA7GXtmHXr1VCcx9HivA39eprYBIFxbQEHI6NyraRDxCGpxAFiYQAT/1Y0vh1C+o2vfBiy4IuPoXxtTZCAQ== + dependencies: + "@typescript-eslint/scope-manager" "5.27.0" + "@typescript-eslint/type-utils" "5.27.0" + "@typescript-eslint/utils" "5.27.0" debug "^4.3.4" functional-red-black-tree "^1.0.1" ignore "^5.2.0" @@ -2753,24 +2753,16 @@ dependencies: "@typescript-eslint/utils" "5.27.0" -"@typescript-eslint/parser@5.26.0": - version "5.26.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.26.0.tgz#a61b14205fe2ab7533deb4d35e604add9a4ceee2" - integrity sha512-n/IzU87ttzIdnAH5vQ4BBDnLPly7rC5VnjN3m0xBG82HK6rhRxnCb3w/GyWbNDghPd+NktJqB/wl6+YkzZ5T5Q== +"@typescript-eslint/parser@5.27.0": + version "5.27.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.27.0.tgz#62bb091ed5cf9c7e126e80021bb563dcf36b6b12" + integrity sha512-8oGjQF46c52l7fMiPPvX4It3u3V3JipssqDfHQ2hcR0AeR8Zge+OYyKUCm5b70X72N1qXt0qgHenwN6Gc2SXZA== dependencies: - "@typescript-eslint/scope-manager" "5.26.0" - "@typescript-eslint/types" "5.26.0" - "@typescript-eslint/typescript-estree" "5.26.0" + "@typescript-eslint/scope-manager" "5.27.0" + "@typescript-eslint/types" "5.27.0" + "@typescript-eslint/typescript-estree" "5.27.0" debug "^4.3.4" -"@typescript-eslint/scope-manager@5.26.0": - version "5.26.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.26.0.tgz#44209c7f649d1a120f0717e0e82da856e9871339" - integrity sha512-gVzTJUESuTwiju/7NiTb4c5oqod8xt5GhMbExKsCTp6adU3mya6AGJ4Pl9xC7x2DX9UYFsjImC0mA62BCY22Iw== - dependencies: - "@typescript-eslint/types" "5.26.0" - "@typescript-eslint/visitor-keys" "5.26.0" - "@typescript-eslint/scope-manager@5.27.0": version "5.27.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.27.0.tgz#a272178f613050ed62f51f69aae1e19e870a8bbb" @@ -2779,38 +2771,20 @@ "@typescript-eslint/types" "5.27.0" "@typescript-eslint/visitor-keys" "5.27.0" -"@typescript-eslint/type-utils@5.26.0": - version "5.26.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.26.0.tgz#937dee97702361744a3815c58991acf078230013" - integrity sha512-7ccbUVWGLmcRDSA1+ADkDBl5fP87EJt0fnijsMFTVHXKGduYMgienC/i3QwoVhDADUAPoytgjbZbCOMj4TY55A== +"@typescript-eslint/type-utils@5.27.0": + version "5.27.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.27.0.tgz#36fd95f6747412251d79c795b586ba766cf0974b" + integrity sha512-vpTvRRchaf628Hb/Xzfek+85o//zEUotr1SmexKvTfs7czXfYjXVT/a5yDbpzLBX1rhbqxjDdr1Gyo0x1Fc64g== dependencies: - "@typescript-eslint/utils" "5.26.0" + "@typescript-eslint/utils" "5.27.0" debug "^4.3.4" tsutils "^3.21.0" -"@typescript-eslint/types@5.26.0": - version "5.26.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.26.0.tgz#cb204bb154d3c103d9cc4d225f311b08219469f3" - integrity sha512-8794JZFE1RN4XaExLWLI2oSXsVImNkl79PzTOOWt9h0UHROwJedNOD2IJyfL0NbddFllcktGIO2aOu10avQQyA== - "@typescript-eslint/types@5.27.0": version "5.27.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.27.0.tgz#c3f44b9dda6177a9554f94a74745ca495ba9c001" integrity sha512-lY6C7oGm9a/GWhmUDOs3xAVRz4ty/XKlQ2fOLr8GAIryGn0+UBOoJDWyHer3UgrHkenorwvBnphhP+zPmzmw0A== -"@typescript-eslint/typescript-estree@5.26.0": - version "5.26.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.26.0.tgz#16cbceedb0011c2ed4f607255f3ee1e6e43b88c3" - integrity sha512-EyGpw6eQDsfD6jIqmXP3rU5oHScZ51tL/cZgFbFBvWuCwrIptl+oueUZzSmLtxFuSOQ9vDcJIs+279gnJkfd1w== - dependencies: - "@typescript-eslint/types" "5.26.0" - "@typescript-eslint/visitor-keys" "5.26.0" - debug "^4.3.4" - globby "^11.1.0" - is-glob "^4.0.3" - semver "^7.3.7" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@5.27.0": version "5.27.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.27.0.tgz#7965f5b553c634c5354a47dcce0b40b94611e995" @@ -2824,18 +2798,6 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.26.0": - version "5.26.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.26.0.tgz#896b8480eb124096e99c8b240460bb4298afcfb4" - integrity sha512-PJFwcTq2Pt4AMOKfe3zQOdez6InIDOjUJJD3v3LyEtxHGVVRK3Vo7Dd923t/4M9hSH2q2CLvcTdxlLPjcIk3eg== - dependencies: - "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.26.0" - "@typescript-eslint/types" "5.26.0" - "@typescript-eslint/typescript-estree" "5.26.0" - eslint-scope "^5.1.1" - eslint-utils "^3.0.0" - "@typescript-eslint/utils@5.27.0", "@typescript-eslint/utils@^5.10.0": version "5.27.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.27.0.tgz#d0021cbf686467a6a9499bd0589e19665f9f7e71" @@ -2848,14 +2810,6 @@ eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/visitor-keys@5.26.0": - version "5.26.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.26.0.tgz#7195f756e367f789c0e83035297c45b417b57f57" - integrity sha512-wei+ffqHanYDOQgg/fS6Hcar6wAWv0CUPQ3TZzOWd2BLfgP539rb49bwua8WRAs7R6kOSLn82rfEu2ro6Llt8Q== - dependencies: - "@typescript-eslint/types" "5.26.0" - eslint-visitor-keys "^3.3.0" - "@typescript-eslint/visitor-keys@5.27.0": version "5.27.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.27.0.tgz#97aa9a5d2f3df8215e6d3b77f9d214a24db269bd" @@ -4562,10 +4516,10 @@ eslint-plugin-jest-formatting@3.1.0: resolved "https://registry.yarnpkg.com/eslint-plugin-jest-formatting/-/eslint-plugin-jest-formatting-3.1.0.tgz#b26dd5a40f432b642dcc880021a771bb1c93dcd2" integrity sha512-XyysraZ1JSgGbLSDxjj5HzKKh0glgWf+7CkqxbTqb7zEhW7X2WHo5SBQ8cGhnszKN+2Lj3/oevBlHNbHezoc/A== -eslint-plugin-jest@26.3.0: - version "26.3.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-26.3.0.tgz#541598dafe78580737046a270734a413415b0fa9" - integrity sha512-Nst+lIIzCwVap2zxzEv+c0+ESvubEu96SyYuByYMpSQhtKF31DqQQ5PTprT2zbBvSLBAhgDXYWo69p4n+Bc/Ew== +eslint-plugin-jest@26.4.6: + version "26.4.6" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-26.4.6.tgz#9d8184c1ecf077722a20cc236c7e14f4e263606f" + integrity sha512-R3mq1IepnhtsukHQsWxdyKra3OVwYB+N4k8i45ndqSfr8p9KZV6G+EIUt1Z7hzAh4KlsbXG+nCTlNeGFLFLNvA== dependencies: "@typescript-eslint/utils" "^5.10.0" From 83f54f5a8ab63251b1a2310ea537269369523956 Mon Sep 17 00:00:00 2001 From: Alfred Krohmer Date: Thu, 9 Jun 2022 08:58:53 +0200 Subject: [PATCH 055/240] feat: allow `currentDigest` and `currentDigestShort` in templates (#15951) --- lib/util/template/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/util/template/index.ts b/lib/util/template/index.ts index 24c277fb30b8ec..2028177061240a 100644 --- a/lib/util/template/index.ts +++ b/lib/util/template/index.ts @@ -71,6 +71,9 @@ export const allowedFields = { currentValue: 'The extracted current value of the dependency being updated', currentVersion: 'The version that would be currently installed. For example, if currentValue is ^3.0.0 then currentVersion might be 3.1.0.', + currentDigest: 'The extracted current digest of the dependency being updated', + currentDigestShort: + 'The extracted current short digest of the dependency being updated', datasource: 'The datasource used to look up the upgrade', depName: 'The name of the dependency being updated', depNameLinked: From 0248f956d55aed0a3f45ff606752bfacba0d6b12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Torres=20Cogollo?= Date: Thu, 9 Jun 2022 13:48:55 +0200 Subject: [PATCH 056/240] fix(changelog): gitRef check (#15869) * fix: GitRef match when getting GitHub Changelog * Fix tests * Updated snaps to support gitref field * gitRef check support for gitlab * Check with extractVersion * Fixed tests for release-notes.spec.ts * Fixed tests and created test case for extractVersion flow * Revert "Fixed tests and created test case for extractVersion flow" This reverts commit b018a6415a30e894d5477f8df912147524e9aa73. * Revert "Fixed tests for release-notes.spec.ts" This reverts commit d0d4c004bfc63430a40e734420757f676f52147f. * Revert "Check with extractVersion" This reverts commit bb9b7953681165e3355d0a1717b956d094acfdbb. * Fixed tests Co-authored-by: Michael Kriese --- .../__snapshots__/github.spec.ts.snap | 24 ++++ .../__snapshots__/gitlab.spec.ts.snap | 24 ++++ .../__snapshots__/index.spec.ts.snap | 28 ++++ .../update/pr/changelog/release-notes.spec.ts | 130 ++++++++++++++---- .../update/pr/changelog/release-notes.ts | 17 ++- .../update/pr/changelog/source-github.ts | 1 + .../update/pr/changelog/source-gitlab.ts | 1 + .../repository/update/pr/changelog/types.ts | 1 + .../repository/update/pr/index.spec.ts | 1 + 9 files changed, 196 insertions(+), 31 deletions(-) diff --git a/lib/workers/repository/update/pr/changelog/__snapshots__/github.spec.ts.snap b/lib/workers/repository/update/pr/changelog/__snapshots__/github.spec.ts.snap index 57f6a7c9133b97..0fd0d55de47a55 100644 --- a/lib/workers/repository/update/pr/changelog/__snapshots__/github.spec.ts.snap +++ b/lib/workers/repository/update/pr/changelog/__snapshots__/github.spec.ts.snap @@ -17,6 +17,7 @@ Object { "changes": Array [], "compare": Object {}, "date": undefined, + "gitRef": undefined, "releaseNotes": null, "version": "2.5.2", }, @@ -24,6 +25,7 @@ Object { "changes": Array [], "compare": Object {}, "date": "2017-12-24T03:20:46.238Z", + "gitRef": undefined, "releaseNotes": null, "version": "2.4.2", }, @@ -33,6 +35,7 @@ Object { "url": "https://github.com/chalk/chalk/compare/npm_2.2.2...npm_2.3.0", }, "date": "2017-10-24T03:20:46.238Z", + "gitRef": "npm_2.3.0", "releaseNotes": Object { "notesSourceUrl": "", "url": "https://github.com/chalk/chalk/compare/npm_2.2.2...npm_2.3.0", @@ -45,6 +48,7 @@ Object { "url": "https://github.com/chalk/chalk/compare/npm_1.0.0...npm_2.2.2", }, "date": undefined, + "gitRef": "npm_2.2.2", "releaseNotes": Object { "notesSourceUrl": "", "url": "https://github.com/chalk/chalk/compare/npm_1.0.0...npm_2.2.2", @@ -72,6 +76,7 @@ Object { "changes": Array [], "compare": Object {}, "date": undefined, + "gitRef": undefined, "releaseNotes": null, "version": "2.5.2", }, @@ -79,6 +84,7 @@ Object { "changes": Array [], "compare": Object {}, "date": "2017-12-24T03:20:46.238Z", + "gitRef": undefined, "releaseNotes": null, "version": "2.4.2", }, @@ -88,6 +94,7 @@ Object { "url": "https://github-enterprise.example.com/chalk/chalk/compare/npm_2.2.2...npm_2.3.0", }, "date": "2017-10-24T03:20:46.238Z", + "gitRef": "npm_2.3.0", "releaseNotes": Object { "notesSourceUrl": "", "url": "https://github-enterprise.example.com/chalk/chalk/compare/npm_2.2.2...npm_2.3.0", @@ -100,6 +107,7 @@ Object { "url": "https://github-enterprise.example.com/chalk/chalk/compare/npm_1.0.0...npm_2.2.2", }, "date": undefined, + "gitRef": "npm_2.2.2", "releaseNotes": Object { "notesSourceUrl": "", "url": "https://github-enterprise.example.com/chalk/chalk/compare/npm_1.0.0...npm_2.2.2", @@ -127,6 +135,7 @@ Object { "changes": Array [], "compare": Object {}, "date": undefined, + "gitRef": undefined, "releaseNotes": null, "version": "2.5.2", }, @@ -134,6 +143,7 @@ Object { "changes": Array [], "compare": Object {}, "date": "2017-12-24T03:20:46.238Z", + "gitRef": undefined, "releaseNotes": null, "version": "2.4.2", }, @@ -143,6 +153,7 @@ Object { "url": "https://github.com/chalk/chalk/compare/npm_2.2.2...npm_2.3.0", }, "date": "2017-10-24T03:20:46.238Z", + "gitRef": "npm_2.3.0", "releaseNotes": Object { "notesSourceUrl": "", "url": "https://github.com/chalk/chalk/compare/npm_2.2.2...npm_2.3.0", @@ -155,6 +166,7 @@ Object { "url": "https://github.com/chalk/chalk/compare/npm_1.0.0...npm_2.2.2", }, "date": undefined, + "gitRef": "npm_2.2.2", "releaseNotes": Object { "notesSourceUrl": "", "url": "https://github.com/chalk/chalk/compare/npm_1.0.0...npm_2.2.2", @@ -182,6 +194,7 @@ Object { "changes": Array [], "compare": Object {}, "date": undefined, + "gitRef": undefined, "releaseNotes": null, "version": "2.5.2", }, @@ -189,6 +202,7 @@ Object { "changes": Array [], "compare": Object {}, "date": "2017-12-24T03:20:46.238Z", + "gitRef": undefined, "releaseNotes": null, "version": "2.4.2", }, @@ -198,6 +212,7 @@ Object { "url": "https://github.com/chalk/chalk/compare/npm_2.2.2...npm_2.3.0", }, "date": "2017-10-24T03:20:46.238Z", + "gitRef": "npm_2.3.0", "releaseNotes": Object { "notesSourceUrl": "", "url": "https://github.com/chalk/chalk/compare/npm_2.2.2...npm_2.3.0", @@ -210,6 +225,7 @@ Object { "url": "https://github.com/chalk/chalk/compare/npm_1.0.0...npm_2.2.2", }, "date": undefined, + "gitRef": "npm_2.2.2", "releaseNotes": Object { "notesSourceUrl": "", "url": "https://github.com/chalk/chalk/compare/npm_1.0.0...npm_2.2.2", @@ -237,6 +253,7 @@ Object { "changes": Array [], "compare": Object {}, "date": undefined, + "gitRef": undefined, "releaseNotes": null, "version": "2.5.2", }, @@ -244,6 +261,7 @@ Object { "changes": Array [], "compare": Object {}, "date": "2017-12-24T03:20:46.238Z", + "gitRef": undefined, "releaseNotes": null, "version": "2.4.2", }, @@ -253,6 +271,7 @@ Object { "url": "https://github.com/chalk/chalk/compare/npm_2.2.2...npm_2.3.0", }, "date": "2017-10-24T03:20:46.238Z", + "gitRef": "npm_2.3.0", "releaseNotes": Object { "notesSourceUrl": "", "url": "https://github.com/chalk/chalk/compare/npm_2.2.2...npm_2.3.0", @@ -265,6 +284,7 @@ Object { "url": "https://github.com/chalk/chalk/compare/npm_1.0.0...npm_2.2.2", }, "date": undefined, + "gitRef": "npm_2.2.2", "releaseNotes": Object { "notesSourceUrl": "", "url": "https://github.com/chalk/chalk/compare/npm_1.0.0...npm_2.2.2", @@ -292,6 +312,7 @@ Object { "changes": Array [], "compare": Object {}, "date": undefined, + "gitRef": undefined, "releaseNotes": null, "version": "2.5.2", }, @@ -299,6 +320,7 @@ Object { "changes": Array [], "compare": Object {}, "date": "2017-12-24T03:20:46.238Z", + "gitRef": undefined, "releaseNotes": null, "version": "2.4.2", }, @@ -308,6 +330,7 @@ Object { "url": "https://github.com/chalk/chalk/compare/npm_2.2.2...npm_2.3.0", }, "date": "2017-10-24T03:20:46.238Z", + "gitRef": "npm_2.3.0", "releaseNotes": Object { "notesSourceUrl": "", "url": "https://github.com/chalk/chalk/compare/npm_2.2.2...npm_2.3.0", @@ -320,6 +343,7 @@ Object { "url": "https://github.com/chalk/chalk/compare/npm_1.0.0...npm_2.2.2", }, "date": undefined, + "gitRef": "npm_2.2.2", "releaseNotes": Object { "notesSourceUrl": "", "url": "https://github.com/chalk/chalk/compare/npm_1.0.0...npm_2.2.2", diff --git a/lib/workers/repository/update/pr/changelog/__snapshots__/gitlab.spec.ts.snap b/lib/workers/repository/update/pr/changelog/__snapshots__/gitlab.spec.ts.snap index 5ea9435c491909..6fac4360721bc9 100644 --- a/lib/workers/repository/update/pr/changelog/__snapshots__/gitlab.spec.ts.snap +++ b/lib/workers/repository/update/pr/changelog/__snapshots__/gitlab.spec.ts.snap @@ -17,6 +17,7 @@ Object { "changes": Array [], "compare": Object {}, "date": undefined, + "gitRef": undefined, "releaseNotes": null, "version": "5.6.1", }, @@ -24,6 +25,7 @@ Object { "changes": Array [], "compare": Object {}, "date": "2020-02-13T15:37:00.000Z", + "gitRef": undefined, "releaseNotes": null, "version": "5.6.0", }, @@ -31,6 +33,7 @@ Object { "changes": Array [], "compare": Object {}, "date": undefined, + "gitRef": "eba303e91c930292198b2fc57040145682162a1b", "releaseNotes": null, "version": "5.5.0", }, @@ -38,6 +41,7 @@ Object { "changes": Array [], "compare": Object {}, "date": "2018-08-24T14:23:00.000Z", + "gitRef": undefined, "releaseNotes": null, "version": "5.4.0", }, @@ -62,6 +66,7 @@ Object { "changes": Array [], "compare": Object {}, "date": undefined, + "gitRef": undefined, "releaseNotes": null, "version": "5.6.1", }, @@ -69,6 +74,7 @@ Object { "changes": Array [], "compare": Object {}, "date": "2020-02-13T15:37:00.000Z", + "gitRef": undefined, "releaseNotes": null, "version": "5.6.0", }, @@ -76,6 +82,7 @@ Object { "changes": Array [], "compare": Object {}, "date": undefined, + "gitRef": "eba303e91c930292198b2fc57040145682162a1b", "releaseNotes": null, "version": "5.5.0", }, @@ -83,6 +90,7 @@ Object { "changes": Array [], "compare": Object {}, "date": "2018-08-24T14:23:00.000Z", + "gitRef": undefined, "releaseNotes": null, "version": "5.4.0", }, @@ -107,6 +115,7 @@ Object { "changes": Array [], "compare": Object {}, "date": undefined, + "gitRef": undefined, "releaseNotes": null, "version": "5.6.1", }, @@ -114,6 +123,7 @@ Object { "changes": Array [], "compare": Object {}, "date": "2020-02-13T15:37:00.000Z", + "gitRef": undefined, "releaseNotes": null, "version": "5.6.0", }, @@ -121,6 +131,7 @@ Object { "changes": Array [], "compare": Object {}, "date": undefined, + "gitRef": "eba303e91c930292198b2fc57040145682162a1b", "releaseNotes": null, "version": "5.5.0", }, @@ -128,6 +139,7 @@ Object { "changes": Array [], "compare": Object {}, "date": "2018-08-24T14:23:00.000Z", + "gitRef": undefined, "releaseNotes": null, "version": "5.4.0", }, @@ -154,6 +166,7 @@ Object { "url": "https://gitlab.com/meno/dropzone/compare/v5.6.0...v5.6.1", }, "date": undefined, + "gitRef": undefined, "releaseNotes": Object { "notesSourceUrl": "", "url": "https://gitlab.com/meno/dropzone/compare/v5.6.0...v5.6.1", @@ -166,6 +179,7 @@ Object { "url": "https://gitlab.com/meno/dropzone/compare/v5.5.0...v5.6.0", }, "date": "2020-02-13T15:37:00.000Z", + "gitRef": undefined, "releaseNotes": Object { "notesSourceUrl": "", "url": "https://gitlab.com/meno/dropzone/compare/v5.5.0...v5.6.0", @@ -178,6 +192,7 @@ Object { "url": "https://gitlab.com/meno/dropzone/compare/v5.4.0...v5.5.0", }, "date": undefined, + "gitRef": "eba303e91c930292198b2fc57040145682162a1b", "releaseNotes": Object { "notesSourceUrl": "", "url": "https://gitlab.com/meno/dropzone/compare/v5.4.0...v5.5.0", @@ -190,6 +205,7 @@ Object { "url": "https://gitlab.com/meno/dropzone/compare/v5.2.0...v5.4.0", }, "date": "2018-08-24T14:23:00.000Z", + "gitRef": undefined, "releaseNotes": Object { "notesSourceUrl": "", "url": "https://gitlab.com/meno/dropzone/compare/v5.2.0...v5.4.0", @@ -217,6 +233,7 @@ Object { "changes": Array [], "compare": Object {}, "date": undefined, + "gitRef": undefined, "releaseNotes": null, "version": "5.6.1", }, @@ -224,6 +241,7 @@ Object { "changes": Array [], "compare": Object {}, "date": "2020-02-13T15:37:00.000Z", + "gitRef": undefined, "releaseNotes": null, "version": "5.6.0", }, @@ -231,6 +249,7 @@ Object { "changes": Array [], "compare": Object {}, "date": undefined, + "gitRef": "eba303e91c930292198b2fc57040145682162a1b", "releaseNotes": null, "version": "5.5.0", }, @@ -238,6 +257,7 @@ Object { "changes": Array [], "compare": Object {}, "date": "2018-08-24T14:23:00.000Z", + "gitRef": undefined, "releaseNotes": null, "version": "5.4.0", }, @@ -262,6 +282,7 @@ Object { "changes": Array [], "compare": Object {}, "date": undefined, + "gitRef": undefined, "releaseNotes": null, "version": "5.6.1", }, @@ -269,6 +290,7 @@ Object { "changes": Array [], "compare": Object {}, "date": "2020-02-13T15:37:00.000Z", + "gitRef": undefined, "releaseNotes": null, "version": "5.6.0", }, @@ -276,6 +298,7 @@ Object { "changes": Array [], "compare": Object {}, "date": undefined, + "gitRef": "eba303e91c930292198b2fc57040145682162a1b", "releaseNotes": null, "version": "5.5.0", }, @@ -283,6 +306,7 @@ Object { "changes": Array [], "compare": Object {}, "date": "2018-08-24T14:23:00.000Z", + "gitRef": undefined, "releaseNotes": null, "version": "5.4.0", }, diff --git a/lib/workers/repository/update/pr/changelog/__snapshots__/index.spec.ts.snap b/lib/workers/repository/update/pr/changelog/__snapshots__/index.spec.ts.snap index 7fe27ef13f2b02..0bc6c5831b15a0 100644 --- a/lib/workers/repository/update/pr/changelog/__snapshots__/index.spec.ts.snap +++ b/lib/workers/repository/update/pr/changelog/__snapshots__/index.spec.ts.snap @@ -17,6 +17,7 @@ Object { "changes": Array [], "compare": Object {}, "date": undefined, + "gitRef": undefined, "releaseNotes": null, "version": "2.5.2", }, @@ -24,6 +25,7 @@ Object { "changes": Array [], "compare": Object {}, "date": "2017-12-24T03:20:46.238Z", + "gitRef": undefined, "releaseNotes": null, "version": "2.4.2", }, @@ -33,6 +35,7 @@ Object { "url": "https://github.com/chalk/chalk/compare/npm_2.2.2...npm_2.3.0", }, "date": "2017-10-24T03:20:46.238Z", + "gitRef": "npm_2.3.0", "releaseNotes": Object { "notesSourceUrl": "", "url": "https://github.com/chalk/chalk/compare/npm_2.2.2...npm_2.3.0", @@ -45,6 +48,7 @@ Object { "url": "https://github.com/chalk/chalk/compare/npm_1.0.0...npm_2.2.2", }, "date": undefined, + "gitRef": "npm_2.2.2", "releaseNotes": Object { "notesSourceUrl": "", "url": "https://github.com/chalk/chalk/compare/npm_1.0.0...npm_2.2.2", @@ -72,6 +76,7 @@ Object { "changes": Array [], "compare": Object {}, "date": undefined, + "gitRef": undefined, "releaseNotes": null, "version": "2.5.2", }, @@ -79,6 +84,7 @@ Object { "changes": Array [], "compare": Object {}, "date": "2017-12-24T03:20:46.238Z", + "gitRef": undefined, "releaseNotes": null, "version": "2.4.2", }, @@ -88,6 +94,7 @@ Object { "url": "https://github-enterprise.example.com/chalk/chalk/compare/npm_2.2.2...npm_2.3.0", }, "date": "2017-10-24T03:20:46.238Z", + "gitRef": "npm_2.3.0", "releaseNotes": Object { "notesSourceUrl": "", "url": "https://github-enterprise.example.com/chalk/chalk/compare/npm_2.2.2...npm_2.3.0", @@ -100,6 +107,7 @@ Object { "url": "https://github-enterprise.example.com/chalk/chalk/compare/npm_1.0.0...npm_2.2.2", }, "date": undefined, + "gitRef": "npm_2.2.2", "releaseNotes": Object { "notesSourceUrl": "", "url": "https://github-enterprise.example.com/chalk/chalk/compare/npm_1.0.0...npm_2.2.2", @@ -127,6 +135,7 @@ Object { "changes": Array [], "compare": Object {}, "date": undefined, + "gitRef": undefined, "releaseNotes": null, "version": "2.5.2", }, @@ -134,6 +143,7 @@ Object { "changes": Array [], "compare": Object {}, "date": "2017-12-24T03:20:46.238Z", + "gitRef": undefined, "releaseNotes": null, "version": "2.4.2", }, @@ -143,6 +153,7 @@ Object { "url": "https://github.com/chalk/chalk/compare/npm_2.2.2...npm_2.3.0", }, "date": "2017-10-24T03:20:46.238Z", + "gitRef": "npm_2.3.0", "releaseNotes": Object { "notesSourceUrl": "", "url": "https://github.com/chalk/chalk/compare/npm_2.2.2...npm_2.3.0", @@ -155,6 +166,7 @@ Object { "url": "https://github.com/chalk/chalk/compare/npm_1.0.0...npm_2.2.2", }, "date": undefined, + "gitRef": "npm_2.2.2", "releaseNotes": Object { "notesSourceUrl": "", "url": "https://github.com/chalk/chalk/compare/npm_1.0.0...npm_2.2.2", @@ -182,6 +194,7 @@ Object { "changes": Array [], "compare": Object {}, "date": undefined, + "gitRef": undefined, "releaseNotes": null, "version": "2.5.2", }, @@ -189,6 +202,7 @@ Object { "changes": Array [], "compare": Object {}, "date": "2017-12-24T03:20:46.238Z", + "gitRef": undefined, "releaseNotes": null, "version": "2.4.2", }, @@ -198,6 +212,7 @@ Object { "url": "https://github-enterprise.example.com/chalk/chalk/compare/npm_2.2.2...npm_2.3.0", }, "date": "2017-10-24T03:20:46.238Z", + "gitRef": "npm_2.3.0", "releaseNotes": Object { "notesSourceUrl": "", "url": "https://github-enterprise.example.com/chalk/chalk/compare/npm_2.2.2...npm_2.3.0", @@ -210,6 +225,7 @@ Object { "url": "https://github-enterprise.example.com/chalk/chalk/compare/npm_1.0.0...npm_2.2.2", }, "date": undefined, + "gitRef": "npm_2.2.2", "releaseNotes": Object { "notesSourceUrl": "", "url": "https://github-enterprise.example.com/chalk/chalk/compare/npm_1.0.0...npm_2.2.2", @@ -237,6 +253,7 @@ Object { "changes": Array [], "compare": Object {}, "date": undefined, + "gitRef": undefined, "releaseNotes": null, "version": "2.5.2", }, @@ -244,6 +261,7 @@ Object { "changes": Array [], "compare": Object {}, "date": "2017-12-24T03:20:46.238Z", + "gitRef": undefined, "releaseNotes": null, "version": "2.4.2", }, @@ -253,6 +271,7 @@ Object { "url": "https://github.com/chalk/chalk/compare/npm_2.2.2...npm_2.3.0", }, "date": "2017-10-24T03:20:46.238Z", + "gitRef": "npm_2.3.0", "releaseNotes": Object { "notesSourceUrl": "", "url": "https://github.com/chalk/chalk/compare/npm_2.2.2...npm_2.3.0", @@ -265,6 +284,7 @@ Object { "url": "https://github.com/chalk/chalk/compare/npm_1.0.0...npm_2.2.2", }, "date": undefined, + "gitRef": "npm_2.2.2", "releaseNotes": Object { "notesSourceUrl": "", "url": "https://github.com/chalk/chalk/compare/npm_1.0.0...npm_2.2.2", @@ -292,6 +312,7 @@ Object { "changes": Array [], "compare": Object {}, "date": undefined, + "gitRef": undefined, "releaseNotes": null, "version": "2.5.2", }, @@ -301,6 +322,7 @@ Object { "url": "https://github.com/chalk/chalk/compare/v2.3.0...v2.4.2", }, "date": "2017-12-24T03:20:46.238Z", + "gitRef": undefined, "releaseNotes": Object { "notesSourceUrl": "", "url": "https://github.com/chalk/chalk/compare/v2.3.0...v2.4.2", @@ -313,6 +335,7 @@ Object { "url": "https://github.com/chalk/chalk/compare/2.2.2...v2.3.0", }, "date": "2017-10-24T03:20:46.238Z", + "gitRef": "npm_2.3.0", "releaseNotes": Object { "notesSourceUrl": "", "url": "https://github.com/chalk/chalk/compare/2.2.2...v2.3.0", @@ -325,6 +348,7 @@ Object { "url": "https://github.com/chalk/chalk/compare/1.0.0...2.2.2", }, "date": undefined, + "gitRef": "npm_2.2.2", "releaseNotes": Object { "notesSourceUrl": "", "url": "https://github.com/chalk/chalk/compare/1.0.0...2.2.2", @@ -352,6 +376,7 @@ Object { "changes": Array [], "compare": Object {}, "date": undefined, + "gitRef": undefined, "releaseNotes": null, "version": "2.5.2", }, @@ -359,6 +384,7 @@ Object { "changes": Array [], "compare": Object {}, "date": "2017-12-24T03:20:46.238Z", + "gitRef": undefined, "releaseNotes": null, "version": "2.4.2", }, @@ -368,6 +394,7 @@ Object { "url": "https://github.com/chalk/chalk/compare/npm_2.2.2...npm_2.3.0", }, "date": "2017-10-24T03:20:46.238Z", + "gitRef": "npm_2.3.0", "releaseNotes": Object { "notesSourceUrl": "", "url": "https://github.com/chalk/chalk/compare/npm_2.2.2...npm_2.3.0", @@ -380,6 +407,7 @@ Object { "url": "https://github.com/chalk/chalk/compare/npm_1.0.0...npm_2.2.2", }, "date": undefined, + "gitRef": "npm_2.2.2", "releaseNotes": Object { "notesSourceUrl": "", "url": "https://github.com/chalk/chalk/compare/npm_1.0.0...npm_2.2.2", diff --git a/lib/workers/repository/update/pr/changelog/release-notes.spec.ts b/lib/workers/repository/update/pr/changelog/release-notes.spec.ts index aa94a95e66515e..226cfb3dd6c792 100644 --- a/lib/workers/repository/update/pr/changelog/release-notes.spec.ts +++ b/lib/workers/repository/update/pr/changelog/release-notes.spec.ts @@ -277,7 +277,10 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { repository: 'some/repository', depName: 'some', }, - '1.0.0' + { + version: '1.0.0', + gitRef: '1.0.0', + } as ChangeLogRelease ); expect(res).toBeNull(); }); @@ -297,7 +300,10 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { repository: 'some/other-repository', depName: 'other', }, - '1.0.1' + { + version: '1.0.1', + gitRef: '1.0.1', + } as ChangeLogRelease ); expect(res).toEqual({ body: 'some body [#123](https://github.com/some/other-repository/issues/123), [#124](https://github.com/some/yet-other-repository/issues/124)\n', @@ -325,7 +331,10 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { repository: 'some/other-repository', depName: 'other', }, - '1.0.1' + { + version: '1.0.1', + gitRef: '1.0.1', + } as ChangeLogRelease ); expect(res).toEqual({ body: 'some body [#123](https://github.com/some/other-repository/issues/123), [#124](https://github.com/some/yet-other-repository/issues/124)\n', @@ -354,7 +363,10 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { repository: 'some/other-repository', depName: 'other', }, - '1.0.1' + { + version: '1.0.1', + gitRef: '1.0.1', + } as ChangeLogRelease ); expect(res).toEqual({ body: 'some body [#123](https://github.com/some/other-repository/issues/123), [#124](https://github.com/some/yet-other-repository/issues/124)\n', @@ -383,7 +395,10 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { repository: 'some/other-repository', depName: 'other', }, - '1.0.1' + { + version: '1.0.1', + gitRef: '1.0.1', + } as ChangeLogRelease ); expect(res).toEqual({ body: 'some body [#123](https://github.com/some/other-repository/issues/123), [#124](https://github.com/some/yet-other-repository/issues/124)\n', @@ -411,7 +426,10 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { repository: 'some/other-repository', depName: 'other', }, - '1.0.1' + { + version: '1.0.1', + gitRef: '1.0.1', + } as ChangeLogRelease ); expect(res).toEqual({ body: 'some body [#123](https://github.com/some/other-repository/issues/123), [#124](https://github.com/some/yet-other-repository/issues/124)\n', @@ -445,7 +463,10 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { depName: 'other', apiBaseUrl: 'https://api.gitlab.com/', }, - '1.0.1' + { + version: '1.0.1', + gitRef: '1.0.1', + } as ChangeLogRelease ); expect(res).toEqual({ body: 'some body #123, [#124](https://gitlab.com/some/yet-other-repository/issues/124)', @@ -478,7 +499,10 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { depName: 'other', apiBaseUrl: 'https://api.gitlab.com/', }, - '1.0.1' + { + version: '1.0.1', + gitRef: '1.0.1', + } as ChangeLogRelease ); expect(res).toEqual({ body: 'some body #123, [#124](https://gitlab.com/some/yet-other-repository/issues/124)', @@ -511,7 +535,10 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { depName: 'other', apiBaseUrl: 'https://api.gitlab.com/', }, - '1.0.1' + { + version: '1.0.1', + gitRef: '1.0.1', + } as ChangeLogRelease ); expect(res).toEqual({ body: 'some body #123, [#124](https://gitlab.com/some/yet-other-repository/issues/124)', @@ -531,7 +558,10 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { apiBaseUrl: 'https://api.lol.lol/', baseUrl: 'https://lol.lol/', } as ChangeLogProject, - '1.0.1' + { + version: '1.0.1', + gitRef: '1.0.1', + } as ChangeLogRelease ); expect(res).toBeNull(); }); @@ -555,7 +585,10 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { repository: 'some/other-repository', depName: 'exampleDep', }, - '1.0.0' + { + version: '1.0.0', + gitRef: '1.0.0', + } as ChangeLogRelease ); expect(res).toEqual({ url: 'correct/url/tag.com', @@ -577,7 +610,10 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { ...githubProject, repository: 'chalk', }, - '2.0.0' + { + version: '2.0.0', + gitRef: '2.0.0', + } as ChangeLogRelease ); expect(res).toBeNull(); }); @@ -599,7 +635,10 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { ...githubProject, repository: 'chalk', }, - '2.0.0' + { + version: '2.0.0', + gitRef: '2.0.0', + } as ChangeLogRelease ); expect(res).toBeNull(); }); @@ -620,7 +659,10 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { ...githubProject, repository: 'some/repository1', }, - '1.0.0' + { + version: '1.0.0', + gitRef: '1.0.0', + } as ChangeLogRelease ); expect(res).toBeNull(); }); @@ -641,7 +683,10 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { ...githubProject, repository: 'some/repository2', }, - '1.0.0' + { + version: '1.0.0', + gitRef: '1.0.0', + } as ChangeLogRelease ); expect(res).toBeNull(); }); @@ -662,7 +707,10 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { ...githubProject, repository: 'angular/angular.js', }, - '1.6.9' + { + version: '1.6.9', + gitRef: '1.6.9', + } as ChangeLogRelease ); expect(res).toMatchSnapshot({ notesSourceUrl: @@ -687,7 +735,10 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { repository: 'gitlab-org/gitter/webapp', apiBaseUrl: 'https://api.gitlab.com/', }, - '20.26.0' + { + version: '20.26.0', + gitRef: '20.26.0', + } as ChangeLogRelease ); expect(res).toMatchSnapshot({ @@ -715,7 +766,10 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { apiBaseUrl: 'https://my.custom.domain/', baseUrl: 'https://my.custom.domain/', }, - '20.26.0' + { + version: '20.26.0', + gitRef: '20.26.0', + } as ChangeLogRelease ); expect(res).toMatchSnapshot({ @@ -741,7 +795,10 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { ...githubProject, repository: 'facebook/jest', }, - '22.0.0' + { + version: '22.0.0', + gitRef: '22.0.0', + } as ChangeLogRelease ); expect(res).toMatchSnapshot({ @@ -773,7 +830,10 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { repository: 'nodeca/js-yaml', sourceDirectory, }, - '3.10.0' + { + version: '3.10.0', + gitRef: '3.10.0', + } as ChangeLogRelease ); expect(res).toMatchSnapshot({ @@ -799,7 +859,10 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { ...githubProject, repository: 'nodeca/js-yaml', }, - '3.10.0' + { + version: '3.10.0', + gitRef: '3.10.0', + } as ChangeLogRelease ); expect(res).toMatchSnapshot({ @@ -814,7 +877,10 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { { repository: 'nodeca/js-yaml', } as ChangeLogProject, - '3.10.0' + { + version: '3.10.0', + gitRef: '3.10.0', + } as ChangeLogRelease ); expect(res).toBeNull(); }); @@ -839,7 +905,10 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { ...githubProject, repository: 'yargs/yargs', }, - '15.3.0' + { + version: '15.3.0', + gitRef: '15.3.0', + } as ChangeLogRelease ); versionOneNotes = res; @@ -866,7 +935,10 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { ...githubProject, repository: 'yargs/yargs', }, - '15.2.0' + { + version: '15.2.0', + gitRef: '15.2.0', + } as ChangeLogRelease ); versionTwoNotes = res; @@ -893,7 +965,10 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { ...gitlabProject, repository: 'itentialopensource/adapter-utils', }, - '4.33.0' + { + version: '4.33.0', + gitRef: '4.33.0', + } as ChangeLogRelease ); versionTwoNotes = res; @@ -926,7 +1001,10 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { repository: 'itentialopensource/adapter-utils', sourceDirectory, }, - '4.33.0' + { + version: '4.33.0', + gitRef: '4.33.0', + } as ChangeLogRelease ); versionTwoNotes = res; diff --git a/lib/workers/repository/update/pr/changelog/release-notes.ts b/lib/workers/repository/update/pr/changelog/release-notes.ts index 1709d6cf0424c2..616f4f63161b3d 100644 --- a/lib/workers/repository/update/pr/changelog/release-notes.ts +++ b/lib/workers/repository/update/pr/changelog/release-notes.ts @@ -13,6 +13,7 @@ import type { ChangeLogFile, ChangeLogNotes, ChangeLogProject, + ChangeLogRelease, ChangeLogResult, } from './types'; @@ -95,9 +96,10 @@ export function massageBody( export async function getReleaseNotes( project: ChangeLogProject, - version: string + release: ChangeLogRelease ): Promise { const { depName, repository } = project; + const { version, gitRef } = release; logger.trace(`getReleaseNotes(${repository}, ${version}, ${depName})`); const releases = await getCachedReleaseList(project); logger.trace({ releases }, 'Release list from getReleaseList'); @@ -107,7 +109,11 @@ export async function getReleaseNotes( if (is.undefined(matchedRelease)) { // no exact match of a release then check other cases matchedRelease = releases.find( - (r) => r.tag === version || r.tag === `v${version}` + (r) => + r.tag === version || + r.tag === `v${version}` || + r.tag === gitRef || + r.tag === `v${gitRef}` ); } releaseNotes = await releaseNotesResult(matchedRelease, project); @@ -256,9 +262,10 @@ export function getReleaseNotesMdFile( export async function getReleaseNotesMd( project: ChangeLogProject, - version: string + release: ChangeLogRelease ): Promise { const { baseUrl, repository } = project; + const version = release.version; logger.trace(`getReleaseNotesMd(${repository}, ${version})`); const skippedRepos = ['facebook/react-native']; // istanbul ignore if @@ -373,10 +380,10 @@ export async function addReleaseNotes( releaseNotes = await packageCache.get(cacheNamespace, cacheKey); // istanbul ignore else: no cache tests if (!releaseNotes) { - releaseNotes = await getReleaseNotesMd(input.project, v.version); + releaseNotes = await getReleaseNotesMd(input.project, v); // istanbul ignore else: should be tested if (!releaseNotes) { - releaseNotes = await getReleaseNotes(input.project, v.version); + releaseNotes = await getReleaseNotes(input.project, v); } // Small hack to force display of release notes when there is a compare url if (!releaseNotes && v.compare.url) { diff --git a/lib/workers/repository/update/pr/changelog/source-github.ts b/lib/workers/repository/update/pr/changelog/source-github.ts index 8d62b41dce635a..474ae3a46804c4 100644 --- a/lib/workers/repository/update/pr/changelog/source-github.ts +++ b/lib/workers/repository/update/pr/changelog/source-github.ts @@ -141,6 +141,7 @@ export async function getChangeLogJSON( if (!release) { release = { version: next.version, + gitRef: next.gitRef, date: next.releaseTimestamp, // put empty changes so that existing templates won't break changes: [], diff --git a/lib/workers/repository/update/pr/changelog/source-gitlab.ts b/lib/workers/repository/update/pr/changelog/source-gitlab.ts index 04815f531e264f..679d7836a7eb1c 100644 --- a/lib/workers/repository/update/pr/changelog/source-gitlab.ts +++ b/lib/workers/repository/update/pr/changelog/source-gitlab.ts @@ -110,6 +110,7 @@ export async function getChangeLogJSON( release = { version: next.version, date: next.releaseTimestamp, + gitRef: next.gitRef, // put empty changes so that existing templates won't break changes: [], compare: {}, diff --git a/lib/workers/repository/update/pr/changelog/types.ts b/lib/workers/repository/update/pr/changelog/types.ts index ba737409d7d8ab..a3184672a65301 100644 --- a/lib/workers/repository/update/pr/changelog/types.ts +++ b/lib/workers/repository/update/pr/changelog/types.ts @@ -20,6 +20,7 @@ export interface ChangeLogRelease { date: string | Date; releaseNotes?: ChangeLogNotes; version: string; + gitRef: string; } export interface ChangeLogProject { diff --git a/lib/workers/repository/update/pr/index.spec.ts b/lib/workers/repository/update/pr/index.spec.ts index 345301637b4f3f..912284d7635d42 100644 --- a/lib/workers/repository/update/pr/index.spec.ts +++ b/lib/workers/repository/update/pr/index.spec.ts @@ -566,6 +566,7 @@ describe('workers/repository/update/pr/index', () => { const dummyRelease: ChangeLogRelease = { version: '', + gitRef: '', changes: dummyChanges, compare: {}, date: '', From 49d851e5fd3a6bcd4667fb243880488bbfd46ccb Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Thu, 9 Jun 2022 14:17:05 +0200 Subject: [PATCH 057/240] refactor: tighten typescript types (#15965) --- lib/config/migration.spec.ts | 4 +++- lib/config/migration.ts | 3 ++- .../custom/compatibility-migration.ts | 2 +- lib/config/types.ts | 18 +++++++++++++----- lib/config/validation.spec.ts | 2 +- lib/modules/datasource/npm/npmrc.ts | 4 +++- lib/workers/types.ts | 1 - tools/docs/presets.ts | 2 +- 8 files changed, 24 insertions(+), 12 deletions(-) diff --git a/lib/config/migration.spec.ts b/lib/config/migration.spec.ts index 4376df82f80346..e7b8dccef2cc0f 100644 --- a/lib/config/migration.spec.ts +++ b/lib/config/migration.spec.ts @@ -304,8 +304,10 @@ describe('config/migration', () => { expect(isMigrated).toBeTrue(); expect(migratedConfig).toMatchSnapshot(); expect(migratedConfig.lockFileMaintenance?.packageRules).toHaveLength(1); + // TODO: fix types #7154 expect( - migratedConfig.lockFileMaintenance?.packageRules[0].respectLatest + (migratedConfig.lockFileMaintenance as RenovateConfig) + ?.packageRules?.[0].respectLatest ).toBeFalse(); }); diff --git a/lib/config/migration.ts b/lib/config/migration.ts index 3567714432be51..ac75c9d1db6290 100644 --- a/lib/config/migration.ts +++ b/lib/config/migration.ts @@ -221,7 +221,8 @@ export function migrateConfig(config: RenovateConfig): MigratedConfig { for (const [oldKey, ruleVal] of Object.entries(packageRule)) { const newKey = renameMap[oldKey as keyof typeof renameMap]; if (newKey) { - packageRule[newKey] = ruleVal; + // TODO: fix types #7154 + packageRule[newKey] = ruleVal as never; delete packageRule[oldKey]; } } diff --git a/lib/config/migrations/custom/compatibility-migration.ts b/lib/config/migrations/custom/compatibility-migration.ts index a22ddb1485a81d..69c44322bc1d74 100644 --- a/lib/config/migrations/custom/compatibility-migration.ts +++ b/lib/config/migrations/custom/compatibility-migration.ts @@ -7,7 +7,7 @@ export class CompatibilityMigration extends AbstractMigration { override run(value: unknown): void { if (is.object(value)) { - this.setSafely('constraints', value); + this.setSafely('constraints', value as Record); } } } diff --git a/lib/config/types.ts b/lib/config/types.ts index e49d86f2d5be65..962e19bbef215f 100644 --- a/lib/config/types.ts +++ b/lib/config/types.ts @@ -38,6 +38,7 @@ export interface RenovateSharedConfig { enabledManagers?: string[]; extends?: string[]; fileMatch?: string[]; + force?: RenovateConfig; group?: GroupConfig; groupName?: string; groupSlug?: string; @@ -58,6 +59,7 @@ export interface RenovateSharedConfig { productLinks?: Record; prPriority?: number; rebaseLabel?: string; + respectLatest?: boolean; stopUpdatingLabel?: string; rebaseWhen?: string; recreateClosed?: boolean; @@ -140,16 +142,18 @@ export interface LegacyAdminConfig { requireConfig?: RequiredConfig; } + export type ExecutionMode = 'branch' | 'update'; -export type PostUpgradeTasks = { +export interface PostUpgradeTasks { commands?: string[]; fileFilters?: string[]; executionMode: ExecutionMode; -}; +} -type UpdateConfig = - Partial>; +export type UpdateConfig< + T extends RenovateSharedConfig = RenovateSharedConfig +> = Partial>; export type RenovateRepository = | string @@ -228,6 +232,8 @@ export interface RenovateConfig fetchReleaseNotes?: boolean; secrets?: Record; + + constraints?: Record; } export interface AllConfig extends RenovateConfig, GlobalOnlyConfig {} @@ -269,7 +275,8 @@ export type MergeStrategy = export interface PackageRule extends RenovateSharedConfig, UpdateConfig, - Record { + Record { + description?: string | string[]; matchFiles?: string[]; matchPaths?: string[]; matchLanguages?: string[]; @@ -287,6 +294,7 @@ export interface PackageRule matchSourceUrlPrefixes?: string[]; matchSourceUrls?: string[]; matchUpdateTypes?: UpdateType[]; + registryUrls?: string[]; } export interface ValidationMessage { diff --git a/lib/config/validation.spec.ts b/lib/config/validation.spec.ts index 1d7f3246482502..e61740dc75bb3f 100644 --- a/lib/config/validation.spec.ts +++ b/lib/config/validation.spec.ts @@ -488,7 +488,7 @@ describe('config/validation', () => { constraints: { packageRules: [{}] }, }; const { warnings, errors } = await configValidation.validateConfig( - config, + config as never, // TODO: #15963 true ); expect(warnings).toHaveLength(0); diff --git a/lib/modules/datasource/npm/npmrc.ts b/lib/modules/datasource/npm/npmrc.ts index a643ea56df2fe3..fccb2d7fd4d6a8 100644 --- a/lib/modules/datasource/npm/npmrc.ts +++ b/lib/modules/datasource/npm/npmrc.ts @@ -173,7 +173,9 @@ export function resolveRegistryUrl(packageName: string): string { !matchPackagePrefixes || packageName.startsWith(matchPackagePrefixes[0]) ) { - registryUrl = registryUrls[0]; + // TODO: fix types #7154 + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + registryUrl = registryUrls![0]; } } return registryUrl; diff --git a/lib/workers/types.ts b/lib/workers/types.ts index 8b1f69c89036c8..9abae80d8831f8 100644 --- a/lib/workers/types.ts +++ b/lib/workers/types.ts @@ -40,7 +40,6 @@ export interface BranchUpgradeConfig excludeCommitPaths?: string[]; githubName?: string; group?: GroupConfig; - constraints?: Record; groupName?: string; groupSlug?: string; language?: string; diff --git a/tools/docs/presets.ts b/tools/docs/presets.ts index 9bbfa8c8760e6e..307cb31698c25a 100644 --- a/tools/docs/presets.ts +++ b/tools/docs/presets.ts @@ -38,7 +38,7 @@ export async function generatePresets(dist: string): Promise { delete value.description; if (!presetDescription) { if (value.packageRules?.[0].description) { - presetDescription = value.packageRules[0].description; + presetDescription = value.packageRules[0].description as string; delete value.packageRules[0].description; } } From 08ed50ee8c320dcd6fe9ee8fedacf84a33d526e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Torres=20Cogollo?= Date: Thu, 9 Jun 2022 15:23:05 +0200 Subject: [PATCH 058/240] fix(changelog): extractVersion check (#15962) --- .../update/pr/changelog/release-notes.spec.ts | 84 +++++++++++++++---- .../update/pr/changelog/release-notes.ts | 16 +++- .../update/pr/changelog/source-github.ts | 2 +- .../update/pr/changelog/source-gitlab.ts | 2 +- 4 files changed, 83 insertions(+), 21 deletions(-) diff --git a/lib/workers/repository/update/pr/changelog/release-notes.spec.ts b/lib/workers/repository/update/pr/changelog/release-notes.spec.ts index 226cfb3dd6c792..c138e0d9d0d82c 100644 --- a/lib/workers/repository/update/pr/changelog/release-notes.spec.ts +++ b/lib/workers/repository/update/pr/changelog/release-notes.spec.ts @@ -5,6 +5,7 @@ import { CacheableGithubReleases } from '../../../../../modules/datasource/githu import { clone } from '../../../../../util/clone'; import * as _hostRules from '../../../../../util/host-rules'; import { toBase64 } from '../../../../../util/string'; +import type { BranchUpgradeConfig } from '../../../../types'; import { addReleaseNotes, getReleaseList, @@ -94,9 +95,16 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { describe('addReleaseNotes()', () => { it('returns input if invalid', async () => { const input = { a: 1 }; - expect(await addReleaseNotes(input as never)).toEqual(input); - expect(await addReleaseNotes(null)).toBeNull(); - expect(await addReleaseNotes({ versions: [] } as never)).toStrictEqual({ + expect( + await addReleaseNotes(input as never, {} as BranchUpgradeConfig) + ).toEqual(input); + expect(await addReleaseNotes(null, {} as BranchUpgradeConfig)).toBeNull(); + expect( + await addReleaseNotes( + { versions: [] } as never, + {} as BranchUpgradeConfig + ) + ).toStrictEqual({ versions: [], }); }); @@ -110,7 +118,9 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { }, versions: [{ version: '3.10.0', compare: { url: '' } }], }; - expect(await addReleaseNotes(input as never)).toEqual({ + expect( + await addReleaseNotes(input as never, {} as BranchUpgradeConfig) + ).toEqual({ a: 1, hasReleaseNotes: false, project: { @@ -140,7 +150,7 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { { version: '20.26.0', compare: { url: '' } } as ChangeLogRelease, ], } as ChangeLogResult; - expect(await addReleaseNotes(input)).toEqual({ + expect(await addReleaseNotes(input, {} as BranchUpgradeConfig)).toEqual({ a: 1, hasReleaseNotes: false, project: { @@ -280,7 +290,8 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { { version: '1.0.0', gitRef: '1.0.0', - } as ChangeLogRelease + } as ChangeLogRelease, + {} as BranchUpgradeConfig ); expect(res).toBeNull(); }); @@ -303,7 +314,8 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { { version: '1.0.1', gitRef: '1.0.1', - } as ChangeLogRelease + } as ChangeLogRelease, + {} as BranchUpgradeConfig ); expect(res).toEqual({ body: 'some body [#123](https://github.com/some/other-repository/issues/123), [#124](https://github.com/some/yet-other-repository/issues/124)\n', @@ -334,7 +346,8 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { { version: '1.0.1', gitRef: '1.0.1', - } as ChangeLogRelease + } as ChangeLogRelease, + {} as BranchUpgradeConfig ); expect(res).toEqual({ body: 'some body [#123](https://github.com/some/other-repository/issues/123), [#124](https://github.com/some/yet-other-repository/issues/124)\n', @@ -366,7 +379,8 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { { version: '1.0.1', gitRef: '1.0.1', - } as ChangeLogRelease + } as ChangeLogRelease, + {} as BranchUpgradeConfig ); expect(res).toEqual({ body: 'some body [#123](https://github.com/some/other-repository/issues/123), [#124](https://github.com/some/yet-other-repository/issues/124)\n', @@ -398,7 +412,8 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { { version: '1.0.1', gitRef: '1.0.1', - } as ChangeLogRelease + } as ChangeLogRelease, + {} as BranchUpgradeConfig ); expect(res).toEqual({ body: 'some body [#123](https://github.com/some/other-repository/issues/123), [#124](https://github.com/some/yet-other-repository/issues/124)\n', @@ -429,7 +444,8 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { { version: '1.0.1', gitRef: '1.0.1', - } as ChangeLogRelease + } as ChangeLogRelease, + {} as BranchUpgradeConfig ); expect(res).toEqual({ body: 'some body [#123](https://github.com/some/other-repository/issues/123), [#124](https://github.com/some/yet-other-repository/issues/124)\n', @@ -466,7 +482,8 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { { version: '1.0.1', gitRef: '1.0.1', - } as ChangeLogRelease + } as ChangeLogRelease, + {} as BranchUpgradeConfig ); expect(res).toEqual({ body: 'some body #123, [#124](https://gitlab.com/some/yet-other-repository/issues/124)', @@ -502,7 +519,8 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { { version: '1.0.1', gitRef: '1.0.1', - } as ChangeLogRelease + } as ChangeLogRelease, + {} as BranchUpgradeConfig ); expect(res).toEqual({ body: 'some body #123, [#124](https://gitlab.com/some/yet-other-repository/issues/124)', @@ -538,7 +556,8 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { { version: '1.0.1', gitRef: '1.0.1', - } as ChangeLogRelease + } as ChangeLogRelease, + {} as BranchUpgradeConfig ); expect(res).toEqual({ body: 'some body #123, [#124](https://gitlab.com/some/yet-other-repository/issues/124)', @@ -561,7 +580,8 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { { version: '1.0.1', gitRef: '1.0.1', - } as ChangeLogRelease + } as ChangeLogRelease, + {} as BranchUpgradeConfig ); expect(res).toBeNull(); }); @@ -588,7 +608,8 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { { version: '1.0.0', gitRef: '1.0.0', - } as ChangeLogRelease + } as ChangeLogRelease, + {} as BranchUpgradeConfig ); expect(res).toEqual({ url: 'correct/url/tag.com', @@ -600,6 +621,37 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { body: 'some body\n', }); }); + + it('fallback to extractVersion', async () => { + githubReleasesMock.mockResolvedValueOnce([ + { + version: `app-1.0.0`, + url: 'correct/url/tag.com', + description: 'some body', + }, + ] as never); + const res = await getReleaseNotes( + { + ...githubProject, + repository: 'some/other-repository', + depName: 'exampleDep', + }, + { + version: '1.0.0', + gitRef: '1.0.0', + } as ChangeLogRelease, + { extractVersion: 'app-(?[0-9.]*)' } as BranchUpgradeConfig + ); + expect(res).toEqual({ + url: 'correct/url/tag.com', + notesSourceUrl: + 'https://api.github.com/repos/some/other-repository/releases', + id: undefined, + tag: 'app-1.0.0', + name: undefined, + body: 'some body\n', + }); + }); }); describe('getReleaseNotesMd()', () => { diff --git a/lib/workers/repository/update/pr/changelog/release-notes.ts b/lib/workers/repository/update/pr/changelog/release-notes.ts index 616f4f63161b3d..561b8411923656 100644 --- a/lib/workers/repository/update/pr/changelog/release-notes.ts +++ b/lib/workers/repository/update/pr/changelog/release-notes.ts @@ -7,6 +7,7 @@ import * as memCache from '../../../../../util/cache/memory'; import * as packageCache from '../../../../../util/cache/package'; import { linkify } from '../../../../../util/markdown'; import { newlineRegex, regEx } from '../../../../../util/regex'; +import type { BranchUpgradeConfig } from '../../../../types'; import * as github from './github'; import * as gitlab from './gitlab'; import type { @@ -96,7 +97,8 @@ export function massageBody( export async function getReleaseNotes( project: ChangeLogProject, - release: ChangeLogRelease + release: ChangeLogRelease, + config: BranchUpgradeConfig ): Promise { const { depName, repository } = project; const { version, gitRef } = release; @@ -116,6 +118,13 @@ export async function getReleaseNotes( r.tag === `v${gitRef}` ); } + if (is.undefined(matchedRelease) && config.extractVersion) { + const extractVersionRegEx = regEx(config.extractVersion); + matchedRelease = releases.find((r) => { + const extractedVersion = extractVersionRegEx.exec(r.tag)?.groups?.version; + return version === extractedVersion; + }); + } releaseNotes = await releaseNotesResult(matchedRelease, project); logger.trace({ releaseNotes }); return releaseNotes; @@ -360,7 +369,8 @@ export function releaseNotesCacheMinutes(releaseDate?: string | Date): number { } export async function addReleaseNotes( - input: ChangeLogResult + input: ChangeLogResult, + config: BranchUpgradeConfig ): Promise { if (!input?.versions || !input.project?.type) { logger.debug('Missing project or versions'); @@ -383,7 +393,7 @@ export async function addReleaseNotes( releaseNotes = await getReleaseNotesMd(input.project, v); // istanbul ignore else: should be tested if (!releaseNotes) { - releaseNotes = await getReleaseNotes(input.project, v); + releaseNotes = await getReleaseNotes(input.project, v, config); } // Small hack to force display of release notes when there is a compare url if (!releaseNotes && v.compare.url) { diff --git a/lib/workers/repository/update/pr/changelog/source-github.ts b/lib/workers/repository/update/pr/changelog/source-github.ts index 474ae3a46804c4..2dbd02457d722c 100644 --- a/lib/workers/repository/update/pr/changelog/source-github.ts +++ b/lib/workers/repository/update/pr/changelog/source-github.ts @@ -177,7 +177,7 @@ export async function getChangeLogJSON( versions: changelogReleases, }; - res = await addReleaseNotes(res); + res = await addReleaseNotes(res, config); return res; } diff --git a/lib/workers/repository/update/pr/changelog/source-gitlab.ts b/lib/workers/repository/update/pr/changelog/source-gitlab.ts index 679d7836a7eb1c..1775f8e91ac79c 100644 --- a/lib/workers/repository/update/pr/changelog/source-gitlab.ts +++ b/lib/workers/repository/update/pr/changelog/source-gitlab.ts @@ -145,7 +145,7 @@ export async function getChangeLogJSON( versions: changelogReleases, }; - res = await addReleaseNotes(res); + res = await addReleaseNotes(res, config); return res; } From d02b9cdb5cef9004b6c159ed225a8b35206e96c7 Mon Sep 17 00:00:00 2001 From: Gabriel-Ladzaretti <97394622+Gabriel-Ladzaretti@users.noreply.github.com> Date: Thu, 9 Jun 2022 16:33:18 +0300 Subject: [PATCH 059/240] refactor: clean up recently modified tools/docs/config.ts (#15966) --- tools/docs/config.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/docs/config.ts b/tools/docs/config.ts index 7d1dc26bc76908..b65f93d71831c4 100644 --- a/tools/docs/config.ts +++ b/tools/docs/config.ts @@ -28,12 +28,9 @@ function genTable(obj: [string, string][], type: string, def: any): string { } if ( !ignoredKeys.includes(el[0]) || - (el[0] === 'default' && typeof el[1] !== 'object' && name !== 'prBody') || - // only show array and object defaults if they are not null and are not empty (el[0] === 'default' && - (type === 'array' || type === 'object') && - el[1] !== null && - Object.keys(el[1]).length > 0) + (typeof el[1] !== 'object' || ['array', 'object'].includes(type)) && + name !== 'prBody') ) { if (type === 'string' && el[0] === 'default') { el[1] = `\`"${el[1]}"\``; @@ -50,6 +47,10 @@ function genTable(obj: [string, string][], type: string, def: any): string { } // objects and arrays should be printed in JSON notation if ((type === 'object' || type === 'array') && el[0] === 'default') { + // only show array and object defaults if they are not null and are not empty + if (Object.keys(el[1] ?? []).length === 0) { + return; + } el[1] = `\`${JSON.stringify(el[1])}\``; } data.push(el); From 953ef18e8790954919c30c0ea8adb08157114fee Mon Sep 17 00:00:00 2001 From: Dominic Seitz Date: Thu, 9 Jun 2022 15:48:40 +0200 Subject: [PATCH 060/240] feat(gitea): Support gitUrl (#14947) * feat: Support gitUrl on gitea platform * refactor: use query token instead of auth header * refactor: debug message style * refactor: use url property query * refactor: use basic http auth for gitea * test: add gitea tests for gitUrl property * refactor: capitalising abbreviations Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> * refactor: move getRepoUrl to utils * fix: add missing property ssh_url to fix linting * fix: utils strict mode issues * Merge branch 'main' into main * refactor: use endpoint without api path slicing * refactor: use different null check * refactor: make urls optional Co-authored-by: Michael Kriese * test: prettier fix * test: update test * refactor: throw error if clone_url is missing * test: refactor empty clone_url test * refactor: change empty clone_url logic * refactor: change imports Co-authored-by: Michael Kriese * test: add token tests * refactor: replace deprecated url module * refactor: add null checks * test: add tests for null checks * test: use host rule implementation instead of mock * refactor: remove explicit typing Co-authored-by: Michael Kriese * test: update mocking Co-authored-by: Michael Kriese * test: change dynamic imports * Update lib/modules/platform/gitea/utils.ts Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Co-authored-by: Michael Kriese Co-authored-by: Rhys Arkins --- .../platform/gitea/gitea-helper.spec.ts | 1 + lib/modules/platform/gitea/gitea-helper.ts | 3 +- lib/modules/platform/gitea/index.spec.ts | 168 +++++++++++++++++- lib/modules/platform/gitea/index.ts | 15 +- lib/modules/platform/gitea/utils.spec.ts | 27 ++- lib/modules/platform/gitea/utils.ts | 54 ++++++ 6 files changed, 252 insertions(+), 16 deletions(-) diff --git a/lib/modules/platform/gitea/gitea-helper.spec.ts b/lib/modules/platform/gitea/gitea-helper.spec.ts index 7d82268dc6f96f..d67aed8b1a3391 100644 --- a/lib/modules/platform/gitea/gitea-helper.spec.ts +++ b/lib/modules/platform/gitea/gitea-helper.spec.ts @@ -30,6 +30,7 @@ describe('modules/platform/gitea/gitea-helper', () => { allow_merge_commits: true, allow_squash_merge: true, clone_url: 'https://gitea.renovatebot.com/some/repo.git', + ssh_url: 'git@gitea.renovatebot.com/some/repo.git', default_branch: 'master', full_name: 'some/repo', archived: false, diff --git a/lib/modules/platform/gitea/gitea-helper.ts b/lib/modules/platform/gitea/gitea-helper.ts index 1a0b5e30411dff..ec257948d5ebbf 100644 --- a/lib/modules/platform/gitea/gitea-helper.ts +++ b/lib/modules/platform/gitea/gitea-helper.ts @@ -64,7 +64,8 @@ export interface Repo { allow_rebase_explicit: boolean; allow_squash_merge: boolean; archived: boolean; - clone_url: string; + clone_url?: string; + ssh_url?: string; default_branch: string; empty: boolean; fork: boolean; diff --git a/lib/modules/platform/gitea/index.spec.ts b/lib/modules/platform/gitea/index.spec.ts index c2edace2c2dc5f..0e8582b100b368 100644 --- a/lib/modules/platform/gitea/index.spec.ts +++ b/lib/modules/platform/gitea/index.spec.ts @@ -5,8 +5,10 @@ import type { RepoParams, RepoResult, } from '..'; -import { partial } from '../../../../test/util'; +import { mocked, partial } from '../../../../test/util'; +import { PlatformId } from '../../../constants'; import { + CONFIG_GIT_URL_UNAVAILABLE, REPOSITORY_ACCESS_FORBIDDEN, REPOSITORY_ARCHIVED, REPOSITORY_BLOCKED, @@ -31,6 +33,7 @@ describe('modules/platform/gitea/index', () => { let helper: jest.Mocked; let logger: jest.Mocked; let gitvcs: jest.Mocked; + let hostRules: jest.Mocked; const mockCommitHash = '0d9c7726c3d628b7e28af234595cfd20febdbf8e'; @@ -44,6 +47,7 @@ describe('modules/platform/gitea/index', () => { const mockRepo = partial({ allow_rebase: true, clone_url: 'https://gitea.renovatebot.com/some/repo.git', + ssh_url: 'git@gitea.renovatebot.com/some/repo.git', default_branch: 'master', full_name: 'some/repo', permissions: { @@ -172,11 +176,13 @@ describe('modules/platform/gitea/index', () => { jest.mock('../../../logger'); gitea = await import('.'); - helper = (await import('./gitea-helper')) as any; - logger = (await import('../../../logger')).logger as any; + helper = mocked(await import('./gitea-helper')); + logger = mocked((await import('../../../logger')).logger); gitvcs = require('../../../util/git'); gitvcs.isBranchStale.mockResolvedValue(false); gitvcs.getBranchCommit.mockReturnValue(mockCommitHash); + hostRules = mocked(await import('../../../util/host-rules')); + hostRules.clear(); setBaseUrl('https://gitea.renovatebot.com/'); }); @@ -338,6 +344,162 @@ describe('modules/platform/gitea/index', () => { }) ).toMatchSnapshot(); }); + + it('should use clone_url of repo if gitUrl is not specified', async () => { + expect.assertions(1); + + helper.getRepo.mockResolvedValueOnce(mockRepo); + const repoCfg: RepoParams = { + repository: mockRepo.full_name, + }; + await gitea.initRepo(repoCfg); + + expect(gitvcs.initRepo).toHaveBeenCalledWith( + expect.objectContaining({ url: mockRepo.clone_url }) + ); + }); + + it('should use clone_url of repo if gitUrl has value default', async () => { + expect.assertions(1); + + helper.getRepo.mockResolvedValueOnce(mockRepo); + const repoCfg: RepoParams = { + repository: mockRepo.full_name, + gitUrl: 'default', + }; + await gitea.initRepo(repoCfg); + + expect(gitvcs.initRepo).toHaveBeenCalledWith( + expect.objectContaining({ url: mockRepo.clone_url }) + ); + }); + + it('should use ssh_url of repo if gitUrl has value ssh', async () => { + expect.assertions(1); + + helper.getRepo.mockResolvedValueOnce(mockRepo); + const repoCfg: RepoParams = { + repository: mockRepo.full_name, + gitUrl: 'ssh', + }; + await gitea.initRepo(repoCfg); + + expect(gitvcs.initRepo).toHaveBeenCalledWith( + expect.objectContaining({ url: mockRepo.ssh_url }) + ); + }); + + it('should abort when gitUrl has value ssh but ssh_url is empty', async () => { + expect.assertions(1); + + helper.getRepo.mockResolvedValueOnce({ ...mockRepo, ssh_url: undefined }); + const repoCfg: RepoParams = { + repository: mockRepo.full_name, + gitUrl: 'ssh', + }; + + await expect(gitea.initRepo(repoCfg)).rejects.toThrow( + CONFIG_GIT_URL_UNAVAILABLE + ); + }); + + it('should use generated url of repo if gitUrl has value endpoint', async () => { + expect.assertions(1); + + helper.getRepo.mockResolvedValueOnce(mockRepo); + const repoCfg: RepoParams = { + repository: mockRepo.full_name, + gitUrl: 'endpoint', + }; + await gitea.initRepo(repoCfg); + + expect(gitvcs.initRepo).toHaveBeenCalledWith( + expect.objectContaining({ + url: `https://gitea.com/${mockRepo.full_name}.git`, + }) + ); + }); + + it('should abort when clone_url is empty', async () => { + expect.assertions(1); + + helper.getRepo.mockResolvedValueOnce({ + ...mockRepo, + clone_url: undefined, + }); + const repoCfg: RepoParams = { + repository: mockRepo.full_name, + }; + + await expect(gitea.initRepo(repoCfg)).rejects.toThrow( + CONFIG_GIT_URL_UNAVAILABLE + ); + }); + + it('should use given access token if gitUrl has value endpoint', async () => { + expect.assertions(1); + + const token = 'abc'; + hostRules.add({ + hostType: PlatformId.Gitea, + matchHost: 'https://gitea.com/', + token, + }); + + helper.getRepo.mockResolvedValueOnce(mockRepo); + const repoCfg: RepoParams = { + repository: mockRepo.full_name, + gitUrl: 'endpoint', + }; + await gitea.initRepo(repoCfg); + + const url = new URL(`${mockRepo.clone_url}`); + url.username = token; + expect(gitvcs.initRepo).toHaveBeenCalledWith( + expect.objectContaining({ + url: `https://${token}@gitea.com/${mockRepo.full_name}.git`, + }) + ); + }); + + it('should use given access token if gitUrl is not specified', async () => { + expect.assertions(1); + + const token = 'abc'; + hostRules.add({ + hostType: PlatformId.Gitea, + matchHost: 'https://gitea.com/', + token, + }); + + helper.getRepo.mockResolvedValueOnce(mockRepo); + const repoCfg: RepoParams = { + repository: mockRepo.full_name, + }; + await gitea.initRepo(repoCfg); + + const url = new URL(`${mockRepo.clone_url}`); + url.username = token; + expect(gitvcs.initRepo).toHaveBeenCalledWith( + expect.objectContaining({ url: url.toString() }) + ); + }); + + it('should abort when clone_url is not valid', async () => { + expect.assertions(1); + + helper.getRepo.mockResolvedValueOnce({ + ...mockRepo, + clone_url: 'abc', + }); + const repoCfg: RepoParams = { + repository: mockRepo.full_name, + }; + + await expect(gitea.initRepo(repoCfg)).rejects.toThrow( + CONFIG_GIT_URL_UNAVAILABLE + ); + }); }); describe('setBranchStatus', () => { diff --git a/lib/modules/platform/gitea/index.ts b/lib/modules/platform/gitea/index.ts index 29842a7937927d..97e437db5eb3b7 100644 --- a/lib/modules/platform/gitea/index.ts +++ b/lib/modules/platform/gitea/index.ts @@ -1,4 +1,3 @@ -import URL from 'url'; import is from '@sindresorhus/is'; import JSON5 from 'json5'; import semver from 'semver'; @@ -14,7 +13,6 @@ import { import { logger } from '../../../logger'; import { BranchStatus, PrState, VulnerabilityAlert } from '../../../types'; import * as git from '../../../util/git'; -import * as hostRules from '../../../util/host-rules'; import { setBaseUrl } from '../../../util/http/gitea'; import { sanitize } from '../../../util/sanitize'; import { ensureTrailingSlash } from '../../../util/url'; @@ -38,7 +36,7 @@ import type { } from '../types'; import { smartTruncate } from '../utils/pr-body'; import * as helper from './gitea-helper'; -import { smartLinks, trimTrailingApiPath } from './utils'; +import { getRepoUrl, smartLinks, trimTrailingApiPath } from './utils'; interface GiteaRepoConfig { repository: string; @@ -240,6 +238,7 @@ const platform: Platform = { async initRepo({ repository, cloneSubmodules, + gitUrl, }: RepoParams): Promise { let repo: helper.Repo; @@ -298,18 +297,12 @@ const platform: Platform = { config.defaultBranch = repo.default_branch; logger.debug(`${repository} default branch = ${config.defaultBranch}`); - // Find options for current host and determine Git endpoint - const opts = hostRules.find({ - hostType: PlatformId.Gitea, - url: defaults.endpoint, - }); - const gitEndpoint = URL.parse(repo.clone_url); - gitEndpoint.auth = opts.token ?? null; + const url = getRepoUrl(repo, gitUrl, defaults.endpoint); // Initialize Git storage await git.initRepo({ ...config, - url: URL.format(gitEndpoint), + url, }); // Reset cached resources diff --git a/lib/modules/platform/gitea/utils.spec.ts b/lib/modules/platform/gitea/utils.spec.ts index a091434e5f7832..f7982d4c6dc339 100644 --- a/lib/modules/platform/gitea/utils.spec.ts +++ b/lib/modules/platform/gitea/utils.spec.ts @@ -1,6 +1,22 @@ -import { trimTrailingApiPath } from './utils'; +import { partial } from '../../../../test/util'; +import { CONFIG_GIT_URL_UNAVAILABLE } from '../../../constants/error-messages'; +import type { Repo } from './gitea-helper'; +import { getRepoUrl, trimTrailingApiPath } from './utils'; describe('modules/platform/gitea/utils', () => { + const mockRepo = partial({ + allow_rebase: true, + clone_url: 'https://gitea.renovatebot.com/some/repo.git', + ssh_url: 'git@gitea.renovatebot.com/some/repo.git', + default_branch: 'master', + full_name: 'some/repo', + permissions: { + pull: true, + push: true, + admin: false, + }, + }); + it('trimTrailingApiPath', () => { expect(trimTrailingApiPath('https://gitea.renovatebot.com/api/v1')).toBe( 'https://gitea.renovatebot.com/' @@ -18,4 +34,13 @@ describe('modules/platform/gitea/utils', () => { trimTrailingApiPath('https://gitea.renovatebot.com/api/gitea/api/v1') ).toBe('https://gitea.renovatebot.com/api/gitea/'); }); + + describe('getRepoUrl', () => { + it('should abort when endpoint is not valid', () => { + expect.assertions(1); + expect(() => getRepoUrl(mockRepo, 'endpoint', 'abc')).toThrow( + CONFIG_GIT_URL_UNAVAILABLE + ); + }); + }); }); diff --git a/lib/modules/platform/gitea/utils.ts b/lib/modules/platform/gitea/utils.ts index 927ce0a395bd3e..5a119a5c474b85 100644 --- a/lib/modules/platform/gitea/utils.ts +++ b/lib/modules/platform/gitea/utils.ts @@ -1,4 +1,11 @@ +import { PlatformId } from '../../../constants'; +import { CONFIG_GIT_URL_UNAVAILABLE } from '../../../constants/error-messages'; +import { logger } from '../../../logger'; +import * as hostRules from '../../../util/host-rules'; import { regEx } from '../../../util/regex'; +import { parseUrl } from '../../../util/url'; +import type { GitUrlOption } from '../types'; +import type { Repo } from './gitea-helper'; export function smartLinks(body: string): string { return body?.replace(regEx(/\]\(\.\.\/pull\//g), '](pulls/'); @@ -7,3 +14,50 @@ export function smartLinks(body: string): string { export function trimTrailingApiPath(url: string): string { return url?.replace(regEx(/api\/v1\/?$/g), ''); } + +export function getRepoUrl( + repo: Repo, + gitUrl: GitUrlOption | undefined, + endpoint: string +): string { + if (gitUrl === 'ssh') { + if (!repo.ssh_url) { + throw new Error(CONFIG_GIT_URL_UNAVAILABLE); + } + logger.debug({ url: repo.ssh_url }, `using SSH URL`); + return repo.ssh_url; + } + + // Find options for current host and determine Git endpoint + const opts = hostRules.find({ + hostType: PlatformId.Gitea, + url: endpoint, + }); + + if (gitUrl === 'endpoint') { + const url = parseUrl(endpoint); + if (!url) { + throw new Error(CONFIG_GIT_URL_UNAVAILABLE); + } + url.protocol = url.protocol?.slice(0, -1) ?? 'https'; + url.username = opts.token ?? ''; + url.pathname = `${url.pathname}${repo.full_name}.git`; + logger.debug( + { url: url.toString() }, + 'using URL based on configured endpoint' + ); + return url.toString(); + } + + if (!repo.clone_url) { + throw new Error(CONFIG_GIT_URL_UNAVAILABLE); + } + + logger.debug({ url: repo.clone_url }, `using HTTP URL`); + const repoUrl = parseUrl(repo.clone_url); + if (!repoUrl) { + throw new Error(CONFIG_GIT_URL_UNAVAILABLE); + } + repoUrl.username = opts.token ?? ''; + return repoUrl.toString(); +} From d81c9a1072cbcf2f0ff84ce599daa8009bcd1dc0 Mon Sep 17 00:00:00 2001 From: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Date: Thu, 9 Jun 2022 15:49:47 +0200 Subject: [PATCH 061/240] chore: delete prettifier.yml (#15972) --- .github/prettifier.yml | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 .github/prettifier.yml diff --git a/.github/prettifier.yml b/.github/prettifier.yml deleted file mode 100644 index f05a3bc764aae2..00000000000000 --- a/.github/prettifier.yml +++ /dev/null @@ -1,4 +0,0 @@ -commitMessage: 'Apply prettier formatting fix' -excludeBranches: - - main -pullsOnly: true From 5cfa1f07ed1ef0b52a501c368e542fa3c05fab91 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 9 Jun 2022 20:33:52 +0000 Subject: [PATCH 062/240] build(deps): update dependency cacache to v16.1.1 (#15980) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 32 ++++---------------------------- 2 files changed, 5 insertions(+), 29 deletions(-) diff --git a/package.json b/package.json index cca6b0565f2ef8..b26c6ccf1b4bf5 100644 --- a/package.json +++ b/package.json @@ -147,7 +147,7 @@ "auth-header": "1.0.0", "azure-devops-node-api": "11.1.1", "bunyan": "1.8.15", - "cacache": "16.1.0", + "cacache": "16.1.1", "chalk": "4.1.2", "changelog-filename-regex": "2.0.1", "clean-git-ref": "2.0.1", diff --git a/yarn.lock b/yarn.lock index f256b3346f2fc2..84be33e7709eab 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3398,10 +3398,10 @@ bunyan@1.8.15: mv "~2" safe-json-stringify "~1" -cacache@16.1.0: - version "16.1.0" - resolved "https://registry.yarnpkg.com/cacache/-/cacache-16.1.0.tgz#87a6bae558a511c9cb2a13768073e240ca76153a" - integrity sha512-Pk4aQkwCW82A4jGKFvcGkQFqZcMspfP9YWq9Pr87/ldDvlWf718zeI6KWCdKt/jeihu6BytHRUicJPB1K2k8EQ== +cacache@16.1.1, cacache@^16.0.0, cacache@^16.0.6, cacache@^16.1.0: + version "16.1.1" + resolved "https://registry.yarnpkg.com/cacache/-/cacache-16.1.1.tgz#4e79fb91d3efffe0630d5ad32db55cc1b870669c" + integrity sha512-VDKN+LHyCQXaaYZ7rA/qtkURU+/yYhviUdvqEv2LT6QPZU8jpyzEkEVAcKlKLt5dJ5BRp11ym8lo3NKLluEPLg== dependencies: "@npmcli/fs" "^2.1.0" "@npmcli/move-file" "^2.0.0" @@ -3446,30 +3446,6 @@ cacache@^15.2.0: tar "^6.0.2" unique-filename "^1.1.1" -cacache@^16.0.0, cacache@^16.0.6, cacache@^16.1.0: - version "16.1.1" - resolved "https://registry.yarnpkg.com/cacache/-/cacache-16.1.1.tgz#4e79fb91d3efffe0630d5ad32db55cc1b870669c" - integrity sha512-VDKN+LHyCQXaaYZ7rA/qtkURU+/yYhviUdvqEv2LT6QPZU8jpyzEkEVAcKlKLt5dJ5BRp11ym8lo3NKLluEPLg== - dependencies: - "@npmcli/fs" "^2.1.0" - "@npmcli/move-file" "^2.0.0" - chownr "^2.0.0" - fs-minipass "^2.1.0" - glob "^8.0.1" - infer-owner "^1.0.4" - lru-cache "^7.7.1" - minipass "^3.1.6" - minipass-collect "^1.0.2" - minipass-flush "^1.0.5" - minipass-pipeline "^1.2.4" - mkdirp "^1.0.4" - p-map "^4.0.0" - promise-inflight "^1.0.1" - rimraf "^3.0.2" - ssri "^9.0.0" - tar "^6.1.11" - unique-filename "^1.1.1" - cacheable-lookup@^5.0.3: version "5.0.4" resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz#5a6b865b2c44357be3d5ebc2a467b032719a7005" From d28324a517774c762ec80d1be93ae3f6a07e2b55 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Fri, 10 Jun 2022 05:31:33 +0200 Subject: [PATCH 063/240] docs: update best practices (#15960) --- docs/development/best-practices.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/development/best-practices.md b/docs/development/best-practices.md index be42045a5d30b2..5bfc410ee2c7e9 100644 --- a/docs/development/best-practices.md +++ b/docs/development/best-practices.md @@ -6,6 +6,7 @@ Follow these best practices when you're working on our code. ## General - Prefer full function declarations for readability and better stack traces, so avoid `const func = ():void => {}` +- Prefer `interface` over `type` for TypeScript type declarations - Avoid [Enums](https://github.com/renovatebot/renovate/issues/13743), use union or [immutable objects](https://github.com/renovatebot/renovate/blob/5043379847818ac1fa71ff69c098451975e95710/lib/modules/versioning/pep440/range.ts#L8-L20) instead - Always add unit tests for full code coverage - Only use `istanbul` comments for unreachable code coverage that is needed for `codecov` completion From 0496610fe49bd327eb39ea7b4631b3eca63dbd16 Mon Sep 17 00:00:00 2001 From: Johannes Feichtner Date: Fri, 10 Jun 2022 05:56:32 +0200 Subject: [PATCH 064/240] feat(gradle): add support for simple extra properties (#15983) --- lib/modules/manager/gradle/parser.spec.ts | 1 + lib/modules/manager/gradle/parser.ts | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/lib/modules/manager/gradle/parser.spec.ts b/lib/modules/manager/gradle/parser.spec.ts index 79d660d319f836..4d1ae35d48df80 100644 --- a/lib/modules/manager/gradle/parser.spec.ts +++ b/lib/modules/manager/gradle/parser.spec.ts @@ -19,6 +19,7 @@ describe('modules/manager/gradle/parser', () => { ${'version = "1.2.3"'} | ${'version'} | ${'1.2.3'} ${'set("version", "1.2.3")'} | ${'version'} | ${'1.2.3'} ${'versions.foobar = "1.2.3"'} | ${'versions.foobar'} | ${'1.2.3'} + ${'ext.foo.bar = "1.2.3"'} | ${'foo.bar'} | ${'1.2.3'} `('$input', ({ input, name, value }) => { const { vars } = parseGradle(input); expect(vars).toContainKey(name); diff --git a/lib/modules/manager/gradle/parser.ts b/lib/modules/manager/gradle/parser.ts index 6ecb2daf9d2eb6..3c266264f9151a 100644 --- a/lib/modules/manager/gradle/parser.ts +++ b/lib/modules/manager/gradle/parser.ts @@ -387,6 +387,18 @@ function processLibraryDep(input: SyntaxHandlerInput): SyntaxHandlerOutput { } const matcherConfigs: SyntaxMatchConfig[] = [ + { + // ext.foo.bar = 'baz' + matchers: [ + { matchType: TokenType.Word, matchValue: 'ext' }, + { matchType: TokenType.Dot }, + { matchType: TokenType.Word, tokenMapKey: 'keyToken' }, + { matchType: TokenType.Assignment }, + { matchType: TokenType.String, tokenMapKey: 'valToken' }, + endOfInstruction, + ], + handler: handleAssignment, + }, { // foo.bar = 'baz' matchers: [ From 4a177c80788c3fa181f59a5de96e5ac89d25d286 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Fri, 10 Jun 2022 06:31:41 +0200 Subject: [PATCH 065/240] feat(preset): add SkiaSharp monorepo (#15970) --- lib/config/presets/internal/monorepo.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/config/presets/internal/monorepo.ts b/lib/config/presets/internal/monorepo.ts index f83fb4c2a5b9c4..b2606b085ca6ae 100644 --- a/lib/config/presets/internal/monorepo.ts +++ b/lib/config/presets/internal/monorepo.ts @@ -197,6 +197,7 @@ const repoGroups = { springfox: 'https://github.com/springfox/springfox', sanity: 'https://github.com/sanity-io/sanity', 'sendgrid-nodejs': 'https://github.com/sendgrid/sendgrid-nodejs', + skiasharp: 'https://github.com/mono/SkiaSharp', steeltoe: 'https://github.com/SteeltoeOSS/steeltoe', storybook: 'https://github.com/storybookjs/storybook', strapi: 'https://github.com/strapi/strapi', From 824ef05cd785169e31ccb83be88eb898ca44a859 Mon Sep 17 00:00:00 2001 From: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Date: Fri, 10 Jun 2022 06:38:00 +0200 Subject: [PATCH 066/240] chore: update link to semantic commit bot repo (#15967) --- .github/semantic.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/semantic.yml b/.github/semantic.yml index bb5b6756684e9b..2fc06025d2737f 100644 --- a/.github/semantic.yml +++ b/.github/semantic.yml @@ -1,4 +1,4 @@ -# Semantic Commit bot: https://github.com/zeke/semantic-pull-requests +# Semantic Commit bot: https://github.com/Ezard/semantic-prs # Always validate the PR title, and ignore the commits titleOnly: true From a52b5f49b3d592da28c6e77d1be6da475b6f4b17 Mon Sep 17 00:00:00 2001 From: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Date: Fri, 10 Jun 2022 06:47:40 +0200 Subject: [PATCH 067/240] docs(kustomize): rewrite readme (#15940) --- lib/modules/manager/kustomize/readme.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/modules/manager/kustomize/readme.md b/lib/modules/manager/kustomize/readme.md index 47185687d332f3..ed665229dc393d 100644 --- a/lib/modules/manager/kustomize/readme.md +++ b/lib/modules/manager/kustomize/readme.md @@ -1,19 +1,19 @@ -This package will manage the following parts of the `kustomization.yaml` file: +Renovate can manage these parts of the `kustomization.yaml` file: 1. [remote resources](https://github.com/kubernetes-sigs/kustomize/blob/master/examples/remoteBuild.md) -2. [image tags](https://github.com/kubernetes-sigs/kustomize/blob/master/examples/image.md) -3. [components](https://github.com/kubernetes-sigs/kustomize/blob/master/examples/components.md) -4. [helm charts](https://github.com/kubernetes-sigs/kustomize/blob/master/examples/chart.md) -5. [remote bases](https://github.com/kubernetes-sigs/kustomize/blob/master/examples/remoteBuild.md) (deprecated since kustomize v2.1.0) +1. [image tags](https://github.com/kubernetes-sigs/kustomize/blob/master/examples/image.md) +1. [components](https://github.com/kubernetes-sigs/kustomize/blob/master/examples/components.md) +1. [helm charts](https://github.com/kubernetes-sigs/kustomize/blob/master/examples/chart.md) +1. [remote bases](https://github.com/kubernetes-sigs/kustomize/blob/master/examples/remoteBuild.md) (deprecated since Kustomize `v2.1.0`) **How It Works** -1. Renovate will search each repository for any `kustomization.yaml` files. -2. Existing dependencies will be extracted from remote bases, image tags & Helm charts -3. Renovate will resolve the dependency's source repository and check for SemVer tags if found. -4. If an update was found, Renovate will update `kustomization.yaml` +1. Renovate searches in each repository for any `kustomization.yaml` files +1. Dependencies are extracted from remote bases, image tags and Helm charts +1. Renovate resolves the dependency's source repository and checks if there are SemVer tags +1. If Renovate finds an update, then it updates the `kustomization.yaml` file -This manager uses three `depType`s to allow a fine-grained control of which dependencies are upgraded: +This manager uses three `depType`s to allow fine-grained control of which dependencies are upgraded: - Component - Kustomization @@ -21,7 +21,7 @@ This manager uses three `depType`s to allow a fine-grained control of which depe **Limitations** -- Currently this hasn't been tested using HTTPS to fetch the repos +- Using HTTPS to fetch the repositories is not tested - The keys for the image tags can be in any order ```yaml From 49e3aff78b838b5ebb53f4d61be7590cc429b64a Mon Sep 17 00:00:00 2001 From: Philip <42116482+PhilipAbed@users.noreply.github.com> Date: Fri, 10 Jun 2022 07:48:06 +0300 Subject: [PATCH 068/240] docs: update best practices regex groups + windows clrf + exporting test functions (#15969) --- docs/development/best-practices.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/development/best-practices.md b/docs/development/best-practices.md index 5bfc410ee2c7e9..d5f5327aecacb6 100644 --- a/docs/development/best-practices.md +++ b/docs/development/best-practices.md @@ -135,6 +135,7 @@ Use `UTC` to be time zone independent. - Avoid `toMatchSnapshot`, only use it for: - huge strings like the Renovate PR body text - huge complex objects where you only need to test parts +- Avoid exporting functions purely for the purpose of testing unless you really need to ### Fixtures @@ -164,3 +165,12 @@ Use [JSDoc](https://jsdoc.app/index.html) to declare types and function prototyp - Omit constructors when defining Static classes - [No `#private` fields](https://google.github.io/styleguide/tsguide.html#private-fields). instead, use TypeScript's visibility annotations - Avoid underscore suffixes or prefixes, for example: `_prop`, use [whole words](https://google.github.io/styleguide/tsguide.html#properties-used-outside-of-class-lexical-scope) as suffix/prefix i.e. `internalProp` + +### regex + +Use [Named Capturing Groups](https://www.regular-expressions.info/named.html) when capturing multiple groups, for example: `(?CapturedGroup)`. + +### Windows + +We recommend you set [`core.autocrlf = input`](https://git-scm.com/docs/gitattributes#_text) in your `gitConfig`, or the carriage return `\r\n` might confuse Renovate bot. +You can also set the line endings in your repository by adding `* text=auto eol=lf` to your `.gitattributes` file. From 04e789c6da29537a633328685225f57f81ff8adf Mon Sep 17 00:00:00 2001 From: Gabriel-Ladzaretti <97394622+Gabriel-Ladzaretti@users.noreply.github.com> Date: Fri, 10 Jun 2022 07:48:51 +0300 Subject: [PATCH 069/240] docs: add per manager known list of issues (#15956) --- tools/docs/github-query-items.ts | 16 +++++ tools/docs/manager.ts | 120 +++++++++++++++++++++++++++++++ 2 files changed, 136 insertions(+) create mode 100644 tools/docs/github-query-items.ts diff --git a/tools/docs/github-query-items.ts b/tools/docs/github-query-items.ts new file mode 100644 index 00000000000000..f9668ce59bbe18 --- /dev/null +++ b/tools/docs/github-query-items.ts @@ -0,0 +1,16 @@ +export type GithubApiQueryResponse = { + total_count: number; + incomplete_results: boolean; + items: ItemsEntity[]; +}; + +export type ItemsEntity = { + html_url: string; + number: number; + title: string; + labels: LabelsEntity[]; +}; + +export type LabelsEntity = { + name: string; +}; diff --git a/tools/docs/manager.ts b/tools/docs/manager.ts index b8bb426982b174..d6cb9955927907 100644 --- a/tools/docs/manager.ts +++ b/tools/docs/manager.ts @@ -1,8 +1,29 @@ +import { DateTime } from 'luxon'; import type { RenovateConfig } from '../../lib/config/types'; +import { logger } from '../../lib/logger'; import { getManagers } from '../../lib/modules/manager'; +import * as hostRules from '../../lib/util/host-rules'; +import { GithubHttp } from '../../lib/util/http/github'; +import { getQueryString } from '../../lib/util/url'; import { readFile, updateFile } from '../utils'; +import type { GithubApiQueryResponse, ItemsEntity } from './github-query-items'; import { getDisplayName, getNameWithUrl, replaceContent } from './utils'; +const gitHubApiUrl = 'https://api.github.com/search/issues?'; + +if (process.env.GITHUB_TOKEN) { + logger.debug('Using GITHUB_TOKEN from env'); + hostRules.add({ + matchHost: 'api.github.com', + token: process.env.GITHUB_TOKEN, + }); +} + +interface ManagerIssues { + bugs: ItemsEntity[]; + features: ItemsEntity[]; +} + function getTitle(manager: string, displayName: string): string { if (manager === 'regex') { return `Custom Manager Support using Regex`; @@ -14,8 +35,84 @@ function getManagerLink(manager: string): string { return `[\`${manager}\`](${manager}/)`; } +function stringifyIssues(items: ItemsEntity[]): [string, number] { + if (!items) { + return ['', 0]; + } + let list = ''; + for (const item of items) { + list += ` - ${item.title} [#${item.number}](${item.html_url})\n`; + } + return [list, items.length]; +} + +function extractIssues( + managerIssuesMap: Record, + items: ItemsEntity[] +): void { + if (!items || !managerIssuesMap) { + return; + } + for (const item of items) { + const type = item.labels + .find((l) => l.name.startsWith('type:')) + ?.name.split(':')[1]; + if (!type) { + continue; + } + const manager = item.labels + .find((l) => l.name.startsWith('manager:')) + ?.name.split(':')[1]; + if (!manager) { + continue; + } + if (!managerIssuesMap[manager]) { + managerIssuesMap[manager] = { bugs: [], features: [] }; + } + switch (type) { + case 'bug': + managerIssuesMap[manager].bugs.push(item); + break; + case 'feature': + managerIssuesMap[manager].features.push(item); + break; + default: + break; + } + } +} + +export async function getManagersGitHubIssues(): Promise< + Record +> { + const q = `repo:renovatebot/renovate type:issue is:open -label:priority-5-triage`; + const per_page = 100; + const managerIssuesMap: Record = {}; + const githubApi = new GithubHttp('manager-issues'); + try { + const query = getQueryString({ q, per_page }); + const res = await githubApi.getJson( + gitHubApiUrl + query, + { + paginationField: 'items', + paginate: true, + } + ); + const items = res.body?.items ?? []; + extractIssues( + managerIssuesMap, + items.sort((a, b) => a.number - b.number) + ); + } catch (err) { + logger.error({ err }, 'Error getting query results'); + throw err; + } + return managerIssuesMap; +} + export async function generateManagers(dist: string): Promise { const managers = getManagers(); + const managerIssuesMap = await getManagersGitHubIssues(); const allLanguages: Record = {}; for (const [manager, definition] of managers) { const language = definition.language ?? 'other'; @@ -73,6 +170,29 @@ sidebar_label: ${displayName} } md += managerReadmeContent + '\n\n'; + const [featureList] = stringifyIssues(managerIssuesMap[manager]?.features); + if (featureList) { + md += '## Open feature requests\n\n'; + md += featureList; + md += '\n'; + } + + const [bugList] = stringifyIssues(managerIssuesMap[manager]?.bugs); + if (bugList) { + md += '## Open bug reports\n\n'; + md += bugList; + md += '\n'; + } + + if (featureList || bugList) { + const now = DateTime.utc().toFormat('MMMM dd, yyyy'); + const lists = `list of ${featureList ? 'features' : ''}${ + featureList && bugList ? ' and ' : '' + }${bugList ? 'bugs' : ''}`; + md += '\n\n'; + md += `The above ${lists} were current when this page was generated on ${now}.\n`; + } + await updateFile(`${dist}/modules/manager/${manager}/index.md`, md); } const languages = Object.keys(allLanguages).filter( From bb44a4bf831226879c708605191cf09a7ead9fdb Mon Sep 17 00:00:00 2001 From: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Date: Fri, 10 Jun 2022 07:00:51 +0200 Subject: [PATCH 070/240] docs(circleci): explain private orbs hostRules (#15939) --- lib/modules/manager/circleci/readme.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/lib/modules/manager/circleci/readme.md b/lib/modules/manager/circleci/readme.md index 39533ff501f755..8b02aa3d36ef60 100644 --- a/lib/modules/manager/circleci/readme.md +++ b/lib/modules/manager/circleci/readme.md @@ -1,3 +1,29 @@ The `circleci` manager extracts both `docker` as well as `orb` datasources from CircleCI config files. If you need to change the versioning format, read the [versioning](https://docs.renovatebot.com/modules/versioning/) documentation to learn more. + +### Private orbs + +To get private orbs working you should: + +1. Encrypt your CircleCI token with the [Renovate encryption page](https://app.renovatebot.com/encrypt) +1. Create a new `hostRules` entry in your Renovate config file +1. Put the encrypted token in the `token` field + +The end-result should look like this: + +```json +{ + "hostRules": [ + { + "matchHost": "circleci.com", + "authType": "Token-Only", + "encrypted": { + "token": "****" + } + } + ] +} +``` + +This config strips the Bearer/Basic prefix from the `authorization` header. From 996e4a6e579746d816220681f1ecbe5ec12f4376 Mon Sep 17 00:00:00 2001 From: RahulGautamSingh Date: Fri, 10 Jun 2022 10:44:49 +0530 Subject: [PATCH 071/240] feat: rename aliases to registryAliases (#15877) --- docs/usage/configuration-options.md | 38 ++++++++++--------- lib/config/migrations/migrations-service.ts | 1 + lib/config/options/index.ts | 4 +- lib/config/validation.spec.ts | 16 ++++---- lib/config/validation.ts | 2 +- .../manager/helm-requirements/extract.spec.ts | 18 ++++----- .../manager/helm-requirements/extract.ts | 2 +- .../manager/helm-requirements/index.ts | 2 +- .../manager/helm-requirements/readme.md | 2 +- lib/modules/manager/helmfile/extract.spec.ts | 26 ++++++------- lib/modules/manager/helmfile/extract.ts | 12 +++--- lib/modules/manager/helmfile/index.ts | 2 +- lib/modules/manager/helmfile/readme.md | 2 +- .../__snapshots__/artifacts.spec.ts.snap | 20 +++++----- lib/modules/manager/helmv3/artifacts.spec.ts | 22 +++++------ lib/modules/manager/helmv3/artifacts.ts | 6 +-- lib/modules/manager/helmv3/extract.spec.ts | 24 ++++++------ lib/modules/manager/helmv3/extract.ts | 2 +- lib/modules/manager/helmv3/index.ts | 2 +- lib/modules/manager/helmv3/readme.md | 2 +- lib/modules/manager/helmv3/utils.ts | 14 +++---- lib/modules/manager/types.ts | 4 +- lib/workers/global/config/parse/cli.ts | 1 + lib/workers/global/config/parse/env.ts | 1 + 24 files changed, 116 insertions(+), 109 deletions(-) diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index d2161a9bb28b7a..008fdbc6945275 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -94,23 +94,6 @@ You normally don't need to configure this, but one example where it can be usefu In contrast to `reviewers`, this option adds to the existing reviewer list, rather than replacing it. This makes it suitable for augmenting a preset or base list without displacing the original, for example when adding focused reviewers for a specific package group. -## aliases - -The `aliases` object is used for configuring registry aliases. -Currently it is needed/supported for the `helm-requirements`, `helmv3` and `helmfile` managers only. - -The above managers include this default alias: - -```json -{ - "aliases": { - "stable": "https://charts.helm.sh/stable" - } -} -``` - -Alias values must be properly formatted URIs. - ## assignAutomerge By default, Renovate will not assign reviewers and assignees to an automerge-enabled PR unless it fails status checks. @@ -2215,6 +2198,27 @@ If the `versioning` field is missing, then Renovate defaults to using `semver` v For more details and examples, see our [documentation for the `regex` manager](/modules/manager/regex/). For template fields, use the triple brace `{{{ }}}` notation to avoid Handlebars escaping any special characters. +## registryAliases + +You can use the `registryAliases` object to set registry aliases. +This feature only works with these managers: + +- `helm-requirements` +- `helmv3` +- `helmfile` + +The managers listed above all have this default registryAlias: + +```json +{ + "registryAliases": { + "stable": "https://charts.helm.sh/stable" + } +} +``` + +Alias values must be properly formatted URIs. + ### matchStrings `matchStrings` should each be a valid regular expression, optionally with named capture groups. diff --git a/lib/config/migrations/migrations-service.ts b/lib/config/migrations/migrations-service.ts index 91535db83c62ed..60eb6f7b27671f 100644 --- a/lib/config/migrations/migrations-service.ts +++ b/lib/config/migrations/migrations-service.ts @@ -74,6 +74,7 @@ export class MigrationsService { ['separatePatchReleases', 'separateMinorPatch'], ['versionScheme', 'versioning'], ['lookupNameTemplate', 'packageNameTemplate'], + ['aliases', 'registryAliases'], ]); static readonly customMigrations: ReadonlyArray = [ diff --git a/lib/config/options/index.ts b/lib/config/options/index.ts index e2c4624f5e08dd..949f2d7982b1dd 100644 --- a/lib/config/options/index.ts +++ b/lib/config/options/index.ts @@ -795,8 +795,8 @@ const options: RenovateOptions[] = [ globalOnly: true, }, { - name: 'aliases', - description: 'Aliases for registries, package manager specific.', + name: 'registryAliases', + description: 'Aliases for registries.', type: 'object', default: {}, additionalProperties: { diff --git a/lib/config/validation.spec.ts b/lib/config/validation.spec.ts index e61740dc75bb3f..7e564265a2bc20 100644 --- a/lib/config/validation.spec.ts +++ b/lib/config/validation.spec.ts @@ -507,9 +507,9 @@ describe('config/validation', () => { expect(errors).toHaveLength(0); }); - it('validates valid alias objects', async () => { + it('validates valid registryAlias objects', async () => { const config = { - aliases: { + registryAliases: { example1: 'http://www.example.com', example2: 'https://www.example2.com/example', }, @@ -521,9 +521,9 @@ describe('config/validation', () => { expect(errors).toHaveLength(0); }); - it('errors if aliases depth is more than 1', async () => { + it('errors if registryAliases depth is more than 1', async () => { const config = { - aliases: { + registryAliases: { sample: { example1: 'http://www.example.com', }, @@ -536,15 +536,15 @@ describe('config/validation', () => { expect(errors).toMatchObject([ { message: - 'Invalid `aliases.aliases.sample` configuration: value is not a url', + 'Invalid `registryAliases.registryAliases.sample` configuration: value is not a url', topic: 'Configuration Error', }, ]); }); - it('errors if aliases have invalid url', async () => { + it('errors if registryAliases have invalid url', async () => { const config = { - aliases: { + registryAliases: { example1: 'noturl', example2: 'http://www.example.com', }, @@ -556,7 +556,7 @@ describe('config/validation', () => { expect(errors).toMatchObject([ { message: - 'Invalid `aliases.aliases.example1` configuration: value is not a url', + 'Invalid `registryAliases.registryAliases.example1` configuration: value is not a url', topic: 'Configuration Error', }, ]); diff --git a/lib/config/validation.ts b/lib/config/validation.ts index 1ca4e9157eac69..23be22ec6a7055 100644 --- a/lib/config/validation.ts +++ b/lib/config/validation.ts @@ -534,7 +534,7 @@ export async function validateConfig( currentPath !== 'force.constraints' ) { if (is.plainObject(val)) { - if (key === 'aliases') { + if (key === 'registryAliases') { const res = validateAliasObject(val); if (res !== true) { errors.push({ diff --git a/lib/modules/manager/helm-requirements/extract.spec.ts b/lib/modules/manager/helm-requirements/extract.spec.ts index 657f64dc6f179c..ad90c0c4387e09 100644 --- a/lib/modules/manager/helm-requirements/extract.spec.ts +++ b/lib/modules/manager/helm-requirements/extract.spec.ts @@ -26,7 +26,7 @@ describe('modules/manager/helm-requirements/extract', () => { `; const fileName = 'requirements.yaml'; const result = extractPackageFile(content, fileName, { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable/', }, }); @@ -57,7 +57,7 @@ describe('modules/manager/helm-requirements/extract', () => { `; const fileName = 'requirements.yaml'; const result = extractPackageFile(content, fileName, { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable/', }, }); @@ -85,7 +85,7 @@ describe('modules/manager/helm-requirements/extract', () => { `; const fileName = 'requirements.yaml'; const result = extractPackageFile(content, fileName, { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable/', }, }); @@ -107,7 +107,7 @@ describe('modules/manager/helm-requirements/extract', () => { `); const fileName = 'requirements.yaml'; const result = extractPackageFile('', fileName, { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable/', }, }); @@ -133,7 +133,7 @@ describe('modules/manager/helm-requirements/extract', () => { `; const fileName = 'requirements.yaml'; const result = extractPackageFile(content, fileName, { - aliases: { + registryAliases: { placeholder: 'https://my-registry.gcr.io/', longalias: 'https://registry.example.com/', }, @@ -162,7 +162,7 @@ describe('modules/manager/helm-requirements/extract', () => { `; const fileName = 'requirements.yaml'; const result = extractPackageFile(content, fileName, { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable/', }, }); @@ -187,7 +187,7 @@ describe('modules/manager/helm-requirements/extract', () => { `; const fileName = 'requirements.yaml'; const result = extractPackageFile(content, fileName, { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable/', }, }); @@ -209,7 +209,7 @@ describe('modules/manager/helm-requirements/extract', () => { `; const fileName = 'requirements.yaml'; const result = extractPackageFile(content, fileName, { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable/', }, }); @@ -220,7 +220,7 @@ describe('modules/manager/helm-requirements/extract', () => { const content = ''; const fileName = 'requirements.yaml'; const result = extractPackageFile(content, fileName, { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable/', }, }); diff --git a/lib/modules/manager/helm-requirements/extract.ts b/lib/modules/manager/helm-requirements/extract.ts index 7bdfe2c127cfeb..0eef769f9b9931 100644 --- a/lib/modules/manager/helm-requirements/extract.ts +++ b/lib/modules/manager/helm-requirements/extract.ts @@ -57,7 +57,7 @@ export function extractPackageFile( const repoWithPrefixRemoved = dep.repository.slice( dep.repository[0] === '@' ? 1 : 6 ); - const alias = config.aliases?.[repoWithPrefixRemoved]; + const alias = config.registryAliases?.[repoWithPrefixRemoved]; if (alias) { res.registryUrls = [alias]; return res; diff --git a/lib/modules/manager/helm-requirements/index.ts b/lib/modules/manager/helm-requirements/index.ts index 186ec412d9ed8d..e9df003fad80b6 100644 --- a/lib/modules/manager/helm-requirements/index.ts +++ b/lib/modules/manager/helm-requirements/index.ts @@ -2,7 +2,7 @@ import { HelmDatasource } from '../../datasource/helm'; export { extractPackageFile } from './extract'; export const defaultConfig = { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable', }, commitMessageTopic: 'helm chart {{depName}}', diff --git a/lib/modules/manager/helm-requirements/readme.md b/lib/modules/manager/helm-requirements/readme.md index 0b029c8d123d12..ab2b5a0e385493 100644 --- a/lib/modules/manager/helm-requirements/readme.md +++ b/lib/modules/manager/helm-requirements/readme.md @@ -1,6 +1,6 @@ Renovate supports updating Helm Chart references within `requirements.yaml` files. -If your Helm charts make use of repository Aliases then you will need to configure an `aliases` object in your config to tell Renovate where to look for them. +If your Helm charts make use of repository aliases then you will need to configure an `registryAliases` object in your config to tell Renovate where to look for them. If you need to change the versioning format, read the [versioning](https://docs.renovatebot.com/modules/versioning/) documentation to learn more. diff --git a/lib/modules/manager/helmfile/extract.spec.ts b/lib/modules/manager/helmfile/extract.spec.ts index c00387ea03b2dc..89f4560a2b546e 100644 --- a/lib/modules/manager/helmfile/extract.spec.ts +++ b/lib/modules/manager/helmfile/extract.spec.ts @@ -15,7 +15,7 @@ describe('modules/manager/helmfile/extract', () => { `; const fileName = 'helmfile.yaml'; const result = extractPackageFile(content, fileName, { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable', }, }); @@ -32,7 +32,7 @@ describe('modules/manager/helmfile/extract', () => { `; const fileName = 'helmfile.yaml'; const result = extractPackageFile(content, fileName, { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable', }, }); @@ -51,7 +51,7 @@ describe('modules/manager/helmfile/extract', () => { `; const fileName = 'helmfile.yaml'; const result = extractPackageFile(content, fileName, { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable', }, }); @@ -75,7 +75,7 @@ describe('modules/manager/helmfile/extract', () => { `; const fileName = 'helmfile.yaml'; const result = extractPackageFile(content, fileName, { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable', }, }); @@ -106,7 +106,7 @@ describe('modules/manager/helmfile/extract', () => { `; const fileName = 'helmfile.yaml'; const result = extractPackageFile(content, fileName, { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable', }, }); @@ -127,7 +127,7 @@ describe('modules/manager/helmfile/extract', () => { `; const fileName = 'helmfile.yaml'; const result = extractPackageFile(content, fileName, { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable', }, }); @@ -151,7 +151,7 @@ describe('modules/manager/helmfile/extract', () => { `; const fileName = 'helmfile.yaml'; const result = extractPackageFile(content, fileName, { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable', }, }); @@ -171,7 +171,7 @@ describe('modules/manager/helmfile/extract', () => { `; const fileName = 'helmfile.yaml'; const result = extractPackageFile(content, fileName, { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable', }, }); @@ -186,7 +186,7 @@ describe('modules/manager/helmfile/extract', () => { Fixtures.get('multidoc.yaml'), fileName, { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable', }, } @@ -222,7 +222,7 @@ describe('modules/manager/helmfile/extract', () => { `; const fileName = 'helmfile.yaml'; const result = extractPackageFile(content, fileName, { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable', }, }); @@ -259,7 +259,7 @@ describe('modules/manager/helmfile/extract', () => { `; const fileName = 'helmfile.yaml'; const result = extractPackageFile(content, fileName, { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable', }, }); @@ -299,7 +299,7 @@ describe('modules/manager/helmfile/extract', () => { `; const fileName = 'helmfile.yaml'; const result = extractPackageFile(content, fileName, { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable', }, }); @@ -326,7 +326,7 @@ describe('modules/manager/helmfile/extract', () => { Fixtures.get('go-template.yaml'), filename, { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable', }, } diff --git a/lib/modules/manager/helmfile/extract.ts b/lib/modules/manager/helmfile/extract.ts index feeff943ebd2fa..d08512319966d2 100644 --- a/lib/modules/manager/helmfile/extract.ts +++ b/lib/modules/manager/helmfile/extract.ts @@ -22,7 +22,7 @@ export function extractPackageFile( ): PackageFile | null { let deps: PackageDependency[] = []; let docs: Doc[]; - const aliases: Record = {}; + const registryAliases: Record = {}; try { docs = loadAll(extractYaml(content), null, { json: true }) as Doc[]; } catch (err) { @@ -36,10 +36,10 @@ export function extractPackageFile( if (doc.repositories) { for (let i = 0; i < doc.repositories.length; i += 1) { - aliases[doc.repositories[i].name] = doc.repositories[i].url; + registryAliases[doc.repositories[i].name] = doc.repositories[i].url; } } - logger.debug({ aliases }, 'repositories discovered.'); + logger.debug({ registryAliases }, 'repositories discovered.'); deps = doc.releases.map((dep) => { let depName = dep.chart; @@ -82,8 +82,8 @@ export function extractPackageFile( const res: PackageDependency = { depName, currentValue: dep.version, - registryUrls: [aliases[repoName]] - .concat([config.aliases?.[repoName]] as string[]) + registryUrls: [registryAliases[repoName]] + .concat([config.registryAliases?.[repoName]] as string[]) .filter(is.string), }; @@ -93,7 +93,7 @@ export function extractPackageFile( ); if (repository?.oci) { res.datasource = DockerDatasource.id; - res.packageName = aliases[repoName] + '/' + depName; + res.packageName = registryAliases[repoName] + '/' + depName; } // By definition on helm the chart name should be lowercase letter + number + - diff --git a/lib/modules/manager/helmfile/index.ts b/lib/modules/manager/helmfile/index.ts index 7de71e75bf0078..36e82e44fff4ac 100644 --- a/lib/modules/manager/helmfile/index.ts +++ b/lib/modules/manager/helmfile/index.ts @@ -3,7 +3,7 @@ import { HelmDatasource } from '../../datasource/helm'; export { extractPackageFile } from './extract'; export const defaultConfig = { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable', }, commitMessageTopic: 'helm chart {{depName}}', diff --git a/lib/modules/manager/helmfile/readme.md b/lib/modules/manager/helmfile/readme.md index 62f58c0458bace..e560becc125631 100644 --- a/lib/modules/manager/helmfile/readme.md +++ b/lib/modules/manager/helmfile/readme.md @@ -1,5 +1,5 @@ Checks `helmfile.yaml` files and extracts dependencies for the `helm` datasource. -If your Helm charts make use of repository Aliases then you will need to configure an `aliases` object in your config to tell Renovate where to look for them. +If your Helm charts make use of repository aliases then you will need to configure an `registryAliases` object in your config to tell Renovate where to look for them. If you need to change the versioning format, read the [versioning](https://docs.renovatebot.com/modules/versioning/) documentation to learn more. diff --git a/lib/modules/manager/helmv3/__snapshots__/artifacts.spec.ts.snap b/lib/modules/manager/helmv3/__snapshots__/artifacts.spec.ts.snap index 55931625e112b1..e5becd956fa784 100644 --- a/lib/modules/manager/helmv3/__snapshots__/artifacts.spec.ts.snap +++ b/lib/modules/manager/helmv3/__snapshots__/artifacts.spec.ts.snap @@ -75,7 +75,7 @@ Array [ ] `; -exports[`modules/manager/helmv3/artifacts do not add aliases to repository list 1`] = ` +exports[`modules/manager/helmv3/artifacts do not add registryAliases to repository list 1`] = ` Array [ Object { "file": Object { @@ -96,7 +96,7 @@ generated: \\"2022-01-20T17:48:47.610371241+01:00\\" ] `; -exports[`modules/manager/helmv3/artifacts do not add aliases to repository list 2`] = ` +exports[`modules/manager/helmv3/artifacts do not add registryAliases to repository list 2`] = ` Array [ Object { "cmd": "helm repo add jetstack --registry-config /tmp/renovate/cache/__renovate-private-cache/registry.json --repository-config /tmp/renovate/cache/__renovate-private-cache/repositories.yaml --repository-cache /tmp/renovate/cache/__renovate-private-cache/repositories https://charts.jetstack.io", @@ -158,7 +158,7 @@ Array [ ] `; -exports[`modules/manager/helmv3/artifacts log into private registries and repositories NOT defined in aliases 1`] = ` +exports[`modules/manager/helmv3/artifacts log into private registries and repositories NOT defined in registryAliases 1`] = ` Array [ Object { "file": Object { @@ -179,7 +179,7 @@ generated: \\"2022-01-20T17:48:47.610371241+01:00\\" ] `; -exports[`modules/manager/helmv3/artifacts log into private registries and repositories NOT defined in aliases 2`] = ` +exports[`modules/manager/helmv3/artifacts log into private registries and repositories NOT defined in registryAliases 2`] = ` Array [ Object { "cmd": "helm registry login --registry-config /tmp/renovate/cache/__renovate-private-cache/registry.json --repository-config /tmp/renovate/cache/__renovate-private-cache/repositories.yaml --repository-cache /tmp/renovate/cache/__renovate-private-cache/repositories --username registryUser --password password registry.gitlab.com/user/oci-helm-test", @@ -241,7 +241,7 @@ Array [ ] `; -exports[`modules/manager/helmv3/artifacts log into private registries and repositories already defined in aliases 1`] = ` +exports[`modules/manager/helmv3/artifacts log into private registries and repositories already defined in registryAliases 1`] = ` Array [ Object { "file": Object { @@ -262,7 +262,7 @@ generated: \\"2022-01-20T17:48:47.610371241+01:00\\" ] `; -exports[`modules/manager/helmv3/artifacts log into private registries and repositories already defined in aliases 2`] = ` +exports[`modules/manager/helmv3/artifacts log into private registries and repositories already defined in registryAliases 2`] = ` Array [ Object { "cmd": "helm registry login --registry-config /tmp/renovate/cache/__renovate-private-cache/registry.json --repository-config /tmp/renovate/cache/__renovate-private-cache/repositories.yaml --repository-cache /tmp/renovate/cache/__renovate-private-cache/repositories --username test --password aPassword registry.example.com/organization", @@ -590,7 +590,7 @@ Array [ ] `; -exports[`modules/manager/helmv3/artifacts sets repositories from aliases 1`] = ` +exports[`modules/manager/helmv3/artifacts sets repositories from registryAliases 1`] = ` Array [ Object { "file": Object { @@ -611,7 +611,7 @@ generated: \\"2022-01-20T17:48:47.610371241+01:00\\" ] `; -exports[`modules/manager/helmv3/artifacts sets repositories from aliases 2`] = ` +exports[`modules/manager/helmv3/artifacts sets repositories from registryAliases 2`] = ` Array [ Object { "cmd": "helm repo add stable --registry-config /tmp/renovate/cache/__renovate-private-cache/registry.json --repository-config /tmp/renovate/cache/__renovate-private-cache/repositories.yaml --repository-cache /tmp/renovate/cache/__renovate-private-cache/repositories the_stable_url", @@ -692,7 +692,7 @@ Array [ ] `; -exports[`modules/manager/helmv3/artifacts sets repositories from aliases with docker 1`] = ` +exports[`modules/manager/helmv3/artifacts sets repositories from registryAliases with docker 1`] = ` Array [ Object { "file": Object { @@ -713,7 +713,7 @@ generated: \\"2022-01-20T17:48:47.610371241+01:00\\" ] `; -exports[`modules/manager/helmv3/artifacts sets repositories from aliases with docker 2`] = ` +exports[`modules/manager/helmv3/artifacts sets repositories from registryAliases with docker 2`] = ` Array [ Object { "cmd": "docker pull renovate/sidecar", diff --git a/lib/modules/manager/helmv3/artifacts.spec.ts b/lib/modules/manager/helmv3/artifacts.spec.ts index 715343be129c2c..f23943b10bcb86 100644 --- a/lib/modules/manager/helmv3/artifacts.spec.ts +++ b/lib/modules/manager/helmv3/artifacts.spec.ts @@ -211,7 +211,7 @@ describe('modules/manager/helmv3/artifacts', () => { ]); }); - it('sets repositories from aliases', async () => { + it('sets repositories from registryAliases', async () => { fs.privateCacheDir.mockReturnValue( '/tmp/renovate/cache/__renovate-private-cache' ); @@ -228,7 +228,7 @@ describe('modules/manager/helmv3/artifacts', () => { config: { ...config, updateType: 'lockFileMaintenance', - aliases: { stable: 'the_stable_url', repo1: 'the_repo1_url' }, + registryAliases: { stable: 'the_stable_url', repo1: 'the_repo1_url' }, }, }) ).toMatchSnapshot([ @@ -244,7 +244,7 @@ describe('modules/manager/helmv3/artifacts', () => { expect(execSnapshots).toMatchSnapshot(); }); - it('sets repositories from aliases with docker', async () => { + it('sets repositories from registryAliases with docker', async () => { GlobalConfig.set({ ...adminConfig, binarySource: 'docker' }); fs.getSiblingFileName.mockReturnValueOnce('Chart.lock'); fs.readLocalFile.mockResolvedValueOnce(ociLockFile1 as never); @@ -265,7 +265,7 @@ describe('modules/manager/helmv3/artifacts', () => { config: { ...config, updateType: 'lockFileMaintenance', - aliases: { stable: 'the_stable_url', repo1: 'the_repo1_url' }, + registryAliases: { stable: 'the_stable_url', repo1: 'the_repo1_url' }, }, }) ).toMatchSnapshot([ @@ -281,7 +281,7 @@ describe('modules/manager/helmv3/artifacts', () => { expect(execSnapshots).toMatchSnapshot(); }); - it('log into private registries and repositories already defined in aliases', async () => { + it('log into private registries and repositories already defined in registryAliases', async () => { hostRules.add({ username: 'test', password: 'aPassword', @@ -310,7 +310,7 @@ describe('modules/manager/helmv3/artifacts', () => { config: { ...config, updateType: 'lockFileMaintenance', - aliases: { + registryAliases: { stable: 'the_stable_url', oci: 'oci://registry.example.com/organization', repo1: 'https://the_repo1_url', @@ -330,7 +330,7 @@ describe('modules/manager/helmv3/artifacts', () => { expect(execSnapshots).toMatchSnapshot(); }); - it('log into private registries and repositories NOT defined in aliases', async () => { + it('log into private registries and repositories NOT defined in registryAliases', async () => { hostRules.add({ username: 'registryUser', password: 'password', @@ -360,7 +360,7 @@ describe('modules/manager/helmv3/artifacts', () => { config: { ...config, updateType: 'lockFileMaintenance', - aliases: {}, + registryAliases: {}, }, }) ).toMatchSnapshot([ @@ -400,7 +400,7 @@ describe('modules/manager/helmv3/artifacts', () => { config: { ...config, updateType: 'lockFileMaintenance', - aliases: { + registryAliases: { repo1: 'https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable', }, @@ -431,7 +431,7 @@ describe('modules/manager/helmv3/artifacts', () => { expect(execSnapshots).toMatchSnapshot(); }); - it('do not add aliases to repository list', async () => { + it('do not add registryAliases to repository list', async () => { fs.getSiblingFileName.mockReturnValueOnce('Chart.lock'); fs.readLocalFile.mockResolvedValueOnce(ociLockFile1Alias as never); const execSnapshots = mockExecAll(exec); @@ -448,7 +448,7 @@ describe('modules/manager/helmv3/artifacts', () => { config: { ...config, updateType: 'lockFileMaintenance', - aliases: { + registryAliases: { jetstack: 'https://charts.jetstack.io', }, }, diff --git a/lib/modules/manager/helmv3/artifacts.ts b/lib/modules/manager/helmv3/artifacts.ts index 8a1139841a1917..d6fc559727bed4 100644 --- a/lib/modules/manager/helmv3/artifacts.ts +++ b/lib/modules/manager/helmv3/artifacts.ts @@ -129,10 +129,10 @@ export async function updateArtifacts({ const locks = yaml.load(existingLockFileContent) as ChartDefinition; //TODO #9610 const chartDefinitions: ChartDefinition[] = []; - // prioritize alias naming for Helm repositories - if (config.aliases) { + // prioritize registryAlias naming for Helm repositories + if (config.registryAliases) { chartDefinitions.push({ - dependencies: aliasRecordToRepositories(config.aliases), + dependencies: aliasRecordToRepositories(config.registryAliases), }); } chartDefinitions.push(packages, locks); diff --git a/lib/modules/manager/helmv3/extract.spec.ts b/lib/modules/manager/helmv3/extract.spec.ts index 9cb39785598622..f97a2fd37142ce 100644 --- a/lib/modules/manager/helmv3/extract.spec.ts +++ b/lib/modules/manager/helmv3/extract.spec.ts @@ -30,7 +30,7 @@ describe('modules/manager/helmv3/extract', () => { `; const fileName = 'Chart.yaml'; const result = await extractPackageFile(content, fileName, { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable', }, }); @@ -58,7 +58,7 @@ describe('modules/manager/helmv3/extract', () => { `; const fileName = 'Chart.yaml'; const result = await extractPackageFile(content, fileName, { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable', }, }); @@ -91,7 +91,7 @@ describe('modules/manager/helmv3/extract', () => { `; const fileName = 'Chart.yaml'; const result = await extractPackageFile(content, fileName, { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable', }, }); @@ -127,7 +127,7 @@ describe('modules/manager/helmv3/extract', () => { `; const fileName = 'Chart.yaml'; const result = await extractPackageFile(content, fileName, { - aliases: { + registryAliases: { placeholder: 'https://my-registry.gcr.io/', longalias: 'https://registry.example.com/', ociRegistry: 'oci://quay.example.com/organization', @@ -146,7 +146,7 @@ describe('modules/manager/helmv3/extract', () => { `; const fileName = 'Chart.yaml'; const result = await extractPackageFile(content, fileName, { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable', }, }); @@ -170,7 +170,7 @@ describe('modules/manager/helmv3/extract', () => { `; const fileName = 'Chart.yaml'; const result = await extractPackageFile(content, fileName, { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable', }, }); @@ -195,7 +195,7 @@ describe('modules/manager/helmv3/extract', () => { `; const fileName = 'Chart.yaml'; const result = await extractPackageFile(content, fileName, { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable', }, }); @@ -215,7 +215,7 @@ describe('modules/manager/helmv3/extract', () => { `; const fileName = 'Chart.yaml'; const result = await extractPackageFile(content, fileName, { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable', }, }); @@ -235,7 +235,7 @@ describe('modules/manager/helmv3/extract', () => { `; const fileName = 'Chart.yaml'; const result = await extractPackageFile(content, fileName, { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable', }, }); @@ -246,7 +246,7 @@ describe('modules/manager/helmv3/extract', () => { const content = ''; const fileName = 'Chart.yaml'; const result = await extractPackageFile(content, fileName, { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable', }, }); @@ -263,7 +263,7 @@ describe('modules/manager/helmv3/extract', () => { `; const fileName = 'Chart.yaml'; const result = await extractPackageFile(content, fileName, { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable', }, }); @@ -284,7 +284,7 @@ describe('modules/manager/helmv3/extract', () => { `; const fileName = 'Chart.yaml'; const result = await extractPackageFile(content, fileName, { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable', }, }); diff --git a/lib/modules/manager/helmv3/extract.ts b/lib/modules/manager/helmv3/extract.ts index 25da3ef9c86e03..4a6f32a44ac0b3 100644 --- a/lib/modules/manager/helmv3/extract.ts +++ b/lib/modules/manager/helmv3/extract.ts @@ -62,7 +62,7 @@ export async function extractPackageFile( } // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion - const repository = resolveAlias(dep.repository, config.aliases!); + const repository = resolveAlias(dep.repository, config.registryAliases!); if (!repository) { res.skipReason = 'placeholder-url'; return res; diff --git a/lib/modules/manager/helmv3/index.ts b/lib/modules/manager/helmv3/index.ts index d0ef5e718dfe53..b0714f85cf5037 100644 --- a/lib/modules/manager/helmv3/index.ts +++ b/lib/modules/manager/helmv3/index.ts @@ -7,7 +7,7 @@ export { bumpPackageVersion } from './update'; export const supportsLockFileMaintenance = true; export const defaultConfig = { - aliases: { + registryAliases: { stable: 'https://charts.helm.sh/stable', }, commitMessageTopic: 'helm chart {{depName}}', diff --git a/lib/modules/manager/helmv3/readme.md b/lib/modules/manager/helmv3/readme.md index 9854d75628f434..ea0c9e915deacc 100644 --- a/lib/modules/manager/helmv3/readme.md +++ b/lib/modules/manager/helmv3/readme.md @@ -1,6 +1,6 @@ Renovate supports updating Helm Chart references within `requirements.yaml` (Helm v2) and `Chart.yaml` (Helm v3) files. -If your Helm charts make use of repository Aliases then you will need to configure an `aliases` object in your config to tell Renovate where to look for them. +If your Helm charts make use of repository aliases then you will need to configure an `registryAliases` object in your config to tell Renovate where to look for them. If you need to change the versioning format, read the [versioning](https://docs.renovatebot.com/modules/versioning/) documentation to learn more. diff --git a/lib/modules/manager/helmv3/utils.ts b/lib/modules/manager/helmv3/utils.ts index c95520ad153a7c..e002d6c92bef3a 100644 --- a/lib/modules/manager/helmv3/utils.ts +++ b/lib/modules/manager/helmv3/utils.ts @@ -33,20 +33,20 @@ export function parseRepository( * Resolves alias in repository string. * * @param repository to be resolved string - * @param aliases Records containing aliases as key and to be resolved URLs as values + * @param registryAliases Records containing registryAliases as key and to be resolved URLs as values * - * @returns resolved alias. If repository does not contain an alias the repository string will be returned. Should it contain an alias which can not be resolved using `aliases`, null will be returned + * @returns resolved alias. If repository does not contain an alias the repository string will be returned. Should it contain an alias which can not be resolved using `registryAliases`, null will be returned */ export function resolveAlias( repository: string, - aliases: Record + registryAliases: Record ): string | null { if (!isAlias(repository)) { return repository; } const repoWithPrefixRemoved = repository.slice(repository[0] === '@' ? 1 : 6); - const alias = aliases[repoWithPrefixRemoved]; + const alias = registryAliases[repoWithPrefixRemoved]; if (alias) { return alias; } @@ -57,7 +57,7 @@ export function getRepositories(definitions: ChartDefinition[]): Repository[] { const repositoryList = definitions .flatMap((value) => value.dependencies) .filter((dependency) => dependency.repository) // only keep non-local references --> if no repository is defined the chart will be searched in charts/ - .filter((dependency) => !isAlias(dependency.repository)) // do not add aliases + .filter((dependency) => !isAlias(dependency.repository)) // do not add registryAliases .filter((dependency) => !dependency.repository.startsWith('file:')) // skip repositories which are locally referenced .map((dependency) => { // remove additional keys to prevent interference at deduplication @@ -86,9 +86,9 @@ export function isOCIRegistry(repository: Repository): boolean { } export function aliasRecordToRepositories( - aliases: Record + registryAliases: Record ): Repository[] { - return Object.entries(aliases).map(([alias, url]) => { + return Object.entries(registryAliases).map(([alias, url]) => { return { name: alias, repository: url, diff --git a/lib/modules/manager/types.ts b/lib/modules/manager/types.ts index 94d641da38ec41..cd92661139edc1 100644 --- a/lib/modules/manager/types.ts +++ b/lib/modules/manager/types.ts @@ -15,7 +15,7 @@ export interface ManagerData { } export interface ExtractConfig { - aliases?: Record; + registryAliases?: Record; npmrc?: string; npmrcMerge?: boolean; skipInstalls?: boolean; @@ -49,7 +49,7 @@ export interface UpdateArtifactsConfig { newValue?: string; newVersion?: string; newMajor?: number; - aliases?: Record; + registryAliases?: Record; } export interface RangeConfig> extends ManagerData { diff --git a/lib/workers/global/config/parse/cli.ts b/lib/workers/global/config/parse/cli.ts index 9a5adc71ad8442..fb790c43154047 100644 --- a/lib/workers/global/config/parse/cli.ts +++ b/lib/workers/global/config/parse/cli.ts @@ -31,6 +31,7 @@ export function getConfig(input: string[]): AllConfig { .replace('--git-lab-automerge', '--platform-automerge') // migrate: gitLabAutomerge .replace(/^--dry-run$/, '--dry-run=true') .replace(/^--require-config$/, '--require-config=true') + .replace('--aliases', '--registry-aliases') ) .filter((a) => !a.startsWith('--git-fs')); const options = getOptions(); diff --git a/lib/workers/global/config/parse/env.ts b/lib/workers/global/config/parse/env.ts index ccbb22105abd4a..0b9c1fef7750c5 100644 --- a/lib/workers/global/config/parse/env.ts +++ b/lib/workers/global/config/parse/env.ts @@ -35,6 +35,7 @@ export function getEnvName(option: ParseConfigOptions): string { } const renameKeys = { + aliases: 'registryAliases', azureAutoComplete: 'platformAutomerge', // migrate: azureAutoComplete gitLabAutomerge: 'platformAutomerge', // migrate: gitLabAutomerge }; From 208b84f4a889669cc0193e22b127fad6f7c9ed58 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Fri, 10 Jun 2022 13:54:15 +0200 Subject: [PATCH 072/240] fix(config): no stabillity days for vulnerability alerts (#15993) --- lib/config/options/index.ts | 1 + .../repository/init/__snapshots__/vulnerability.spec.ts.snap | 2 ++ 2 files changed, 3 insertions(+) diff --git a/lib/config/options/index.ts b/lib/config/options/index.ts index 949f2d7982b1dd..bc84a2a66be7aa 100644 --- a/lib/config/options/index.ts +++ b/lib/config/options/index.ts @@ -1530,6 +1530,7 @@ const options: RenovateOptions[] = [ groupName: null, schedule: [], dependencyDashboardApproval: false, + stabilityDays: 0, rangeStrategy: 'update-lockfile', commitMessageSuffix: '[SECURITY]', branchTopic: `{{{datasource}}}-{{{depName}}}-vulnerability`, diff --git a/lib/workers/repository/init/__snapshots__/vulnerability.spec.ts.snap b/lib/workers/repository/init/__snapshots__/vulnerability.spec.ts.snap index e4f34d30fdc9a1..dbc6e961cafe07 100644 --- a/lib/workers/repository/init/__snapshots__/vulnerability.spec.ts.snap +++ b/lib/workers/repository/init/__snapshots__/vulnerability.spec.ts.snap @@ -24,6 +24,7 @@ Array [ "prCreation": "immediate", "rangeStrategy": "update-lockfile", "schedule": Array [], + "stabilityDays": 0, }, "isVulnerabilityAlert": true, "matchCurrentVersion": "== 1.6.7", @@ -68,6 +69,7 @@ Ansible before versions 2.1.4, 2.2.1 is vulnerable to an improper input validati "prCreation": "immediate", "rangeStrategy": "update-lockfile", "schedule": Array [], + "stabilityDays": 0, }, "isVulnerabilityAlert": true, "matchCurrentVersion": "= 2.4.2", From 6d88e7f726c84ec1edbf6326e5f8094ade662671 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Fri, 10 Jun 2022 14:20:05 +0200 Subject: [PATCH 073/240] fix(manager/npm): respect contraints from root `package.json` when using yarn workspaces (#15992) --- .../__snapshots__/monorepo.spec.ts.snap | 16 +++-- .../npm/extract/locked-versions.spec.ts | 40 +++++++++++ .../manager/npm/extract/locked-versions.ts | 2 +- .../manager/npm/extract/monorepo.spec.ts | 68 +++++++++++++++---- lib/modules/manager/npm/extract/monorepo.ts | 11 ++- 5 files changed, 117 insertions(+), 20 deletions(-) diff --git a/lib/modules/manager/npm/extract/__snapshots__/monorepo.spec.ts.snap b/lib/modules/manager/npm/extract/__snapshots__/monorepo.spec.ts.snap index 2fd7c3706f5c4c..190c157e320196 100644 --- a/lib/modules/manager/npm/extract/__snapshots__/monorepo.spec.ts.snap +++ b/lib/modules/manager/npm/extract/__snapshots__/monorepo.spec.ts.snap @@ -26,9 +26,6 @@ Array [ "lernaJsonFile": "lerna.json", }, "packageFile": "package.json", - "packages": Array [ - "packages/*", - ], }, Object { "deps": Array [ @@ -45,6 +42,7 @@ Array [ ], "lernaClient": undefined, "managerData": Object { + "hasPackageManager": undefined, "lernaJsonFile": "lerna.json", "yarnZeroInstall": undefined, }, @@ -57,6 +55,7 @@ Array [ Object { "lernaClient": undefined, "managerData": Object { + "hasPackageManager": undefined, "lernaJsonFile": "lerna.json", "yarnZeroInstall": undefined, }, @@ -95,9 +94,6 @@ Array [ "lernaJsonFile": "lerna.json", }, "packageFile": "package.json", - "packages": Array [ - "packages/*", - ], }, Object { "deps": Array [ @@ -114,6 +110,7 @@ Array [ ], "lernaClient": undefined, "managerData": Object { + "hasPackageManager": undefined, "lernaJsonFile": "lerna.json", "yarnZeroInstall": undefined, }, @@ -126,6 +123,7 @@ Array [ Object { "lernaClient": undefined, "managerData": Object { + "hasPackageManager": undefined, "lernaJsonFile": "lerna.json", "yarnZeroInstall": undefined, }, @@ -156,6 +154,7 @@ Array [ Object { "lernaClient": "yarn", "managerData": Object { + "hasPackageManager": undefined, "lernaJsonFile": "lerna.json", "yarnZeroInstall": undefined, }, @@ -168,6 +167,7 @@ Array [ Object { "lernaClient": "yarn", "managerData": Object { + "hasPackageManager": undefined, "lernaJsonFile": "lerna.json", "yarnZeroInstall": undefined, }, @@ -192,6 +192,7 @@ Array [ "hasYarnWorkspaces": true, "lernaClient": undefined, "managerData": Object { + "hasPackageManager": undefined, "lernaJsonFile": undefined, "yarnZeroInstall": undefined, }, @@ -206,6 +207,7 @@ Array [ Object { "lernaClient": undefined, "managerData": Object { + "hasPackageManager": undefined, "lernaJsonFile": undefined, "yarnZeroInstall": undefined, }, @@ -234,6 +236,7 @@ Array [ "hasYarnWorkspaces": true, "lernaClient": undefined, "managerData": Object { + "hasPackageManager": undefined, "lernaJsonFile": undefined, "yarnZeroInstall": true, }, @@ -248,6 +251,7 @@ Array [ Object { "lernaClient": undefined, "managerData": Object { + "hasPackageManager": undefined, "lernaJsonFile": undefined, "yarnZeroInstall": true, }, diff --git a/lib/modules/manager/npm/extract/locked-versions.spec.ts b/lib/modules/manager/npm/extract/locked-versions.spec.ts index 8b90657b7bb130..d228834e482a91 100644 --- a/lib/modules/manager/npm/extract/locked-versions.spec.ts +++ b/lib/modules/manager/npm/extract/locked-versions.spec.ts @@ -211,6 +211,46 @@ describe('modules/manager/npm/extract/locked-versions', () => { ]); }); + it("uses yarn.lock but doesn't override contraints", async () => { + const yarnVersion = '3.2.0'; + const lockfileVersion = 8; + const isYarn1 = false; + yarn.getYarnLock.mockReturnValue({ + isYarn1, + lockfileVersion, + lockedVersions, + }); + const packageFiles = getPackageFiles(yarnVersion); + packageFiles[0].constraints = { yarn: '3.2.0' }; + await getLockedVersions(packageFiles); + expect(packageFiles).toEqual([ + { + constraints: { yarn: '3.2.0' }, + deps: [ + { currentValue: '1.0.0', depName: 'a', lockedVersion: '1.0.0' }, + { currentValue: '2.0.0', depName: 'b', lockedVersion: '2.0.0' }, + { + currentValue: '^3.2.0', + depName: 'yarn', + depType: 'engines', + lockedVersion: undefined, + packageName: '@yarnpkg/cli', + }, + { + currentValue: '3.2.0', + depName: 'yarn', + depType: 'packageManager', + lockedVersion: undefined, + packageName: '@yarnpkg/cli', + }, + ], + lockFiles: ['yarn.lock'], + npmLock: 'package-lock.json', + yarnLock: 'yarn.lock', + }, + ]); + }); + it('uses package-lock.json with npm v6.0.0', async () => { npm.getNpmLock.mockReturnValue({ lockedVersions: { a: '1.0.0', b: '2.0.0', c: '3.0.0' }, diff --git a/lib/modules/manager/npm/extract/locked-versions.ts b/lib/modules/manager/npm/extract/locked-versions.ts index 442ae37e2df227..3c1d9f1cac671f 100644 --- a/lib/modules/manager/npm/extract/locked-versions.ts +++ b/lib/modules/manager/npm/extract/locked-versions.ts @@ -21,7 +21,7 @@ export async function getLockedVersions( lockFileCache[yarnLock] = await getYarnLock(yarnLock); } const { lockfileVersion, isYarn1 } = lockFileCache[yarnLock]; - if (!isYarn1) { + if (!isYarn1 && !packageFile.constraints?.yarn) { if (lockfileVersion && lockfileVersion >= 8) { // https://github.com/yarnpkg/berry/commit/9bcd27ae34aee77a567dd104947407532fa179b3 // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion diff --git a/lib/modules/manager/npm/extract/monorepo.spec.ts b/lib/modules/manager/npm/extract/monorepo.spec.ts index 68c91a4717d7c2..c75bac3a2abaf1 100644 --- a/lib/modules/manager/npm/extract/monorepo.spec.ts +++ b/lib/modules/manager/npm/extract/monorepo.spec.ts @@ -1,3 +1,4 @@ +import type { PackageFile } from '../../types'; import { detectMonorepos } from './monorepo'; jest.mock('./pnpm'); @@ -5,14 +6,13 @@ jest.mock('./pnpm'); describe('modules/manager/npm/extract/monorepo', () => { describe('.extractPackageFile()', () => { it('uses lerna package settings', async () => { - const packageFiles = [ + const packageFiles: Partial[] = [ { packageFile: 'package.json', managerData: { lernaJsonFile: 'lerna.json', }, lernaPackages: ['packages/*'], - packages: ['packages/*'], deps: [ { depName: '@org/a', @@ -47,10 +47,10 @@ describe('modules/manager/npm/extract/monorepo', () => { packageFile: 'packages/b/package.json', packageJsonName: '@org/b', }, - ] as any; + ]; await detectMonorepos(packageFiles); expect(packageFiles).toMatchSnapshot(); - expect(packageFiles[1].managerData.lernaJsonFile).toBe('lerna.json'); + expect(packageFiles[1].managerData?.lernaJsonFile).toBe('lerna.json'); expect( packageFiles.some((packageFile) => packageFile.deps?.some((dep) => dep.isInternal) @@ -59,14 +59,13 @@ describe('modules/manager/npm/extract/monorepo', () => { }); it('updates internal packages', async () => { - const packageFiles = [ + const packageFiles: Partial[] = [ { packageFile: 'package.json', managerData: { lernaJsonFile: 'lerna.json', }, lernaPackages: ['packages/*'], - packages: ['packages/*'], deps: [ { depName: '@org/a', @@ -101,10 +100,10 @@ describe('modules/manager/npm/extract/monorepo', () => { packageFile: 'packages/b/package.json', packageJsonName: '@org/b', }, - ] as any; + ]; await detectMonorepos(packageFiles); expect(packageFiles).toMatchSnapshot(); - expect(packageFiles[1].managerData.lernaJsonFile).toBe('lerna.json'); + expect(packageFiles[1].managerData?.lernaJsonFile).toBe('lerna.json'); expect( packageFiles.some((packageFile) => packageFile.deps?.some((dep) => dep.isInternal) @@ -113,7 +112,7 @@ describe('modules/manager/npm/extract/monorepo', () => { }); it('uses yarn workspaces package settings with lerna', async () => { - const packageFiles = [ + const packageFiles: Partial[] = [ { packageFile: 'package.json', managerData: { @@ -134,11 +133,11 @@ describe('modules/manager/npm/extract/monorepo', () => { ]; await detectMonorepos(packageFiles); expect(packageFiles).toMatchSnapshot(); - expect(packageFiles[1].managerData.lernaJsonFile).toBe('lerna.json'); + expect(packageFiles[1].managerData?.lernaJsonFile).toBe('lerna.json'); }); it('uses yarn workspaces package settings without lerna', async () => { - const packageFiles = [ + const packageFiles: Partial[] = [ { packageFile: 'package.json', npmrc: '@org:registry=//registry.some.org\n', @@ -162,8 +161,53 @@ describe('modules/manager/npm/extract/monorepo', () => { ]); }); + it('uses yarn workspaces package settings with contraints', async () => { + const packageFiles: Partial[] = [ + { + packageFile: 'package.json', + yarnWorkspacesPackages: ['docs'], + skipInstalls: true, // coverage + constraints: { + node: '^14.15.0 || >=16.13.0', + yarn: '3.2.1', + }, + yarnLock: 'yarn.lock', + managerData: { + hasPackageManager: true, + }, + }, + { + packageFile: 'docs/package.json', + packageJsonName: 'docs', + yarnLock: 'yarn.lock', + constraints: { yarn: '^3.2.0' }, + }, + ]; + await detectMonorepos(packageFiles); + expect(packageFiles).toMatchObject([ + { + constraints: { + node: '^14.15.0 || >=16.13.0', + yarn: '3.2.1', + }, + managerData: { + hasPackageManager: true, + }, + }, + { + constraints: { + node: '^14.15.0 || >=16.13.0', + yarn: '^3.2.0', + }, + managerData: { + hasPackageManager: true, + }, + }, + ]); + }); + it('uses yarnZeroInstall and skipInstalls from yarn workspaces package settings', async () => { - const packageFiles = [ + const packageFiles: Partial[] = [ { packageFile: 'package.json', managerData: { diff --git a/lib/modules/manager/npm/extract/monorepo.ts b/lib/modules/manager/npm/extract/monorepo.ts index ea7aec797c1d78..31581102b35876 100644 --- a/lib/modules/manager/npm/extract/monorepo.ts +++ b/lib/modules/manager/npm/extract/monorepo.ts @@ -22,7 +22,8 @@ export async function detectMonorepos( yarnWorkspacesPackages, skipInstalls, } = p; - const { lernaJsonFile, yarnZeroInstall } = managerData; + const { lernaJsonFile, yarnZeroInstall, hasPackageManager } = managerData; + const packages = yarnWorkspacesPackages || lernaPackages; if (packages?.length) { const internalPackagePatterns = ( @@ -51,6 +52,7 @@ export async function detectMonorepos( subPackage.managerData = subPackage.managerData || {}; subPackage.managerData.lernaJsonFile = lernaJsonFile; subPackage.managerData.yarnZeroInstall = yarnZeroInstall; + subPackage.managerData.hasPackageManager = hasPackageManager; subPackage.lernaClient = lernaClient; subPackage.yarnLock = subPackage.yarnLock || yarnLock; subPackage.npmLock = subPackage.npmLock || npmLock; @@ -60,6 +62,13 @@ export async function detectMonorepos( subPackage.npmrc = subPackage.npmrc || npmrc; } + if (p.constraints) { + subPackage.constraints = { + ...p.constraints, + ...subPackage.constraints, + }; + } + subPackage.deps?.forEach((dep) => { if (internalPackageNames.includes(dep.depName)) { dep.isInternal = true; From 94a39ae33d2b574c6b7bbf3755bd968c98732891 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Fri, 10 Jun 2022 19:24:41 +0200 Subject: [PATCH 074/240] feat(manager/nuget): cache restored packages (#15984) --- .../__snapshots__/artifacts.spec.ts.snap | 27 ++++++++++++------- lib/modules/manager/nuget/artifacts.spec.ts | 11 ++++---- lib/modules/manager/nuget/artifacts.ts | 24 ++++++++--------- lib/modules/manager/nuget/util.ts | 6 ----- 4 files changed, 35 insertions(+), 33 deletions(-) diff --git a/lib/modules/manager/nuget/__snapshots__/artifacts.spec.ts.snap b/lib/modules/manager/nuget/__snapshots__/artifacts.spec.ts.snap index 74b00038628dc4..259826a3c51bdf 100644 --- a/lib/modules/manager/nuget/__snapshots__/artifacts.spec.ts.snap +++ b/lib/modules/manager/nuget/__snapshots__/artifacts.spec.ts.snap @@ -3,7 +3,7 @@ exports[`modules/manager/nuget/artifacts aborts if lock file is unchanged 1`] = ` Array [ Object { - "cmd": "dotnet restore 'path/with space/project.csproj' --force-evaluate --configfile others/nuget/not-so-random/nuget.config", + "cmd": "dotnet restore 'path/with space/project.csproj' --force-evaluate --configfile /tmp/renovate/cache/__renovate-private-cache/nuget/nuget.config", "options": Object { "cwd": "/tmp/github/some/repo", "encoding": "utf-8", @@ -14,6 +14,7 @@ Array [ "LANG": "en_US.UTF-8", "LC_ALL": "en_US", "NO_PROXY": "localhost", + "NUGET_PACKAGES": "/tmp/renovate/cache/__renovate-private-cache/nuget/packages", "PATH": "/tmp/path", }, "maxBuffer": 10485760, @@ -26,7 +27,7 @@ Array [ exports[`modules/manager/nuget/artifacts authenticates at registries 1`] = ` Array [ Object { - "cmd": "dotnet nuget add source https://my-registry.example.org/ --configfile others/nuget/not-so-random/nuget.config --name myRegistry --username some-username --password some-password --store-password-in-clear-text", + "cmd": "dotnet nuget add source https://my-registry.example.org/ --configfile /tmp/renovate/cache/__renovate-private-cache/nuget/nuget.config --name myRegistry --username some-username --password some-password --store-password-in-clear-text", "options": Object { "cwd": "/tmp/github/some/repo", "encoding": "utf-8", @@ -37,6 +38,7 @@ Array [ "LANG": "en_US.UTF-8", "LC_ALL": "en_US", "NO_PROXY": "localhost", + "NUGET_PACKAGES": "/tmp/renovate/cache/__renovate-private-cache/nuget/packages", "PATH": "/tmp/path", }, "maxBuffer": 10485760, @@ -44,7 +46,7 @@ Array [ }, }, Object { - "cmd": "dotnet restore project.csproj --force-evaluate --configfile others/nuget/not-so-random/nuget.config", + "cmd": "dotnet restore project.csproj --force-evaluate --configfile /tmp/renovate/cache/__renovate-private-cache/nuget/nuget.config", "options": Object { "cwd": "/tmp/github/some/repo", "encoding": "utf-8", @@ -55,6 +57,7 @@ Array [ "LANG": "en_US.UTF-8", "LC_ALL": "en_US", "NO_PROXY": "localhost", + "NUGET_PACKAGES": "/tmp/renovate/cache/__renovate-private-cache/nuget/packages", "PATH": "/tmp/path", }, "maxBuffer": 10485760, @@ -67,7 +70,7 @@ Array [ exports[`modules/manager/nuget/artifacts performs lock file maintenance 1`] = ` Array [ Object { - "cmd": "dotnet restore project.csproj --force-evaluate --configfile others/nuget/not-so-random/nuget.config", + "cmd": "dotnet restore project.csproj --force-evaluate --configfile /tmp/renovate/cache/__renovate-private-cache/nuget/nuget.config", "options": Object { "cwd": "/tmp/github/some/repo", "encoding": "utf-8", @@ -78,6 +81,7 @@ Array [ "LANG": "en_US.UTF-8", "LC_ALL": "en_US", "NO_PROXY": "localhost", + "NUGET_PACKAGES": "/tmp/renovate/cache/__renovate-private-cache/nuget/packages", "PATH": "/tmp/path", }, "maxBuffer": 10485760, @@ -90,7 +94,7 @@ Array [ exports[`modules/manager/nuget/artifacts strips protocol version from feed url 1`] = ` Array [ Object { - "cmd": "dotnet nuget add source https://my-registry.example.org/ --configfile others/nuget/not-so-random/nuget.config --name myRegistry", + "cmd": "dotnet nuget add source https://my-registry.example.org/ --configfile /tmp/renovate/cache/__renovate-private-cache/nuget/nuget.config --name myRegistry", "options": Object { "cwd": "/tmp/github/some/repo", "encoding": "utf-8", @@ -101,6 +105,7 @@ Array [ "LANG": "en_US.UTF-8", "LC_ALL": "en_US", "NO_PROXY": "localhost", + "NUGET_PACKAGES": "/tmp/renovate/cache/__renovate-private-cache/nuget/packages", "PATH": "/tmp/path", }, "maxBuffer": 10485760, @@ -108,7 +113,7 @@ Array [ }, }, Object { - "cmd": "dotnet restore project.csproj --force-evaluate --configfile others/nuget/not-so-random/nuget.config", + "cmd": "dotnet restore project.csproj --force-evaluate --configfile /tmp/renovate/cache/__renovate-private-cache/nuget/nuget.config", "options": Object { "cwd": "/tmp/github/some/repo", "encoding": "utf-8", @@ -119,6 +124,7 @@ Array [ "LANG": "en_US.UTF-8", "LC_ALL": "en_US", "NO_PROXY": "localhost", + "NUGET_PACKAGES": "/tmp/renovate/cache/__renovate-private-cache/nuget/packages", "PATH": "/tmp/path", }, "maxBuffer": 10485760, @@ -143,7 +149,7 @@ Array [ }, }, Object { - "cmd": "docker run --rm --name=renovate_dotnet --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -w \\"/tmp/github/some/repo\\" renovate/dotnet bash -l -c \\"dotnet restore project.csproj --force-evaluate --configfile others/nuget/not-so-random/nuget.config\\"", + "cmd": "docker run --rm --name=renovate_dotnet --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -e NUGET_PACKAGES -w \\"/tmp/github/some/repo\\" renovate/dotnet bash -l -c \\"dotnet restore project.csproj --force-evaluate --configfile /tmp/renovate/cache/__renovate-private-cache/nuget/nuget.config\\"", "options": Object { "cwd": "/tmp/github/some/repo", "encoding": "utf-8", @@ -154,6 +160,7 @@ Array [ "LANG": "en_US.UTF-8", "LC_ALL": "en_US", "NO_PROXY": "localhost", + "NUGET_PACKAGES": "/tmp/renovate/cache/__renovate-private-cache/nuget/packages", "PATH": "/tmp/path", }, "maxBuffer": 10485760, @@ -166,7 +173,7 @@ Array [ exports[`modules/manager/nuget/artifacts supports global mode 1`] = ` Array [ Object { - "cmd": "dotnet restore project.csproj --force-evaluate --configfile others/nuget/not-so-random/nuget.config", + "cmd": "dotnet restore project.csproj --force-evaluate --configfile /tmp/renovate/cache/__renovate-private-cache/nuget/nuget.config", "options": Object { "cwd": "/tmp/github/some/repo", "encoding": "utf-8", @@ -177,6 +184,7 @@ Array [ "LANG": "en_US.UTF-8", "LC_ALL": "en_US", "NO_PROXY": "localhost", + "NUGET_PACKAGES": "/tmp/renovate/cache/__renovate-private-cache/nuget/packages", "PATH": "/tmp/path", }, "maxBuffer": 10485760, @@ -189,7 +197,7 @@ Array [ exports[`modules/manager/nuget/artifacts updates lock file 1`] = ` Array [ Object { - "cmd": "dotnet restore project.csproj --force-evaluate --configfile others/nuget/not-so-random/nuget.config", + "cmd": "dotnet restore project.csproj --force-evaluate --configfile /tmp/renovate/cache/__renovate-private-cache/nuget/nuget.config", "options": Object { "cwd": "/tmp/github/some/repo", "encoding": "utf-8", @@ -200,6 +208,7 @@ Array [ "LANG": "en_US.UTF-8", "LC_ALL": "en_US", "NO_PROXY": "localhost", + "NUGET_PACKAGES": "/tmp/renovate/cache/__renovate-private-cache/nuget/packages", "PATH": "/tmp/path", }, "maxBuffer": 10485760, diff --git a/lib/modules/manager/nuget/artifacts.spec.ts b/lib/modules/manager/nuget/artifacts.spec.ts index 81ab0977fbd239..490615e940f364 100644 --- a/lib/modules/manager/nuget/artifacts.spec.ts +++ b/lib/modules/manager/nuget/artifacts.spec.ts @@ -16,10 +16,12 @@ jest.mock('../../../util/host-rules'); jest.mock('../../../util/git'); jest.mock('./util'); -const { getConfiguredRegistries, getDefaultRegistries, getRandomString } = - mocked(util); +const { getConfiguredRegistries, getDefaultRegistries } = mocked(util); const hostRules = mocked(_hostRules); +const realFs: typeof import('../../../util/fs') = + jest.requireActual('../../../util/fs'); + const adminConfig: RepoGlobalConfig = { // `join` fixes Windows CI localDir: join('/tmp/github/some/repo'), @@ -34,11 +36,8 @@ describe('modules/manager/nuget/artifacts', () => { jest.resetModules(); getDefaultRegistries.mockReturnValue([]); env.getChildProcessEnv.mockReturnValue(envMock.basic); - fs.ensureCacheDir.mockImplementation((dirName: string) => - Promise.resolve(`others/${dirName}`) - ); + fs.privateCacheDir.mockImplementation(realFs.privateCacheDir); git.getFileList.mockResolvedValueOnce([]); - getRandomString.mockReturnValue('not-so-random'); GlobalConfig.set(adminConfig); docker.resetPrefetchedImages(); }); diff --git a/lib/modules/manager/nuget/artifacts.ts b/lib/modules/manager/nuget/artifacts.ts index 7869790a978d6d..aef764c406b209 100644 --- a/lib/modules/manager/nuget/artifacts.ts +++ b/lib/modules/manager/nuget/artifacts.ts @@ -5,11 +5,11 @@ import { logger } from '../../../logger'; import { exec } from '../../../util/exec'; import type { ExecOptions } from '../../../util/exec/types'; import { - ensureCacheDir, + ensureDir, getSiblingFileName, outputFile, + privateCacheDir, readLocalFile, - remove, writeLocalFile, } from '../../../util/fs'; import { getFile } from '../../../util/git'; @@ -27,11 +27,7 @@ import { NUGET_CENTRAL_FILE, getDependentPackageFiles, } from './package-tree'; -import { - getConfiguredRegistries, - getDefaultRegistries, - getRandomString, -} from './util'; +import { getConfiguredRegistries, getDefaultRegistries } from './util'; async function addSourceCmds( packageFileName: string, @@ -70,15 +66,19 @@ async function runDotnetRestore( dependentPackageFileNames: string[], config: UpdateArtifactsConfig ): Promise { + const nugetCacheDir = join(privateCacheDir(), 'nuget'); + const execOptions: ExecOptions = { docker: { image: 'dotnet', }, + extraEnv: { NUGET_PACKAGES: join(nugetCacheDir, 'packages') }, }; - const nugetCacheDir = await ensureCacheDir('nuget'); - const nugetConfigDir = join(nugetCacheDir, `${getRandomString()}`); - const nugetConfigFile = join(nugetConfigDir, `nuget.config`); + const nugetConfigFile = join(nugetCacheDir, `nuget.config`); + + await ensureDir(nugetCacheDir); + await outputFile( nugetConfigFile, `\n\n\n` @@ -94,7 +94,6 @@ async function runDotnetRestore( ), ]; await exec(cmds, execOptions); - await remove(nugetConfigDir); } async function getLockFileContentMap( @@ -220,7 +219,8 @@ export async function updateArtifacts({ { artifactError: { lockFile: lockFileNames.join(', '), - stderr: err.message, + // error is written to stdout + stderr: err.stdout || err.message, }, }, ]; diff --git a/lib/modules/manager/nuget/util.ts b/lib/modules/manager/nuget/util.ts index 694eadadda2f49..ff48cbb0dcea6f 100644 --- a/lib/modules/manager/nuget/util.ts +++ b/lib/modules/manager/nuget/util.ts @@ -1,4 +1,3 @@ -import cryptoRandomString from 'crypto-random-string'; import upath from 'upath'; import { XmlDocument } from 'xmldoc'; import { logger } from '../../../logger'; @@ -18,11 +17,6 @@ async function readFileAsXmlDocument( } } -/* istanbul ignore next */ -export function getRandomString(): string { - return cryptoRandomString({ length: 16 }); -} - const defaultRegistries = defaultRegistryUrls.map( (registryUrl) => ({ url: registryUrl } as Registry) ); From c454b0cda8dca7359956647bcd0c4544e62297ec Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 10 Jun 2022 19:34:13 +0000 Subject: [PATCH 075/240] chore(deps): update node.js to c0625ae (#16004) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .devcontainer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 317f44854f124a..c2fee237d2807a 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM containerbase/node:14.19.3@sha256:0f29671cfd515e27ab91c69c3221f38c1db5859e60185bf137a192eb818a42c0 +FROM containerbase/node:14.19.3@sha256:c0625aee5e86099a4680ba316a9b82d9988a1b6494009e2a9ad1fabb368d5c69 USER root From cefaa7f2d280d12f5556a491f1d794e80747d800 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 10 Jun 2022 19:46:56 +0000 Subject: [PATCH 076/240] chore(deps): update dependency nock to v13.2.6 (#16005) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 15 +++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index b26c6ccf1b4bf5..b87291e18f5b1a 100644 --- a/package.json +++ b/package.json @@ -288,7 +288,7 @@ "memfs": "3.4.4", "mock-fs": "5.1.2", "mockdate": "3.0.5", - "nock": "13.2.4", + "nock": "13.2.6", "npm-run-all": "4.1.5", "prettier": "2.6.2", "pretty-quick": "3.1.3", diff --git a/yarn.lock b/yarn.lock index 84be33e7709eab..3352b8b857de15 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6749,11 +6749,6 @@ lodash.merge@^4.6.2: resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== -lodash.set@^4.3.2: - version "4.3.2" - resolved "https://registry.yarnpkg.com/lodash.set/-/lodash.set-4.3.2.tgz#d8757b1da807dde24816b0d6a84bea1a76230b23" - integrity sha512-4hNPN5jlm/N/HLMCO43v8BXKq9Z7QdAGc/VGrRD61w8gN9g/6jF9A4L1pbUgBLCffi0w9VsXfTOij5x8iTyFvg== - lodash.uniqby@^4.7.0: version "4.7.0" resolved "https://registry.yarnpkg.com/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz#d99c07a669e9e6d24e1362dfe266c67616af1302" @@ -7374,14 +7369,14 @@ nise@^5.1.0: just-extend "^4.0.2" path-to-regexp "^1.7.0" -nock@13.2.4: - version "13.2.4" - resolved "https://registry.yarnpkg.com/nock/-/nock-13.2.4.tgz#43a309d93143ee5cdcca91358614e7bde56d20e1" - integrity sha512-8GPznwxcPNCH/h8B+XZcKjYPXnUV5clOKCjAqyjsiqA++MpNx9E9+t8YPp0MbThO+KauRo7aZJ1WuIZmOrT2Ug== +nock@13.2.6: + version "13.2.6" + resolved "https://registry.yarnpkg.com/nock/-/nock-13.2.6.tgz#35e419cd9d385ffa67e59523d9699e41b29e1a03" + integrity sha512-GbyeSwSEP0FYouzETZ0l/XNm5tNcDNcXJKw3LCAb+mx8bZSwg1wEEvdL0FAyg5TkBJYiWSCtw6ag4XfmBy60FA== dependencies: debug "^4.1.0" json-stringify-safe "^5.0.1" - lodash.set "^4.3.2" + lodash "^4.17.21" propagate "^2.0.0" node-emoji@^1.11.0: From 7af1f6a58789f4955558cc03a969da545d2d201b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 10 Jun 2022 22:47:10 +0000 Subject: [PATCH 077/240] chore(deps): update dependency ts-node to v10.8.1 (#16008) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index b87291e18f5b1a..331457554542a8 100644 --- a/package.json +++ b/package.json @@ -298,7 +298,7 @@ "strip-ansi": "6.0.1", "tmp-promise": "3.0.3", "ts-jest": "27.1.5", - "ts-node": "10.8.0", + "ts-node": "10.8.1", "type-fest": "2.12.2", "typescript": "4.6.4", "unified": "9.2.2" diff --git a/yarn.lock b/yarn.lock index 3352b8b857de15..94e88246161876 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9366,10 +9366,10 @@ ts-jest@27.1.5: semver "7.x" yargs-parser "20.x" -ts-node@10.8.0: - version "10.8.0" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.8.0.tgz#3ceb5ac3e67ae8025c1950626aafbdecb55d82ce" - integrity sha512-/fNd5Qh+zTt8Vt1KbYZjRHCE9sI5i7nqfD/dzBBRDeVXZXS6kToW6R7tTU6Nd4XavFs0mAVCg29Q//ML7WsZYA== +ts-node@10.8.1: + version "10.8.1" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.8.1.tgz#ea2bd3459011b52699d7e88daa55a45a1af4f066" + integrity sha512-Wwsnao4DQoJsN034wePSg5nZiw4YKXf56mPIAeD6wVmiv+RytNSWqc2f3fKvcUoV+Yn2+yocD71VOfQHbmVX4g== dependencies: "@cspotcode/source-map-support" "^0.8.0" "@tsconfig/node10" "^1.0.7" From c2fc9312da10e638c54d911bbbc72aedd0fd26a8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 10 Jun 2022 23:00:10 +0000 Subject: [PATCH 078/240] chore(deps): update dependency eslint to v8.17.0 (#16009) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 331457554542a8..a983e60cb94f98 100644 --- a/package.json +++ b/package.json @@ -265,7 +265,7 @@ "cross-env": "7.0.3", "diff": "5.1.0", "emojibase-data": "7.0.1", - "eslint": "8.16.0", + "eslint": "8.17.0", "eslint-config-prettier": "8.5.0", "eslint-formatter-gha": "1.4.1", "eslint-import-resolver-typescript": "2.7.1", diff --git a/yarn.lock b/yarn.lock index 94e88246161876..95e820b8ed4eca 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4544,10 +4544,10 @@ eslint-visitor-keys@^3.3.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== -eslint@8.16.0: - version "8.16.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.16.0.tgz#6d936e2d524599f2a86c708483b4c372c5d3bbae" - integrity sha512-MBndsoXY/PeVTDJeWsYj7kLZ5hQpJOfMYLsF6LicLHQWbRDG19lK5jOix4DPl8yY4SUFcE3txy86OzFLWT+yoA== +eslint@8.17.0: + version "8.17.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.17.0.tgz#1cfc4b6b6912f77d24b874ca1506b0fe09328c21" + integrity sha512-gq0m0BTJfci60Fz4nczYxNAlED+sMcihltndR8t9t1evnU/azx53x3t2UHXC/uRjcbvRw/XctpaNygSTcQD+Iw== dependencies: "@eslint/eslintrc" "^1.3.0" "@humanwhocodes/config-array" "^0.9.2" From dbf3aefc13a6e81a77a0768e693aa54048fcc71e Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Sat, 11 Jun 2022 10:14:43 +0300 Subject: [PATCH 079/240] refactor(changelog): Unify argument lists for the call hierarchy (#16013) --- .../update/pr/changelog/github/index.ts | 15 +++++-- .../update/pr/changelog/gitlab/index.ts | 16 +++++-- .../update/pr/changelog/release-notes.spec.ts | 42 ++++++++++++------- .../update/pr/changelog/release-notes.ts | 14 ++++--- 4 files changed, 59 insertions(+), 28 deletions(-) diff --git a/lib/workers/repository/update/pr/changelog/github/index.ts b/lib/workers/repository/update/pr/changelog/github/index.ts index 5f8817ef7d2a9a..92c92d6656fbe5 100644 --- a/lib/workers/repository/update/pr/changelog/github/index.ts +++ b/lib/workers/repository/update/pr/changelog/github/index.ts @@ -10,7 +10,12 @@ import type { import { GithubHttp } from '../../../../../../util/http/github'; import { fromBase64 } from '../../../../../../util/string'; import { ensureTrailingSlash } from '../../../../../../util/url'; -import type { ChangeLogFile, ChangeLogNotes } from '../types'; +import type { + ChangeLogFile, + ChangeLogNotes, + ChangeLogProject, + ChangeLogRelease, +} from '../types'; export const id = 'github-changelog'; const http = new GithubHttp(id); @@ -107,10 +112,14 @@ export async function getReleaseNotesMd( } export async function getReleaseList( - apiBaseUrl: string, - repository: string + project: ChangeLogProject, + _release: ChangeLogRelease ): Promise { logger.trace('github.getReleaseList()'); + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + const apiBaseUrl = project.apiBaseUrl!; + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + const repository = project.repository!; const notesSourceUrl = `${ensureTrailingSlash( apiBaseUrl )}repos/${repository}/releases`; diff --git a/lib/workers/repository/update/pr/changelog/gitlab/index.ts b/lib/workers/repository/update/pr/changelog/gitlab/index.ts index d20be75218d918..c24f431aacb732 100644 --- a/lib/workers/repository/update/pr/changelog/gitlab/index.ts +++ b/lib/workers/repository/update/pr/changelog/gitlab/index.ts @@ -5,7 +5,12 @@ import type { GitlabTag } from '../../../../../../modules/datasource/gitlab-tags import type { GitlabTreeNode } from '../../../../../../types/platform/gitlab'; import { GitlabHttp } from '../../../../../../util/http/gitlab'; import { ensureTrailingSlash } from '../../../../../../util/url'; -import type { ChangeLogFile, ChangeLogNotes } from '../types'; +import type { + ChangeLogFile, + ChangeLogNotes, + ChangeLogProject, + ChangeLogRelease, +} from '../types'; export const id = 'gitlab-changelog'; const http = new GitlabHttp(id); @@ -91,11 +96,14 @@ export async function getReleaseNotesMd( } export async function getReleaseList( - apiBaseUrl: string, - repository: string + project: ChangeLogProject, + _release: ChangeLogRelease ): Promise { logger.trace('gitlab.getReleaseNotesMd()'); - + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + const apiBaseUrl = project.apiBaseUrl!; + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + const repository = project.repository!; const urlEncodedRepo = encodeURIComponent(repository); const apiUrl = `${ensureTrailingSlash( apiBaseUrl diff --git a/lib/workers/repository/update/pr/changelog/release-notes.spec.ts b/lib/workers/repository/update/pr/changelog/release-notes.spec.ts index c138e0d9d0d82c..9580a00edbf327 100644 --- a/lib/workers/repository/update/pr/changelog/release-notes.spec.ts +++ b/lib/workers/repository/update/pr/changelog/release-notes.spec.ts @@ -172,7 +172,10 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { describe('getReleaseList()', () => { it('should return empty array if no apiBaseUrl', async () => { - const res = await getReleaseList({} as ChangeLogProject); + const res = await getReleaseList( + {} as ChangeLogProject, + {} as ChangeLogRelease + ); expect(res).toBeEmptyArray(); }); @@ -186,10 +189,13 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { }, ] as never); - const res = await getReleaseList({ - ...githubProject, - repository: 'some/yet-other-repository', - }); + const res = await getReleaseList( + { + ...githubProject, + repository: 'some/yet-other-repository', + }, + {} as ChangeLogRelease + ); expect(res).toMatchSnapshot([ { notesSourceUrl: @@ -218,10 +224,13 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { body: 'some body #123, [#124](https://gitlab.com/some/yet-other-repository/issues/124)', }, ]); - const res = await getReleaseList({ - ...gitlabProject, - repository: 'some/yet-other-repository', - }); + const res = await getReleaseList( + { + ...gitlabProject, + repository: 'some/yet-other-repository', + }, + {} as ChangeLogRelease + ); expect(res).toMatchSnapshot([ { notesSourceUrl: @@ -252,12 +261,15 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { body: 'some body #123, [#124](https://my.custom.domain/some/yet-other-repository/issues/124)', }, ]); - const res = await getReleaseList({ - ...gitlabProject, - repository: 'some/yet-other-repository', - apiBaseUrl: 'https://my.custom.domain/api/v4/', - baseUrl: 'https://my.custom.domain/', - }); + const res = await getReleaseList( + { + ...gitlabProject, + repository: 'some/yet-other-repository', + apiBaseUrl: 'https://my.custom.domain/api/v4/', + baseUrl: 'https://my.custom.domain/', + }, + {} as ChangeLogRelease + ); expect(res).toMatchSnapshot([ { notesSourceUrl: diff --git a/lib/workers/repository/update/pr/changelog/release-notes.ts b/lib/workers/repository/update/pr/changelog/release-notes.ts index 561b8411923656..71c0a8aed6ee8a 100644 --- a/lib/workers/repository/update/pr/changelog/release-notes.ts +++ b/lib/workers/repository/update/pr/changelog/release-notes.ts @@ -22,16 +22,17 @@ const markdown = new MarkdownIt('zero'); markdown.enable(['heading', 'lheading']); export async function getReleaseList( - project: ChangeLogProject + project: ChangeLogProject, + release: ChangeLogRelease ): Promise { logger.trace('getReleaseList()'); const { apiBaseUrl, repository, type } = project; try { switch (type) { case 'gitlab': - return await gitlab.getReleaseList(apiBaseUrl, repository); + return await gitlab.getReleaseList(project, release); case 'github': - return await github.getReleaseList(apiBaseUrl, repository); + return await github.getReleaseList(project, release); default: logger.warn({ apiBaseUrl, repository, type }, 'Invalid project type'); @@ -51,7 +52,8 @@ export async function getReleaseList( } export function getCachedReleaseList( - project: ChangeLogProject + project: ChangeLogProject, + release: ChangeLogRelease ): Promise { const cacheKey = `getReleaseList-${project.apiBaseUrl}-${project.repository}`; const cachedResult = memCache.get>(cacheKey); @@ -59,7 +61,7 @@ export function getCachedReleaseList( if (cachedResult !== undefined) { return cachedResult; } - const promisedRes = getReleaseList(project); + const promisedRes = getReleaseList(project, release); memCache.set(cacheKey, promisedRes); return promisedRes; } @@ -103,7 +105,7 @@ export async function getReleaseNotes( const { depName, repository } = project; const { version, gitRef } = release; logger.trace(`getReleaseNotes(${repository}, ${version}, ${depName})`); - const releases = await getCachedReleaseList(project); + const releases = await getCachedReleaseList(project, release); logger.trace({ releases }, 'Release list from getReleaseList'); let releaseNotes: ChangeLogNotes | null = null; From 707ce328130c568e053c147f674ee987f83dd4a4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 11 Jun 2022 12:11:16 +0000 Subject: [PATCH 080/240] build(deps): update dependency semantic-release to v19.0.3 [security] (#16016) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index a983e60cb94f98..cbb490802d3b71 100644 --- a/package.json +++ b/package.json @@ -293,7 +293,7 @@ "prettier": "2.6.2", "pretty-quick": "3.1.3", "rimraf": "3.0.2", - "semantic-release": "19.0.2", + "semantic-release": "19.0.3", "shelljs": "0.8.5", "strip-ansi": "6.0.1", "tmp-promise": "3.0.3", diff --git a/yarn.lock b/yarn.lock index 95e820b8ed4eca..95b0c92b0c58bd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8648,10 +8648,10 @@ saxes@^5.0.1: dependencies: xmlchars "^2.2.0" -semantic-release@19.0.2: - version "19.0.2" - resolved "https://registry.yarnpkg.com/semantic-release/-/semantic-release-19.0.2.tgz#6011683c06d7b416e5faa5a3f43b22bbf3798aa8" - integrity sha512-7tPonjZxukKECmClhsfyMKDt0GR38feIC2HxgyYaBi+9tDySBLjK/zYDLhh+m6yjnHIJa9eBTKYE7k63ZQcYbw== +semantic-release@19.0.3: + version "19.0.3" + resolved "https://registry.yarnpkg.com/semantic-release/-/semantic-release-19.0.3.tgz#9291053ad9890052f28e7c5921d4741530d516fd" + integrity sha512-HaFbydST1cDKZHuFZxB8DTrBLJVK/AnDExpK0s3EqLIAAUAHUgnd+VSJCUtTYQKkAkauL8G9CucODrVCc7BuAA== dependencies: "@semantic-release/commit-analyzer" "^9.0.2" "@semantic-release/error" "^3.0.0" From 09f14289d1a1d65b16debb64d36b33e2e487d6a2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 11 Jun 2022 16:05:18 +0000 Subject: [PATCH 081/240] build(deps): update dependency @renovatebot/pep440 to v2.1.2 (#16017) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index cbb490802d3b71..6dd6f171b12bcd 100644 --- a/package.json +++ b/package.json @@ -139,7 +139,7 @@ "@cheap-glitch/mi-cron": "1.0.1", "@iarna/toml": "2.2.5", "@jamiemagee/osv-offline": "1.2.7", - "@renovatebot/pep440": "2.1.1", + "@renovatebot/pep440": "2.1.2", "@renovatebot/ruby-semver": "1.1.3", "@sindresorhus/is": "4.6.0", "@yarnpkg/core": "3.1.0", diff --git a/yarn.lock b/yarn.lock index 95b0c92b0c58bd..05cdaf0c9e49a0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2047,10 +2047,10 @@ uid "0c444386e79d6145901212507521b8a0a48af000" resolved "https://github.com/renovatebot/eslint-plugin#0c444386e79d6145901212507521b8a0a48af000" -"@renovatebot/pep440@2.1.1": - version "2.1.1" - resolved "https://registry.yarnpkg.com/@renovatebot/pep440/-/pep440-2.1.1.tgz#fb1affdcfcc7d9e8c6f46a817d9cb4f741acbc28" - integrity sha512-B6icy/x5ANwDGIUU3aTT+Y1zDCOkqjBtIpuTLcOENCYxLiAXwiZOn0sGEwpmwv2FF9VcuG0DSW5ZOdzpkmZI6g== +"@renovatebot/pep440@2.1.2": + version "2.1.2" + resolved "https://registry.yarnpkg.com/@renovatebot/pep440/-/pep440-2.1.2.tgz#2daf92c1f3641d38698a594ebbc6749a890c9ec6" + integrity sha512-5E61yI69foKY0hxoYWabUZLYras9S3Mrzrz7bhf4W5pKVZJse1ypNUjKW5bsiSQoAiZqXFECiD0q1Nw8LA3gyQ== "@renovatebot/ruby-semver@1.1.3": version "1.1.3" From 2aa67794f41bb30c766e9e7bc9ea3e786068bbf7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 11 Jun 2022 16:16:42 +0000 Subject: [PATCH 082/240] build(deps): update dependency @renovatebot/ruby-semver to v1.1.4 (#16018) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 6dd6f171b12bcd..558f073c915e40 100644 --- a/package.json +++ b/package.json @@ -140,7 +140,7 @@ "@iarna/toml": "2.2.5", "@jamiemagee/osv-offline": "1.2.7", "@renovatebot/pep440": "2.1.2", - "@renovatebot/ruby-semver": "1.1.3", + "@renovatebot/ruby-semver": "1.1.4", "@sindresorhus/is": "4.6.0", "@yarnpkg/core": "3.1.0", "@yarnpkg/parsers": "2.5.1", diff --git a/yarn.lock b/yarn.lock index 05cdaf0c9e49a0..2e5c0533f777ca 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2052,10 +2052,10 @@ resolved "https://registry.yarnpkg.com/@renovatebot/pep440/-/pep440-2.1.2.tgz#2daf92c1f3641d38698a594ebbc6749a890c9ec6" integrity sha512-5E61yI69foKY0hxoYWabUZLYras9S3Mrzrz7bhf4W5pKVZJse1ypNUjKW5bsiSQoAiZqXFECiD0q1Nw8LA3gyQ== -"@renovatebot/ruby-semver@1.1.3": - version "1.1.3" - resolved "https://registry.yarnpkg.com/@renovatebot/ruby-semver/-/ruby-semver-1.1.3.tgz#f6996a8002ffabf80c687c29d441880410cfa118" - integrity sha512-lBeF7M43v2zc3Z5tx/qcfOy/yWDRSWWikZ6wtngTpyLcdEiZ2YXevP2Sfp+aXzRAAKZyYNq2h0WF5/WZBNGwiw== +"@renovatebot/ruby-semver@1.1.4": + version "1.1.4" + resolved "https://registry.yarnpkg.com/@renovatebot/ruby-semver/-/ruby-semver-1.1.4.tgz#288de3538b81734a923553bd15dcb795239e529d" + integrity sha512-KWX91/KwehU4LpGXQw0RXtsz4Fk5ZvyAiUVgZefd7/cu66tRKDMqOoVUaNiMuowwxuAnw/DQN1mRxk61WZg1oQ== dependencies: tslib "2.4.0" From 20515ad847903ceb515077b337dcbb1007a274e9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 11 Jun 2022 16:29:28 +0000 Subject: [PATCH 083/240] chore(deps): update dependency expect-more-jest to v5.4.1 (#16019) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 104 ++++++++++++++++++++++++++++++++++++--------------- 2 files changed, 74 insertions(+), 32 deletions(-) diff --git a/package.json b/package.json index 558f073c915e40..1469ddd0340a24 100644 --- a/package.json +++ b/package.json @@ -274,7 +274,7 @@ "eslint-plugin-jest-formatting": "3.1.0", "eslint-plugin-promise": "6.0.0", "eslint-plugin-typescript-enum": "2.1.0", - "expect-more-jest": "5.4.0", + "expect-more-jest": "5.4.1", "glob": "8.0.3", "graphql": "16.5.0", "husky": "7.0.4", diff --git a/yarn.lock b/yarn.lock index 2e5c0533f777ca..6f04b8737bc8a4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1457,6 +1457,13 @@ "@types/node" "*" jest-mock "^27.5.1" +"@jest/expect-utils@28.1.0": + version "28.1.0" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-28.1.0.tgz#a5cde811195515a9809b96748ae8bcc331a3538a" + integrity sha512-5BrG48dpC0sB80wpeIX5FU6kolDJI4K0n5BM9a5V38MGx0pyRvUBSS0u2aNTdDzmOrCjhOg8pGs6a20ivYkdmw== + dependencies: + jest-get-type "^28.0.2" + "@jest/fake-timers@^27.5.1": version "27.5.1" resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.5.1.tgz#76979745ce0579c8a94a4678af7a748eda8ada74" @@ -1509,6 +1516,13 @@ terminal-link "^2.0.0" v8-to-istanbul "^8.1.0" +"@jest/schemas@^28.0.2": + version "28.0.2" + resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-28.0.2.tgz#08c30df6a8d07eafea0aef9fb222c5e26d72e613" + integrity sha512-YVDJZjd4izeTDkij00vHHAymNXQ6WWsdChFRK86qck6Jpr3DCL5W3Is3vslviRlP+bLuMYRLbdp98amMvqudhA== + dependencies: + "@sinclair/typebox" "^0.23.3" + "@jest/source-map@^27.5.1": version "27.5.1" resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-27.5.1.tgz#6608391e465add4205eae073b55e7f279e04e8cf" @@ -1570,7 +1584,7 @@ "@types/yargs" "^15.0.0" chalk "^4.0.0" -"@jest/types@^27.0.6", "@jest/types@^27.5.1": +"@jest/types@^27.5.1": version "27.5.1" resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.5.1.tgz#3c79ec4a8ba61c170bf937bcf9e98a9df175ec80" integrity sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw== @@ -2165,6 +2179,11 @@ lodash "^4.17.4" read-pkg-up "^7.0.0" +"@sinclair/typebox@^0.23.3": + version "0.23.5" + resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.23.5.tgz#93f7b9f4e3285a7a9ade7557d9a8d36809cbc47d" + integrity sha512-AFBVi/iT4g20DHoujvMH1aEDn8fGJh4xsRGCP6d8RpLPMqsNPvW01Jcn0QysXTsg++/xj25NmJsGyH9xug/wKg== + "@sindresorhus/is@4.6.0", "@sindresorhus/is@^4.0.0": version "4.6.0" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.6.0.tgz#3c7c9c46e678feefe7a2e5bb609d3dbd665ffb3f" @@ -4130,6 +4149,11 @@ diff-sequences@^27.5.1: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.5.1.tgz#eaecc0d327fd68c8d9672a1e64ab8dccb2ef5327" integrity sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ== +diff-sequences@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-28.1.1.tgz#9989dc731266dc2903457a70e996f3a041913ac6" + integrity sha512-FU0iFaH/E23a+a718l8Qa/19bF9p06kgE0KipMOMadwa3SjnaElKzPaUC0vnibs6/B/9ni97s61mcejk8W1fQw== + diff@5.1.0, diff@^5.0.0: version "5.1.0" resolved "https://registry.yarnpkg.com/diff/-/diff-5.1.0.tgz#bc52d298c5ea8df9194800224445ed43ffc87e40" @@ -4668,32 +4692,20 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== -expect-more-jest@5.4.0: - version "5.4.0" - resolved "https://registry.yarnpkg.com/expect-more-jest/-/expect-more-jest-5.4.0.tgz#643c7518d30593fa1639d51509a9faa34013de97" - integrity sha512-mbipCcBE5ryzcsuF3sIghMgcNfI9DXtlfoi0Ah0zRMFkKwH2WxUgp93YorQRMIusMohcfy9jR65GrzR6tVb2IQ== +expect-more-jest@5.4.1: + version "5.4.1" + resolved "https://registry.yarnpkg.com/expect-more-jest/-/expect-more-jest-5.4.1.tgz#5352c9fa9481a6b08f5eb8c37c8d90bd4aa2db09" + integrity sha512-+9FiotIgWnZOaZj8e8maR7LESNST88P9lgakL4xFSXPwhKLQz2koSqoSGyXJDdbu85xO6mV/Cnm8pNYjqtN9rg== dependencies: - expect "27.0.6" + "@jest/expect-utils" "28.1.0" expect-more "1.2.0" - jest-matcher-utils "27.0.6" + jest-matcher-utils "28.1.0" expect-more@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/expect-more/-/expect-more-1.2.0.tgz#cc7b3b6ad194ee54deaf601cf5c80449ed7a276d" integrity sha512-AVnjc5oh2jgiJjOrjbiKxbwLlNA/zsl2044Nbd09H4+2KwThtSLYKhdOusLYOrcToFAa2uBOWR1ExCN4kOWgbQ== -expect@27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/expect/-/expect-27.0.6.tgz#a4d74fbe27222c718fff68ef49d78e26a8fd4c05" - integrity sha512-psNLt8j2kwg42jGBDSfAlU49CEZxejN1f1PlANWDZqIhBOVU/c2Pm888FcjWJzFewhIsNWfZJeLjUjtKGiPuSw== - dependencies: - "@jest/types" "^27.0.6" - ansi-styles "^5.0.0" - jest-get-type "^27.0.6" - jest-matcher-utils "^27.0.6" - jest-message-util "^27.0.6" - jest-regex-util "^27.0.6" - expect@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/expect/-/expect-27.5.1.tgz#83ce59f1e5bdf5f9d2b94b61d2050db48f3fef74" @@ -5942,7 +5954,7 @@ jest-config@^27.5.1: slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@^27.0.6, jest-diff@^27.2.5, jest-diff@^27.5.1: +jest-diff@^27.2.5, jest-diff@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.5.1.tgz#a07f5011ac9e6643cf8a95a462b7b1ecf6680def" integrity sha512-m0NvkX55LDt9T4mctTEgnZk3fmEg3NRYutvMPWM/0iPnkFj2wIeF45O1718cMSOFO1vINkqmxqD8vE37uTEbqw== @@ -5952,6 +5964,16 @@ jest-diff@^27.0.6, jest-diff@^27.2.5, jest-diff@^27.5.1: jest-get-type "^27.5.1" pretty-format "^27.5.1" +jest-diff@^28.1.0: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-28.1.1.tgz#1a3eedfd81ae79810931c63a1d0f201b9120106c" + integrity sha512-/MUUxeR2fHbqHoMMiffe/Afm+U8U4olFRJ0hiVG2lZatPJcnGxx292ustVu7bULhjV65IYMxRdploAKLbcrsyg== + dependencies: + chalk "^4.0.0" + diff-sequences "^28.1.1" + jest-get-type "^28.0.2" + pretty-format "^28.1.1" + jest-docblock@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.5.1.tgz#14092f364a42c6108d42c33c8cf30e058e25f6c0" @@ -6008,6 +6030,11 @@ jest-get-type@^27.0.6, jest-get-type@^27.5.1: resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.5.1.tgz#3cd613c507b0f7ace013df407a1c1cd578bcb4f1" integrity sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw== +jest-get-type@^28.0.2: + version "28.0.2" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-28.0.2.tgz#34622e628e4fdcd793d46db8a242227901fcf203" + integrity sha512-ioj2w9/DxSYHfOm5lJKCdcAmPJzQXmbM/Url3rhlghrPvT3tt+7a/+oXc9azkKmLvoiXjtV83bEWqi+vs5nlPA== + jest-github-actions-reporter@1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/jest-github-actions-reporter/-/jest-github-actions-reporter-1.0.3.tgz#6aa2b3a6599352e1043bbe42628a7f73a1ce48c2" @@ -6076,17 +6103,17 @@ jest-leak-detector@^27.5.1: jest-get-type "^27.5.1" pretty-format "^27.5.1" -jest-matcher-utils@27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.0.6.tgz#2a8da1e86c620b39459f4352eaa255f0d43e39a9" - integrity sha512-OFgF2VCQx9vdPSYTHWJ9MzFCehs20TsyFi6bIHbk5V1u52zJOnvF0Y/65z3GLZHKRuTgVPY4Z6LVePNahaQ+tA== +jest-matcher-utils@28.1.0: + version "28.1.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-28.1.0.tgz#2ae398806668eeabd293c61712227cb94b250ccf" + integrity sha512-onnax0n2uTLRQFKAjC7TuaxibrPSvZgKTcSCnNUz/tOjJ9UhxNm7ZmPpoQavmTDUjXvUQ8KesWk2/VdrxIFzTQ== dependencies: chalk "^4.0.0" - jest-diff "^27.0.6" - jest-get-type "^27.0.6" - pretty-format "^27.0.6" + jest-diff "^28.1.0" + jest-get-type "^28.0.2" + pretty-format "^28.1.0" -jest-matcher-utils@^27.0.0, jest-matcher-utils@^27.0.6, jest-matcher-utils@^27.5.1: +jest-matcher-utils@^27.0.0, jest-matcher-utils@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.5.1.tgz#9c0cdbda8245bc22d2331729d1091308b40cf8ab" integrity sha512-z2uTx/T6LBaCoNWNFWwChLBKYxTMcGBRjAt+2SbP929/Fflb9aa5LGma654Rz8z9HLxsrUaYzxE9T/EFIL/PAw== @@ -6096,7 +6123,7 @@ jest-matcher-utils@^27.0.0, jest-matcher-utils@^27.0.6, jest-matcher-utils@^27.5 jest-get-type "^27.5.1" pretty-format "^27.5.1" -jest-message-util@^27.0.6, jest-message-util@^27.5.1: +jest-message-util@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.5.1.tgz#bdda72806da10d9ed6425e12afff38cd1458b6cf" integrity sha512-rMyFe1+jnyAAf+NHwTclDz0eAaLkVDdKVHHBFWsBWHnnh5YeJMNWWsv7AbFYXfK3oTqvL7VTWkhNLu1jX24D+g== @@ -6131,7 +6158,7 @@ jest-pnp-resolver@^1.2.2: resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c" integrity sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w== -jest-regex-util@^27.0.6, jest-regex-util@^27.5.1: +jest-regex-util@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.5.1.tgz#4da143f7e9fd1e542d4aa69617b38e4a78365b95" integrity sha512-4bfKq2zie+x16okqDXjXn9ql2B0dScQu+vcwe4TvFVhkVyuWLqpZrZtXxLLWoXYgn0E87I6r6GRYHF7wFZBUvg== @@ -8135,7 +8162,7 @@ pretty-bytes@^5.1.0: resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb" integrity sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg== -pretty-format@^27.0.0, pretty-format@^27.0.6, pretty-format@^27.5.1: +pretty-format@^27.0.0, pretty-format@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.5.1.tgz#2181879fdea51a7a5851fb39d920faa63f01d88e" integrity sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ== @@ -8144,6 +8171,16 @@ pretty-format@^27.0.0, pretty-format@^27.0.6, pretty-format@^27.5.1: ansi-styles "^5.0.0" react-is "^17.0.1" +pretty-format@^28.1.0, pretty-format@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-28.1.1.tgz#f731530394e0f7fcd95aba6b43c50e02d86b95cb" + integrity sha512-wwJbVTGFHeucr5Jw2bQ9P+VYHyLdAqedFLEkdQUVaBF/eiidDwH5OpilINq4mEfhbCjLnirt6HTTDhv1HaTIQw== + dependencies: + "@jest/schemas" "^28.0.2" + ansi-regex "^5.0.1" + ansi-styles "^5.0.0" + react-is "^18.0.0" + pretty-quick@3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/pretty-quick/-/pretty-quick-3.1.3.tgz#15281108c0ddf446675157ca40240099157b638e" @@ -8325,6 +8362,11 @@ react-is@^17.0.1: resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== +react-is@^18.0.0: + version "18.1.0" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.1.0.tgz#61aaed3096d30eacf2a2127118b5b41387d32a67" + integrity sha512-Fl7FuabXsJnV5Q1qIOQwx/sagGF18kogb4gpfcG4gjLBWO0WDiiz1ko/ExayuxE7InyQkBLkxRFG5oxY6Uu3Kg== + read-cmd-shim@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-3.0.0.tgz#62b8c638225c61e6cc607f8f4b779f3b8238f155" From fb261767b1faed42987ad117d53315c7b101efea Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 11 Jun 2022 23:27:00 +0000 Subject: [PATCH 084/240] chore(deps): update dependency eslint-plugin-jest to v26.4.7 (#16021) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 1469ddd0340a24..95fb1e265ad74d 100644 --- a/package.json +++ b/package.json @@ -270,7 +270,7 @@ "eslint-formatter-gha": "1.4.1", "eslint-import-resolver-typescript": "2.7.1", "eslint-plugin-import": "2.26.0", - "eslint-plugin-jest": "26.4.6", + "eslint-plugin-jest": "26.4.7", "eslint-plugin-jest-formatting": "3.1.0", "eslint-plugin-promise": "6.0.0", "eslint-plugin-typescript-enum": "2.1.0", diff --git a/yarn.lock b/yarn.lock index 6f04b8737bc8a4..3ce7e03947922d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4516,10 +4516,10 @@ eslint-plugin-jest-formatting@3.1.0: resolved "https://registry.yarnpkg.com/eslint-plugin-jest-formatting/-/eslint-plugin-jest-formatting-3.1.0.tgz#b26dd5a40f432b642dcc880021a771bb1c93dcd2" integrity sha512-XyysraZ1JSgGbLSDxjj5HzKKh0glgWf+7CkqxbTqb7zEhW7X2WHo5SBQ8cGhnszKN+2Lj3/oevBlHNbHezoc/A== -eslint-plugin-jest@26.4.6: - version "26.4.6" - resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-26.4.6.tgz#9d8184c1ecf077722a20cc236c7e14f4e263606f" - integrity sha512-R3mq1IepnhtsukHQsWxdyKra3OVwYB+N4k8i45ndqSfr8p9KZV6G+EIUt1Z7hzAh4KlsbXG+nCTlNeGFLFLNvA== +eslint-plugin-jest@26.4.7: + version "26.4.7" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-26.4.7.tgz#3defa590ff3e4d218d1014c21909a7f73a63d3a3" + integrity sha512-xLB5tefaNhHoxrOKrNPg/PiTxY+zeitoj7sOkeNOznx1mRysN8O7O7+9sN/sRUol5cMh7QYbCTWXbXE/K3/M4w== dependencies: "@typescript-eslint/utils" "^5.10.0" From fc19b257aec776a0aa77a9eddaae423bea009ed4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 11 Jun 2022 23:39:18 +0000 Subject: [PATCH 085/240] chore(deps): update dependency eslint-plugin-jest to v26.5.0 (#16022) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 95fb1e265ad74d..50576338e9f8f7 100644 --- a/package.json +++ b/package.json @@ -270,7 +270,7 @@ "eslint-formatter-gha": "1.4.1", "eslint-import-resolver-typescript": "2.7.1", "eslint-plugin-import": "2.26.0", - "eslint-plugin-jest": "26.4.7", + "eslint-plugin-jest": "26.5.0", "eslint-plugin-jest-formatting": "3.1.0", "eslint-plugin-promise": "6.0.0", "eslint-plugin-typescript-enum": "2.1.0", diff --git a/yarn.lock b/yarn.lock index 3ce7e03947922d..91d35a8f26ff15 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4516,10 +4516,10 @@ eslint-plugin-jest-formatting@3.1.0: resolved "https://registry.yarnpkg.com/eslint-plugin-jest-formatting/-/eslint-plugin-jest-formatting-3.1.0.tgz#b26dd5a40f432b642dcc880021a771bb1c93dcd2" integrity sha512-XyysraZ1JSgGbLSDxjj5HzKKh0glgWf+7CkqxbTqb7zEhW7X2WHo5SBQ8cGhnszKN+2Lj3/oevBlHNbHezoc/A== -eslint-plugin-jest@26.4.7: - version "26.4.7" - resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-26.4.7.tgz#3defa590ff3e4d218d1014c21909a7f73a63d3a3" - integrity sha512-xLB5tefaNhHoxrOKrNPg/PiTxY+zeitoj7sOkeNOznx1mRysN8O7O7+9sN/sRUol5cMh7QYbCTWXbXE/K3/M4w== +eslint-plugin-jest@26.5.0: + version "26.5.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-26.5.0.tgz#d32dbe8141effccfbc9ae964a10e66e4e50a563f" + integrity sha512-myQMd4piRn7otD1d1fAC7FRZO+WiDCiksejuyeHZ2b3LO7o5bE0Q7u0cuq7/kzBBVqFs+uFSAIBQAAuBbOpKsg== dependencies: "@typescript-eslint/utils" "^5.10.0" From 17596c91dcfcd7d7afb5bf093260f33fa0ba322a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 12 Jun 2022 02:43:59 +0000 Subject: [PATCH 086/240] chore(deps): update dependency eslint-plugin-jest to v26.5.1 (#16023) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 50576338e9f8f7..f1a7eaa97055b1 100644 --- a/package.json +++ b/package.json @@ -270,7 +270,7 @@ "eslint-formatter-gha": "1.4.1", "eslint-import-resolver-typescript": "2.7.1", "eslint-plugin-import": "2.26.0", - "eslint-plugin-jest": "26.5.0", + "eslint-plugin-jest": "26.5.1", "eslint-plugin-jest-formatting": "3.1.0", "eslint-plugin-promise": "6.0.0", "eslint-plugin-typescript-enum": "2.1.0", diff --git a/yarn.lock b/yarn.lock index 91d35a8f26ff15..3feb8d4e5ad7aa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4516,10 +4516,10 @@ eslint-plugin-jest-formatting@3.1.0: resolved "https://registry.yarnpkg.com/eslint-plugin-jest-formatting/-/eslint-plugin-jest-formatting-3.1.0.tgz#b26dd5a40f432b642dcc880021a771bb1c93dcd2" integrity sha512-XyysraZ1JSgGbLSDxjj5HzKKh0glgWf+7CkqxbTqb7zEhW7X2WHo5SBQ8cGhnszKN+2Lj3/oevBlHNbHezoc/A== -eslint-plugin-jest@26.5.0: - version "26.5.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-26.5.0.tgz#d32dbe8141effccfbc9ae964a10e66e4e50a563f" - integrity sha512-myQMd4piRn7otD1d1fAC7FRZO+WiDCiksejuyeHZ2b3LO7o5bE0Q7u0cuq7/kzBBVqFs+uFSAIBQAAuBbOpKsg== +eslint-plugin-jest@26.5.1: + version "26.5.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-26.5.1.tgz#a6b4cbd6884c1b5dcbe6afc0f43dde9afba29229" + integrity sha512-IUEw6DCJ7qPGffK2pc6ly3L+1HBXdT673pY5nson8Mu4Vwgc/8d4Hf8NhsZwkuspPdi/QMj83ugXND7OLTu6Bg== dependencies: "@typescript-eslint/utils" "^5.10.0" From 0c66358e8c2b0b1ec36a3bceea66dbcbfda0f39a Mon Sep 17 00:00:00 2001 From: Dan Ports Date: Sun, 12 Jun 2022 01:18:25 -0400 Subject: [PATCH 087/240] docs(flux): OCI HelmRepository sources are currently unsupported (#16024) --- lib/modules/manager/flux/readme.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/modules/manager/flux/readme.md b/lib/modules/manager/flux/readme.md index 58b39708399be2..7223c9b6e3a395 100644 --- a/lib/modules/manager/flux/readme.md +++ b/lib/modules/manager/flux/readme.md @@ -4,9 +4,12 @@ This manager parses [Flux](https://fluxcd.io/) YAML manifests and: 2. Extracts `github-releases` dependencies from system manifests (`flux-system/gotk-components.yaml` files) and regenerates them when new versions of Flux are available The `flux` manager will only extract `helm` dependencies for `HelmRelease` resources linked to `HelmRepository` sources. -`HelmRelease` resources linked to other kinds of sources like `GitRepository` or `Bucket` will be ignored. +The following configurations are currently unsupported: -For the `flux` manager to properly link `HelmRelease` and `HelmRepository` resources, _both_ of the following conditions must be met: +- OCI `HelmRepository` sources (those with `type: oci`) +- `HelmRelease` resources linked to other kinds of sources like `GitRepository` or `Bucket` + +In addition, for the `flux` manager to properly link `HelmRelease` and `HelmRepository` resources, _both_ of the following conditions must be met: 1. The `HelmRelease` resource must either have its `metadata.namespace` property set or its `spec.chart.spec.sourceRef.namespace` property set 2. The referenced `HelmRepository` resource must have its `metadata.namespace` property set From b676afcfe43dc7ebd7dad80c8dc3a772f7f04638 Mon Sep 17 00:00:00 2001 From: Gabriel-Ladzaretti <97394622+Gabriel-Ladzaretti@users.noreply.github.com> Date: Mon, 13 Jun 2022 02:45:35 +0300 Subject: [PATCH 088/240] fix(prune): skip modified orphan branches (#16026) Co-authored-by: Rhys Arkins --- lib/workers/repository/finalise/prune.spec.ts | 13 +++++++++++++ lib/workers/repository/finalise/prune.ts | 2 ++ 2 files changed, 15 insertions(+) diff --git a/lib/workers/repository/finalise/prune.spec.ts b/lib/workers/repository/finalise/prune.spec.ts index a0c69c45b87cf3..e9330b05a8332c 100644 --- a/lib/workers/repository/finalise/prune.spec.ts +++ b/lib/workers/repository/finalise/prune.spec.ts @@ -155,5 +155,18 @@ describe('workers/repository/finalise/prune', () => { expect(git.deleteBranch).toHaveBeenCalledTimes(1); expect(platform.updatePr).toHaveBeenCalledTimes(0); }); + + it('does not delete modified orphan branch', async () => { + config.branchList = ['renovate/a', 'renovate/b']; + git.getBranchList.mockReturnValueOnce( + config.branchList.concat(['renovate/c']) + ); + git.isBranchModified.mockResolvedValueOnce(true); + platform.findPr.mockResolvedValueOnce(null as never); + await cleanup.pruneStaleBranches(config, config.branchList); + expect(git.getBranchList).toHaveBeenCalledTimes(1); + expect(git.deleteBranch).toHaveBeenCalledTimes(0); + expect(platform.updatePr).toHaveBeenCalledTimes(0); + }); }); }); diff --git a/lib/workers/repository/finalise/prune.ts b/lib/workers/repository/finalise/prune.ts index a5dc6dab607cc9..dde02f6f5ca234 100644 --- a/lib/workers/repository/finalise/prune.ts +++ b/lib/workers/repository/finalise/prune.ts @@ -63,6 +63,8 @@ async function cleanUpBranches( }); await deleteBranch(branchName); } + } else if (branchIsModified) { + logger.debug('Orphan Branch is modified - skipping branch deletion'); } else if (GlobalConfig.get('dryRun')) { logger.info(`DRY-RUN: Would delete orphan branch ${branchName}`); } else { From 5651d1a40ed99b798da5feef999b4e00ac613c12 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 13 Jun 2022 00:42:25 +0000 Subject: [PATCH 089/240] docs: update references to renovate/renovate to v32.83.2 (#16031) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- docs/usage/docker.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/docker.md b/docs/usage/docker.md index 344e1f9168c018..3b0bc85c6dce52 100644 --- a/docs/usage/docker.md +++ b/docs/usage/docker.md @@ -268,7 +268,7 @@ To get access to the token a custom Renovate Docker image is needed that include The Dockerfile to create such an image can look like this: ```Dockerfile -FROM renovate/renovate:32.74.3 +FROM renovate/renovate:32.83.2 # Include the "Docker tip" which you can find here https://cloud.google.com/sdk/docs/install # under "Installation" for "Debian/Ubuntu" RUN ... From 612d3848a63fd8d87636285f578aec1466cd9fd7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 13 Jun 2022 00:55:25 +0000 Subject: [PATCH 090/240] chore(deps): lock file maintenance (#16032) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 222 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 134 insertions(+), 88 deletions(-) diff --git a/yarn.lock b/yarn.lock index 3feb8d4e5ad7aa..727b57133e00e8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2313,24 +2313,24 @@ integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== "@tsconfig/node10@^1.0.7": - version "1.0.8" - resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.8.tgz#c1e4e80d6f964fbecb3359c43bd48b40f7cadad9" - integrity sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg== + version "1.0.9" + resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2" + integrity sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA== "@tsconfig/node12@^1.0.7": - version "1.0.9" - resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.9.tgz#62c1f6dee2ebd9aead80dc3afa56810e58e1a04c" - integrity sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw== + version "1.0.10" + resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.10.tgz#10fecee4a3be17357ce99b370bd81874044d8dbd" + integrity sha512-N+srakvPaYMGkwjNDx3ASx65Zl3QG8dJgVtIB+YMOkucU+zctlv/hdP5250VKdDHSDoW9PFZoCqbqNcAPjCjXA== "@tsconfig/node14@^1.0.0": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.1.tgz#95f2d167ffb9b8d2068b0b235302fafd4df711f2" - integrity sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg== + version "1.0.2" + resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.2.tgz#b09c08de2eb319ca2acab17a1b8028af110b24b3" + integrity sha512-YwrUA5ysDXHFYfL0Xed9x3sNS4P+aKlCOnnbqUa2E5HdQshHFleCJVrj1PlGTb4GgFUCDyte1v3JWLy2sz8Oqg== "@tsconfig/node16@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.2.tgz#423c77877d0569db20e1fc80885ac4118314010e" - integrity sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA== + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.3.tgz#472eaab5f15c1ffdd7f8628bd4c4f753995ec79e" + integrity sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ== "@types/auth-header@1.0.2": version "1.0.2" @@ -2613,9 +2613,9 @@ "@types/node" "*" "@types/node@*": - version "17.0.40" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.40.tgz#76ee88ae03650de8064a6cf75b8d95f9f4a16090" - integrity sha512-UXdBxNGqTMtm7hCwh9HtncFVLrXoqA3oJW30j6XWp5BH/wu3mVeaxo7cq5benFdBw34HB3XDT2TRPI7rXZ+mDg== + version "17.0.42" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.42.tgz#d7e8f22700efc94d125103075c074396b5f41f9b" + integrity sha512-Q5BPGyGKcvQgAMbsr7qEGN/kIPN6zZecYYABeTDBizOsau+2NMdSVTar9UQw21A2+JyA2KRNDYaYrPB0Rpk2oQ== "@types/node@16.11.38": version "16.11.38" @@ -2766,11 +2766,11 @@ tsutils "^3.21.0" "@typescript-eslint/experimental-utils@^5.3.0": - version "5.27.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.27.0.tgz#dfe4c6087f60be8950e32fa83f4a8f2fccd86e47" - integrity sha512-ZOn342bYh19IYvkiorrqnzNoRAr91h3GiFSSfa4tlHV+R9GgR8SxCwAi8PKMyT8+pfwMxfQdNbwKsMurbF9hzg== + version "5.27.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.27.1.tgz#c5c5121a75cf875bfae8083c50f5ae7bfde6145a" + integrity sha512-Vd8uewIixGP93sEnmTRIH6jHZYRQRkGPDPpapACMvitJKX8335VHNyqKTE+mZ+m3E2c5VznTZfSsSsS5IF7vUA== dependencies: - "@typescript-eslint/utils" "5.27.0" + "@typescript-eslint/utils" "5.27.1" "@typescript-eslint/parser@5.27.0": version "5.27.0" @@ -2790,6 +2790,14 @@ "@typescript-eslint/types" "5.27.0" "@typescript-eslint/visitor-keys" "5.27.0" +"@typescript-eslint/scope-manager@5.27.1": + version "5.27.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.27.1.tgz#4d1504392d01fe5f76f4a5825991ec78b7b7894d" + integrity sha512-fQEOSa/QroWE6fAEg+bJxtRZJTH8NTskggybogHt4H9Da8zd4cJji76gA5SBlR0MgtwF7rebxTbDKB49YUCpAg== + dependencies: + "@typescript-eslint/types" "5.27.1" + "@typescript-eslint/visitor-keys" "5.27.1" + "@typescript-eslint/type-utils@5.27.0": version "5.27.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.27.0.tgz#36fd95f6747412251d79c795b586ba766cf0974b" @@ -2804,6 +2812,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.27.0.tgz#c3f44b9dda6177a9554f94a74745ca495ba9c001" integrity sha512-lY6C7oGm9a/GWhmUDOs3xAVRz4ty/XKlQ2fOLr8GAIryGn0+UBOoJDWyHer3UgrHkenorwvBnphhP+zPmzmw0A== +"@typescript-eslint/types@5.27.1": + version "5.27.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.27.1.tgz#34e3e629501349d38be6ae97841298c03a6ffbf1" + integrity sha512-LgogNVkBhCTZU/m8XgEYIWICD6m4dmEDbKXESCbqOXfKZxRKeqpiJXQIErv66sdopRKZPo5l32ymNqibYEH/xg== + "@typescript-eslint/typescript-estree@5.27.0": version "5.27.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.27.0.tgz#7965f5b553c634c5354a47dcce0b40b94611e995" @@ -2817,7 +2830,20 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.27.0", "@typescript-eslint/utils@^5.10.0": +"@typescript-eslint/typescript-estree@5.27.1": + version "5.27.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.27.1.tgz#7621ee78607331821c16fffc21fc7a452d7bc808" + integrity sha512-DnZvvq3TAJ5ke+hk0LklvxwYsnXpRdqUY5gaVS0D4raKtbznPz71UJGnPTHEFo0GDxqLOLdMkkmVZjSpET1hFw== + dependencies: + "@typescript-eslint/types" "5.27.1" + "@typescript-eslint/visitor-keys" "5.27.1" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + semver "^7.3.7" + tsutils "^3.21.0" + +"@typescript-eslint/utils@5.27.0": version "5.27.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.27.0.tgz#d0021cbf686467a6a9499bd0589e19665f9f7e71" integrity sha512-nZvCrkIJppym7cIbP3pOwIkAefXOmfGPnCM0LQfzNaKxJHI6VjI8NC662uoiPlaf5f6ymkTy9C3NQXev2mdXmA== @@ -2829,6 +2855,18 @@ eslint-scope "^5.1.1" eslint-utils "^3.0.0" +"@typescript-eslint/utils@5.27.1", "@typescript-eslint/utils@^5.10.0": + version "5.27.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.27.1.tgz#b4678b68a94bc3b85bf08f243812a6868ac5128f" + integrity sha512-mZ9WEn1ZLDaVrhRaYgzbkXBkTPghPFsup8zDbbsYTxC5OmqrFE7skkKS/sraVsLP3TcT3Ki5CSyEFBRkLH/H/w== + dependencies: + "@types/json-schema" "^7.0.9" + "@typescript-eslint/scope-manager" "5.27.1" + "@typescript-eslint/types" "5.27.1" + "@typescript-eslint/typescript-estree" "5.27.1" + eslint-scope "^5.1.1" + eslint-utils "^3.0.0" + "@typescript-eslint/visitor-keys@5.27.0": version "5.27.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.27.0.tgz#97aa9a5d2f3df8215e6d3b77f9d214a24db269bd" @@ -2837,6 +2875,14 @@ "@typescript-eslint/types" "5.27.0" eslint-visitor-keys "^3.3.0" +"@typescript-eslint/visitor-keys@5.27.1": + version "5.27.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.27.1.tgz#05a62666f2a89769dac2e6baa48f74e8472983af" + integrity sha512-xYs6ffo01nhdJgPieyk7HAOpjhTsx7r/oB9LWEhwAXgwn33tkr+W8DI2ChboqhZlC4q3TC6geDYPoiX8ROqyOQ== + dependencies: + "@typescript-eslint/types" "5.27.1" + eslint-visitor-keys "^3.3.0" + "@yarnpkg/core@3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@yarnpkg/core/-/core-3.1.0.tgz#6bfc9b906df0d128e4627efe9c2d830c30610d48" @@ -3366,14 +3412,14 @@ browser-process-hrtime@^1.0.0: integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== browserslist@^4.20.2: - version "4.20.3" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.20.3.tgz#eb7572f49ec430e054f56d52ff0ebe9be915f8bf" - integrity sha512-NBhymBQl1zM0Y5dQT/O+xiLP9/rzOIQdKM/eMJBAq7yBgaB6krIYLGejrwVYnSHZdqjscB1SPuAjHwxjvN6Wdg== + version "4.20.4" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.20.4.tgz#98096c9042af689ee1e0271333dbc564b8ce4477" + integrity sha512-ok1d+1WpnU24XYN7oC3QWgTyMhY/avPJ/r9T00xxvUOIparA/gc+UPUMaod3i+G6s+nI2nUb9xZ5k794uIwShw== dependencies: - caniuse-lite "^1.0.30001332" - electron-to-chromium "^1.4.118" + caniuse-lite "^1.0.30001349" + electron-to-chromium "^1.4.147" escalade "^3.1.1" - node-releases "^2.0.3" + node-releases "^2.0.5" picocolors "^1.0.0" bs-logger@0.x: @@ -3520,10 +3566,10 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001332: - version "1.0.30001346" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001346.tgz#e895551b46b9cc9cc9de852facd42f04839a8fbe" - integrity sha512-q6ibZUO2t88QCIPayP/euuDREq+aMAxFE5S70PkrLh0iTDj/zEhgvJRKC2+CvXY6EWc6oQwUR48lL5vCW6jiXQ== +caniuse-lite@^1.0.30001349: + version "1.0.30001352" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001352.tgz#cc6f5da3f983979ad1e2cdbae0505dccaa7c6a12" + integrity sha512-GUgH8w6YergqPQDGWhJGt8GDRnY0L/iJVQcU3eJ46GYf52R8tk0Wxp0PymuFVZboJYXGiCqwozAYZNRjVj6IcA== cardinal@^2.1.1: version "2.1.1" @@ -4253,10 +4299,10 @@ editorconfig@0.15.3: semver "^5.6.0" sigmund "^1.0.1" -electron-to-chromium@^1.4.118: - version "1.4.146" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.146.tgz#fd20970c3def2f9e6b32ac13a2e7a6b64e1b0c48" - integrity sha512-4eWebzDLd+hYLm4csbyMU2EbBnqhwl8Oe9eF/7CBDPWcRxFmqzx4izxvHH+lofQxzieg8UbB8ZuzNTxeukzfTg== +electron-to-chromium@^1.4.147: + version "1.4.152" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.152.tgz#7dedbe8f3dc1c597088982a203f392e60f7ee90a" + integrity sha512-jk4Ju5SGZAQQJ1iI4Rgru7dDlvkQPLpNPWH9gIZmwCD4YteA5Bbk1xPcPDUf5jUYs3e1e80RXdi8XgKQZaigeg== email-addresses@5.0.0: version "5.0.0" @@ -5004,13 +5050,13 @@ get-caller-file@^2.0.5: integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" - integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== + version "1.1.2" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.2.tgz#336975123e05ad0b7ba41f152ee4aadbea6cf598" + integrity sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA== dependencies: function-bind "^1.1.1" has "^1.0.3" - has-symbols "^1.0.1" + has-symbols "^1.0.3" get-package-type@^0.1.0: version "0.1.0" @@ -5507,9 +5553,9 @@ init-package-json@^3.0.2: validate-npm-package-name "^4.0.0" install-artifact-from-github@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/install-artifact-from-github/-/install-artifact-from-github-1.3.0.tgz#cab6ff821976b8a35b0c079da19a727c90381a40" - integrity sha512-iT8v1GwOAX0pPXifF/5ihnMhHOCo3OeK7z3TQa4CtSNCIg8k0UxqBEk9jRwz8OP68hHXvJ2gxRa89KYHtBkqGA== + version "1.3.1" + resolved "https://registry.yarnpkg.com/install-artifact-from-github/-/install-artifact-from-github-1.3.1.tgz#eefaad9af35d632e5d912ad1569c1de38c3c2462" + integrity sha512-3l3Bymg2eKDsN5wQuMfgGEj2x6l5MCAv0zPL6rxHESufFVlEAKW/6oY9F1aGgvY/EgWm5+eWGRjINveL4X7Hgg== internal-slot@^1.0.3: version "1.0.3" @@ -7465,7 +7511,7 @@ node-int64@^0.4.0: resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== -node-releases@^2.0.3: +node-releases@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.5.tgz#280ed5bc3eba0d96ce44897d8aee478bfb3d9666" integrity sha512-U9h1NLROZTq9uE1SNffn6WuPDg8icmi3ns4rEl/oTfIle4iLjTliCzgTsbaIFMq/Xn078/lfY/BL0GWZ+psK4Q== @@ -8019,9 +8065,9 @@ parse-link-header@2.0.0: xtend "~4.0.1" parse-path@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/parse-path/-/parse-path-4.0.3.tgz#82d81ec3e071dcc4ab49aa9f2c9c0b8966bb22bf" - integrity sha512-9Cepbp2asKnWTJ9x2kpw6Fe8y9JDbqwahGCTvklzd/cEq5C5JC59x2Xb0Kx+x0QZ8bvNquGO8/BWP0cwBHzSAA== + version "4.0.4" + resolved "https://registry.yarnpkg.com/parse-path/-/parse-path-4.0.4.tgz#4bf424e6b743fb080831f03b536af9fc43f0ffea" + integrity sha512-Z2lWUis7jlmXC1jeOG9giRO2+FsuyNipeQ43HAjqAZjwSe3SEf+q/84FGPHoso3kyntbxa4c4i77t3m6fGf8cw== dependencies: is-ssh "^1.3.0" protocols "^1.4.0" @@ -8307,9 +8353,9 @@ qrcode-terminal@^0.12.0: integrity sha512-EXtzRZmC+YGmGlDFbXKxQiMZNwCLEO6BANKXG4iCtSIM0yqc/pappSx3RIKr4r0uh5JsBckOXeKrB3Iz7mdQpQ== qs@^6.9.1, qs@^6.9.4: - version "6.10.3" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.3.tgz#d6cde1b2ffca87b5aa57889816c5f81535e22e8e" - integrity sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ== + version "6.10.5" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.5.tgz#974715920a80ff6a262264acd2c7e6c2a53282b4" + integrity sha512-O5RlPh0VFtR78y79rgcgKK4wbAI0C5zGVLztOIdpWX6ep368q5Hv6XRxDvXuZ9q3C6v+e3n8UfZZJw7IIG27eQ== dependencies: side-channel "^1.0.4" @@ -8402,7 +8448,7 @@ read-pkg-up@^7.0.0, read-pkg-up@^7.0.1: read-pkg@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" - integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= + integrity sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA== dependencies: load-json-file "^4.0.0" normalize-package-data "^2.3.2" @@ -8429,7 +8475,7 @@ read-yaml-file@^2.1.0: read@1, read@^1.0.7, read@~1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/read/-/read-1.0.7.tgz#b3da19bd052431a97671d44a42634adf710b40c4" - integrity sha1-s9oZvQUkMal2cdRKQmNK33ELQMQ= + integrity sha512-rSOKNYUmaxy0om1BNjMN4ezNT6VKK+2xF4GBhc81mkH7L60i6dp8qPYrkndNLT3QPphoII3maL9PVC9XmhHwVQ== dependencies: mute-stream "~0.0.4" @@ -8468,7 +8514,7 @@ readdir-scoped-modules@^1.1.0: rechoir@^0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" - integrity sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q= + integrity sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw== dependencies: resolve "^1.1.6" @@ -8483,7 +8529,7 @@ redent@^3.0.0: redeyed@~2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/redeyed/-/redeyed-2.1.1.tgz#8984b5815d99cb220469c99eeeffe38913e6cc0b" - integrity sha1-iYS1gV2ZyyIEacme7v/jiRPmzAs= + integrity sha512-FNpGGo1DycYAdnrKFxCMmKYgo/mILAqtRYbkdQD8Ep/Hk2PQ5+aEAEx+IU713RTDmuBaH0c8P5ZozurNu5ObRQ== dependencies: esprima "~4.0.0" @@ -8560,12 +8606,12 @@ remark@13.0.0: repeat-string@^1.0.0: version "1.6.1" resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= + integrity sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w== require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== resolve-alpn@^1.0.0: version "1.2.1" @@ -8613,7 +8659,7 @@ responselike@^2.0.0: retry@^0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" - integrity sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs= + integrity sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow== retry@^0.13.1: version "0.13.1" @@ -8635,7 +8681,7 @@ rimraf@3.0.2, rimraf@^3.0.0, rimraf@^3.0.2: rimraf@~2.4.0: version "2.4.5" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.4.5.tgz#ee710ce5d93a8fdb856fb5ea8ff0e2d75934b2da" - integrity sha1-7nEM5dk6j9uFb7Xqj/Di11k0sto= + integrity sha512-J5xnxTyqaiw06JjMftq7L9ouA448dw/E7dKghkP9WpKNuwmARNNg+Gk8/u5ryb9N/Yo2+z3MCwuqFK/+qPOPfQ== dependencies: glob "^6.0.1" @@ -8727,7 +8773,7 @@ semantic-release@19.0.3: semver-compare@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" - integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w= + integrity sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow== semver-diff@^3.1.1: version "3.1.1" @@ -8780,12 +8826,12 @@ serialize-error@^7.0.1: set-blocking@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= + integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" - integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= + integrity sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg== dependencies: shebang-regex "^1.0.0" @@ -8799,7 +8845,7 @@ shebang-command@^2.0.0: shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" - integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= + integrity sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ== shebang-regex@^3.0.0: version "3.0.0" @@ -8837,7 +8883,7 @@ side-channel@^1.0.4: sigmund@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/sigmund/-/sigmund-1.0.1.tgz#3ff21f198cad2175f9f3b781853fd94d0d19b590" - integrity sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA= + integrity sha512-fCvEXfh6NWpm+YSuY2bpXb/VIihqWA6hLsgboC+0nl71Q7N7o2eaCW8mJa/NLvQhs6jpd3VZV4UiUQlV6+lc8g== signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7: version "3.0.7" @@ -8953,7 +8999,7 @@ source-map@^0.7.3: spawn-error-forwarder@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/spawn-error-forwarder/-/spawn-error-forwarder-1.0.0.tgz#1afd94738e999b0346d7b9fc373be55e07577029" - integrity sha1-Gv2Uc46ZmwNG17n8NzvlXgdXcCk= + integrity sha512-gRjMgK5uFjbCvdibeGJuy3I5OYz6VLoVdsOJdA6wV0WlfQVLFueoqMxwwYD9RODdgb6oUIvlRlsyFSiQkMKu0g== spdx-correct@^3.0.0: version "3.1.1" @@ -8996,7 +9042,7 @@ split2@^3.0.0: split2@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/split2/-/split2-1.0.0.tgz#52e2e221d88c75f9a73f90556e263ff96772b314" - integrity sha1-UuLiIdiMdfmnP5BVbiY/+WdysxQ= + integrity sha512-NKywug4u4pX/AZBB1FCPzZ6/7O+Xhz1qMVbzTvvKvikjO99oPN87SkK08mEY9P63/5lWjK+wgOOgApnTg5r6qg== dependencies: through2 "~2.0.0" @@ -9015,7 +9061,7 @@ sprintf-js@^1.1.2: sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= + integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== ssri@^8.0.0, ssri@^8.0.1: version "8.0.1" @@ -9046,7 +9092,7 @@ stream-buffers@^3.0.2: stream-combiner2@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/stream-combiner2/-/stream-combiner2-1.1.1.tgz#fb4d8a1420ea362764e21ad4780397bebcb41cbe" - integrity sha1-+02KFCDqNidk4hrUeAOXvry0HL4= + integrity sha512-3PnJbYgS56AeWgtKF5jtJRT6uFJe56Z0Hc5Ngg/6sI6rIt8iiMBTa9cvdyFfpMQjaVHr8dusbNeFGIIonxOvKw== dependencies: duplexer2 "~0.1.0" readable-stream "^2.0.2" @@ -9054,14 +9100,14 @@ stream-combiner2@~1.1.1: stream-to-array@~2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/stream-to-array/-/stream-to-array-2.3.0.tgz#bbf6b39f5f43ec30bc71babcb37557acecf34353" - integrity sha1-u/azn19D7DC8cbq8s3VXrOzzQ1M= + integrity sha512-UsZtOYEn4tWU2RGLOXr/o/xjRBftZRlG3dEWoaHr8j4GuypJ3isitGbVyjQKAuMu+xbiop8q224TjiZWc4XTZA== dependencies: any-promise "^1.1.0" stream-to-promise@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/stream-to-promise/-/stream-to-promise-2.2.0.tgz#b1edb2e1c8cb11289d1b503c08d3f2aef51e650f" - integrity sha1-se2y4cjLESidG1A8CNPyrvUeZQ8= + integrity sha512-HAGUASw8NT0k8JvIVutB2Y/9iBk7gpgEyAudXwNJmZERdMITGdajOa4VJfD/kNiA3TppQpTP4J+CtcHwdzKBAw== dependencies: any-promise "~1.3.0" end-of-stream "~1.1.0" @@ -9070,7 +9116,7 @@ stream-to-promise@^2.2.0: strict-uri-encode@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" - integrity sha1-ucczDHBChi9rFC3CdLvMWGbONUY= + integrity sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ== string-length@^4.0.1: version "4.0.2" @@ -9140,7 +9186,7 @@ strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1: strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= + integrity sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA== strip-bom@^4.0.0: version "4.0.0" @@ -9172,7 +9218,7 @@ strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= + integrity sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ== supports-color@^5.3.0: version "5.5.0" @@ -9266,7 +9312,7 @@ text-extensions@^1.0.0: text-table@^0.2.0, text-table@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" - integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= + integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== throat@^6.0.1: version "6.0.1" @@ -9298,7 +9344,7 @@ through2@^4.0.0: through@2, "through@>=2.2.7 <3": version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= + integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== tiny-relative-date@^1.3.0: version "1.3.0" @@ -9334,7 +9380,7 @@ tmpl@1.0.5: to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" - integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= + integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== to-regex-range@^5.0.1: version "5.0.1" @@ -9362,12 +9408,12 @@ tr46@^2.1.0: tr46@~0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= + integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== traverse@0.6.6, traverse@~0.6.6: version "0.6.6" resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.6.6.tgz#cbdf560fd7b9af632502fed40f918c157ea97137" - integrity sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc= + integrity sha512-kdf4JKs8lbARxWdp7RKdNzoJBhGUcIalSYibuGyHJbmk40pOysQ0+QPvlkCOICOivDWU2IJo2rkrxyTK2AH4fw== treeify@^1.1.0: version "1.1.0" @@ -9474,7 +9520,7 @@ type-check@^0.4.0, type-check@~0.4.0: type-check@~0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= + integrity sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg== dependencies: prelude-ls "~1.1.2" @@ -9555,9 +9601,9 @@ uc.micro@^1.0.1, uc.micro@^1.0.5: integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA== uglify-js@^3.1.4: - version "3.15.5" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.15.5.tgz#2b10f9e0bfb3f5c15a8e8404393b6361eaeb33b3" - integrity sha512-hNM5q5GbBRB5xB+PMqVRcgYe4c8jbyZ1pzZhS6jbq54/4F2gFK869ZheiE5A8/t+W5jtTNpWef/5Q9zk639FNQ== + version "3.16.0" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.16.0.tgz#b778ba0831ca102c1d8ecbdec2d2bdfcc7353190" + integrity sha512-FEikl6bR30n0T3amyBh3LoiBdqHRy/f4H80+My34HOesOKyHfOsxAPAxOoqC0JUnC1amnO0IwkYC3sko51caSw== unbox-primitive@^1.0.2: version "1.0.2" @@ -9671,7 +9717,7 @@ url-join@4.0.1, url-join@^4.0.0: util-deprecate@^1.0.1, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== util@^0.12.4: version "0.12.4" @@ -9771,7 +9817,7 @@ walker@^1.0.7: wcwidth@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" - integrity sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g= + integrity sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg== dependencies: defaults "^1.0.3" @@ -9783,7 +9829,7 @@ web-streams-polyfill@~3.0.3: webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= + integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== webidl-conversions@^5.0.0: version "5.0.0" @@ -9810,7 +9856,7 @@ whatwg-mimetype@^2.3.0: whatwg-url@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= + integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== dependencies: tr46 "~0.0.3" webidl-conversions "^3.0.0" @@ -9876,7 +9922,7 @@ word-wrap@^1.2.3, word-wrap@~1.2.3: wordwrap@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= + integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== wrap-ansi@^7.0.0: version "7.0.0" @@ -9890,7 +9936,7 @@ wrap-ansi@^7.0.0: wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== write-file-atomic@^3.0.0, write-file-atomic@^3.0.3: version "3.0.3" @@ -9931,7 +9977,7 @@ xml-name-validator@^3.0.0: xml@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5" - integrity sha1-eLpyAgApxbyHuKgaPPzXS0ovweU= + integrity sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw== xmlchars@^2.2.0: version "2.2.0" @@ -9963,7 +10009,7 @@ yallist@4.0.0, yallist@^4.0.0: yallist@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" - integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= + integrity sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A== yaml@1.10.2, yaml@^1.10.0: version "1.10.2" @@ -9999,7 +10045,7 @@ yargs@^16.2.0: yauzl@^2.10.0: version "2.10.0" resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9" - integrity sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk= + integrity sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g== dependencies: buffer-crc32 "~0.2.3" fd-slicer "~1.1.0" From e8d31909740411c31d1f7e38a243469a16d1a7e1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 13 Jun 2022 04:25:14 +0000 Subject: [PATCH 091/240] chore(deps): update dependency eslint-plugin-jest to v26.5.3 (#16033) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index f1a7eaa97055b1..f9a38eaf88b97b 100644 --- a/package.json +++ b/package.json @@ -270,7 +270,7 @@ "eslint-formatter-gha": "1.4.1", "eslint-import-resolver-typescript": "2.7.1", "eslint-plugin-import": "2.26.0", - "eslint-plugin-jest": "26.5.1", + "eslint-plugin-jest": "26.5.3", "eslint-plugin-jest-formatting": "3.1.0", "eslint-plugin-promise": "6.0.0", "eslint-plugin-typescript-enum": "2.1.0", diff --git a/yarn.lock b/yarn.lock index 727b57133e00e8..ae2dd21f90e239 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4562,10 +4562,10 @@ eslint-plugin-jest-formatting@3.1.0: resolved "https://registry.yarnpkg.com/eslint-plugin-jest-formatting/-/eslint-plugin-jest-formatting-3.1.0.tgz#b26dd5a40f432b642dcc880021a771bb1c93dcd2" integrity sha512-XyysraZ1JSgGbLSDxjj5HzKKh0glgWf+7CkqxbTqb7zEhW7X2WHo5SBQ8cGhnszKN+2Lj3/oevBlHNbHezoc/A== -eslint-plugin-jest@26.5.1: - version "26.5.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-26.5.1.tgz#a6b4cbd6884c1b5dcbe6afc0f43dde9afba29229" - integrity sha512-IUEw6DCJ7qPGffK2pc6ly3L+1HBXdT673pY5nson8Mu4Vwgc/8d4Hf8NhsZwkuspPdi/QMj83ugXND7OLTu6Bg== +eslint-plugin-jest@26.5.3: + version "26.5.3" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-26.5.3.tgz#a3ceeaf4a757878342b8b00eca92379b246e5505" + integrity sha512-sICclUqJQnR1bFRZGLN2jnSVsYOsmPYYnroGCIMVSvTS3y8XR3yjzy1EcTQmk6typ5pRgyIWzbjqxK6cZHEZuQ== dependencies: "@typescript-eslint/utils" "^5.10.0" From 8d9e3be6f3b73f856a87eee31d4aff8c196ced23 Mon Sep 17 00:00:00 2001 From: Johannes Feichtner Date: Mon, 13 Jun 2022 07:12:02 +0200 Subject: [PATCH 092/240] feat(gradle): add support for library(...).version() (#15929) --- lib/modules/manager/gradle/parser.spec.ts | 1 + lib/modules/manager/gradle/parser.ts | 15 +++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/modules/manager/gradle/parser.spec.ts b/lib/modules/manager/gradle/parser.spec.ts index 4d1ae35d48df80..156b5f8de93ac9 100644 --- a/lib/modules/manager/gradle/parser.spec.ts +++ b/lib/modules/manager/gradle/parser.spec.ts @@ -73,6 +73,7 @@ describe('modules/manager/gradle/parser', () => { ${'baz = "1.2.3"'} | ${'foobar = "foo:bar:$baz"'} | ${{ depName: 'foo:bar', currentValue: '1.2.3', groupName: 'baz' }} ${'baz = "1.2.3"'} | ${'group: "foo", name: "bar", version: baz'} | ${{ depName: 'foo:bar', currentValue: '1.2.3', groupName: 'baz' }} ${'baz = "1.2.3"'} | ${'library("foo.bar", "foo", "bar").versionRef("baz")'} | ${{ depName: 'foo:bar', currentValue: '1.2.3', groupName: 'baz' }} + ${''} | ${'library("foo.bar", "foo", "bar").version("1.2.3")'} | ${{ depName: 'foo:bar', currentValue: '1.2.3' }} ${'library("foo.bar", "foo", "bar")'} | ${'"${foo.bar}:1.2.3"'} | ${{ depName: 'foo:bar', currentValue: '1.2.3' }} `('$def | $str', ({ def, str, output }) => { const input = [def, str].join('\n'); diff --git a/lib/modules/manager/gradle/parser.ts b/lib/modules/manager/gradle/parser.ts index 3c266264f9151a..dd4203223aa96b 100644 --- a/lib/modules/manager/gradle/parser.ts +++ b/lib/modules/manager/gradle/parser.ts @@ -373,9 +373,11 @@ function processLibraryDep(input: SyntaxHandlerInput): SyntaxHandlerOutput { if (groupId && artifactId) { res.vars = { [key]: { key, value, fileReplacePosition, packageFile } }; - const versionRefToken = tokenMap.version; - if (versionRefToken) { - const version: Token = { ...versionRefToken, type: TokenType.Word }; + const version = tokenMap.version; + if (version) { + if (tokenMap.versionType?.value === 'versionRef') { + version.type = TokenType.Word; + } const depRes = processLongFormDep({ ...input, tokenMap: { ...input.tokenMap, version }, @@ -653,6 +655,7 @@ const matcherConfigs: SyntaxMatchConfig[] = [ }, { // library("foobar", "foo", "bar").versionRef("foo.bar") + // library("foobar", "foo", "bar").version("1.2.3") matchers: [ { matchType: TokenType.Word, matchValue: 'library' }, { matchType: TokenType.LeftParen }, @@ -663,7 +666,11 @@ const matcherConfigs: SyntaxMatchConfig[] = [ { matchType: potentialStringTypes, tokenMapKey: 'artifactId' }, { matchType: TokenType.RightParen }, { matchType: TokenType.Dot }, - { matchType: TokenType.Word, matchValue: 'versionRef' }, + { + matchType: TokenType.Word, + matchValue: ['versionRef', 'version'], + tokenMapKey: 'versionType', + }, { matchType: TokenType.LeftParen }, { matchType: TokenType.String, tokenMapKey: 'version' }, { matchType: TokenType.RightParen }, From a5e4b9e29b11012b8b42f2cefd943df62197d36f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 13 Jun 2022 12:14:50 +0200 Subject: [PATCH 093/240] chore(deps): update dependency conventional-changelog-conventionalcommits to v5 (#16045) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index f9a38eaf88b97b..cb000983e73f84 100644 --- a/package.json +++ b/package.json @@ -261,7 +261,7 @@ "@typescript-eslint/parser": "5.27.0", "aws-sdk-client-mock": "0.6.2", "callsite": "1.0.0", - "conventional-changelog-conventionalcommits": "4.6.3", + "conventional-changelog-conventionalcommits": "5.0.0", "cross-env": "7.0.3", "diff": "5.1.0", "emojibase-data": "7.0.1", diff --git a/yarn.lock b/yarn.lock index ae2dd21f90e239..0af713bb894173 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3847,10 +3847,10 @@ conventional-changelog-angular@^5.0.0: compare-func "^2.0.0" q "^1.5.1" -conventional-changelog-conventionalcommits@4.6.3: - version "4.6.3" - resolved "https://registry.yarnpkg.com/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.6.3.tgz#0765490f56424b46f6cb4db9135902d6e5a36dc2" - integrity sha512-LTTQV4fwOM4oLPad317V/QNQ1FY4Hju5qeBIM1uTHbrnCE+Eg4CdRZ3gO2pUeR+tzWdp80M2j3qFFEDWVqOV4g== +conventional-changelog-conventionalcommits@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-5.0.0.tgz#41bdce54eb65a848a4a3ffdca93e92fa22b64a86" + integrity sha512-lCDbA+ZqVFQGUj7h9QBKoIpLhl8iihkO0nCTyRNzuXtcd7ubODpYB04IFy31JloiJgG0Uovu8ot8oxRzn7Nwtw== dependencies: compare-func "^2.0.0" lodash "^4.17.15" From ed639b47acd35d296147edfeaab0e01416b806cd Mon Sep 17 00:00:00 2001 From: Maksim Date: Mon, 13 Jun 2022 12:28:41 +0200 Subject: [PATCH 094/240] fix: commit message (#13197) * fix: introduce class SemanticCommitMessage * fix: introduce class AbstractCommitMessage * fix: use commit message model * fix: clean extra whitespaces * fix: test coverage * fix: fix build * fix: unit test * fix: by comments * fix: cover case without prefix by unit tests * fix: coverage * fix: regexp * fix: revert options changes * fix: update commit message model * fix: add unit test * fix: add new getter to commit message model * fix: add unit test * fix: update by comments Co-authored-by: Rhys Arkins Co-authored-by: Michael Kriese --- .../repository/model/commit-message.ts | 4 ++ .../model/semantic-commit-message.spec.ts | 9 ++++ .../repository/updates/generate.spec.ts | 14 +++++- lib/workers/repository/updates/generate.ts | 50 +++++++------------ 4 files changed, 45 insertions(+), 32 deletions(-) diff --git a/lib/workers/repository/model/commit-message.ts b/lib/workers/repository/model/commit-message.ts index 0344e5b6471fc0..b909f5bc1d837d 100644 --- a/lib/workers/repository/model/commit-message.ts +++ b/lib/workers/repository/model/commit-message.ts @@ -60,6 +60,10 @@ export abstract class CommitMessage { this._footer = this.normalizeInput(value); } + get subject(): string { + return this._subject; + } + set subject(value: string) { this._subject = this.normalizeInput(value); this._subject = this._subject?.replace( diff --git a/lib/workers/repository/model/semantic-commit-message.spec.ts b/lib/workers/repository/model/semantic-commit-message.spec.ts index db76829ba5b957..57e74b1bfc56e8 100644 --- a/lib/workers/repository/model/semantic-commit-message.spec.ts +++ b/lib/workers/repository/model/semantic-commit-message.spec.ts @@ -25,6 +25,15 @@ describe('workers/repository/model/semantic-commit-message', () => { expect(message.toString()).toBe('fix(scope): test'); }); + it('should transform to lowercase only first letter', () => { + const message = new SemanticCommitMessage(); + message.subject = 'Update My Org dependencies'; + message.type = 'fix'; + message.scope = 'deps '; + + expect(message.toString()).toBe('fix(deps): update My Org dependencies'); + }); + it('should create instance from string without scope', () => { const instance = SemanticCommitMessage.fromString('feat: ticket 123'); diff --git a/lib/workers/repository/updates/generate.spec.ts b/lib/workers/repository/updates/generate.spec.ts index 25ded125464fbf..a27b4015a589e6 100644 --- a/lib/workers/repository/updates/generate.spec.ts +++ b/lib/workers/repository/updates/generate.spec.ts @@ -504,7 +504,7 @@ describe('workers/repository/updates/generate', () => { }), ]; const res = generateBranchConfig(branch); - expect(res.prTitle).toBe('chore(): update dependency some-dep to v1.2.0'); + expect(res.prTitle).toBe('chore: update dependency some-dep to v1.2.0'); }); it('scopes monorepo commits with nested package files using parent directory', () => { @@ -908,5 +908,17 @@ describe('workers/repository/updates/generate', () => { '`1.1.1` (+1)', ]); }); + + it('fixes commit message with body', () => { + const branch = [ + partial({ + ...defaultConfig, + commitMessage: 'update to vv1.2.0', + commitBody: 'some body', + }), + ]; + const res = generateBranchConfig(branch); + expect(res.commitMessage).toBe('Update to v1.2.0\n\nsome body'); + }); }); }); diff --git a/lib/workers/repository/updates/generate.ts b/lib/workers/repository/updates/generate.ts index f3df4f73124313..777b77763ff003 100644 --- a/lib/workers/repository/updates/generate.ts +++ b/lib/workers/repository/updates/generate.ts @@ -5,11 +5,12 @@ import semver from 'semver'; import { mergeChildConfig } from '../../../config'; import { CONFIG_SECRETS_EXPOSED } from '../../../constants/error-messages'; import { logger } from '../../../logger'; -import { newlineRegex, regEx } from '../../../util/regex'; +import { regEx } from '../../../util/regex'; import { sanitize } from '../../../util/sanitize'; import * as template from '../../../util/template'; import type { BranchConfig, BranchUpgradeConfig } from '../../types'; -import { CommitMessage } from '../model/commit-message'; +import { CommitMessageFactory } from '../model/commit-message-factory'; +import { SemanticCommitMessage } from '../model/semantic-commit-message'; function isTypesGroup(branchUpgrades: BranchUpgradeConfig[]): boolean { return ( @@ -166,28 +167,24 @@ export function generateBranchConfig( } else if (semver.valid(toVersions[0])) { upgrade.isRange = false; } + const commitMessageFactory = new CommitMessageFactory(upgrade); + const commitMessage = commitMessageFactory.create(); // Use templates to generate strings - if (upgrade.semanticCommits === 'enabled' && !upgrade.commitMessagePrefix) { + if (SemanticCommitMessage.is(commitMessage)) { logger.trace('Upgrade has semantic commits enabled'); - let semanticPrefix = upgrade.semanticCommitType; - if (upgrade.semanticCommitScope) { - semanticPrefix += `(${template.compile( - upgrade.semanticCommitScope, - upgrade - )})`; - } - upgrade.commitMessagePrefix = CommitMessage.formatPrefix(semanticPrefix); - upgrade.toLowerCase = - regEx(/[A-Z]/).exec(upgrade.semanticCommitType) === null && - !upgrade.semanticCommitType.startsWith(':'); + commitMessage.scope = template.compile( + upgrade.semanticCommitScope, + upgrade + ); } // Compile a few times in case there are nested templates - upgrade.commitMessage = template.compile( + commitMessage.subject = template.compile( upgrade.commitMessage || '', upgrade ); - upgrade.commitMessage = template.compile(upgrade.commitMessage, upgrade); - upgrade.commitMessage = template.compile(upgrade.commitMessage, upgrade); + commitMessage.subject = template.compile(commitMessage.subject, upgrade); + commitMessage.subject = template.compile(commitMessage.subject, upgrade); + upgrade.commitMessage = commitMessage.formatSubject(); // istanbul ignore if if (upgrade.commitMessage !== sanitize(upgrade.commitMessage)) { logger.debug( @@ -196,23 +193,14 @@ export function generateBranchConfig( ); throw new Error(CONFIG_SECRETS_EXPOSED); } - upgrade.commitMessage = upgrade.commitMessage.trim(); // Trim exterior whitespace - upgrade.commitMessage = upgrade.commitMessage.replace(regEx(/\s+/g), ' '); // Trim extra whitespace inside string - upgrade.commitMessage = upgrade.commitMessage.replace( + commitMessage.subject = commitMessage.subject.replace( regEx(/to vv(\d)/), 'to v$1' ); - if (upgrade.toLowerCase) { - // We only need to lowercase the first line - const splitMessage = upgrade.commitMessage.split(newlineRegex); - splitMessage[0] = splitMessage[0].toLowerCase(); - upgrade.commitMessage = splitMessage.join('\n'); - } + upgrade.commitMessage = commitMessage.formatSubject(); if (upgrade.commitBody) { - upgrade.commitMessage = `${upgrade.commitMessage}\n\n${template.compile( - upgrade.commitBody, - upgrade - )}`; + commitMessage.body = template.compile(upgrade.commitBody, upgrade); + upgrade.commitMessage = commitMessage.toString(); } logger.trace(`commitMessage: ` + JSON.stringify(upgrade.commitMessage)); if (upgrade.prTitle) { @@ -234,7 +222,7 @@ export function generateBranchConfig( upgrade.prTitle = upgrade.prTitle.toLowerCase(); } } else { - [upgrade.prTitle] = upgrade.commitMessage.split(newlineRegex); + upgrade.prTitle = commitMessage.title; } upgrade.prTitle += upgrade.hasBaseBranches ? ' ({{baseBranch}})' : ''; if (upgrade.isGroup) { From 5c803f2e414ac84300f037ffa6bb33dc3f558ee6 Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Mon, 13 Jun 2022 13:34:14 +0200 Subject: [PATCH 095/240] fix(config): check for undefined str when validating handlebars helpers (#16047) --- lib/util/template/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/util/template/index.ts b/lib/util/template/index.ts index 2028177061240a..c4717f6fe3aa5f 100644 --- a/lib/util/template/index.ts +++ b/lib/util/template/index.ts @@ -17,10 +17,10 @@ handlebars.registerHelper( (context || '').replace(new RegExp(find, 'g'), replace) // TODO #12873 ); -handlebars.registerHelper('lowercase', (str: string) => str.toLowerCase()); +handlebars.registerHelper('lowercase', (str: string) => str?.toLowerCase()); -handlebars.registerHelper('containsString', (str, subStr, options) => - str.includes(subStr) +handlebars.registerHelper('containsString', (str, subStr) => + str?.includes(subStr) ); handlebars.registerHelper({ From ef41262f17f125f618a442846b4f554255b54a76 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Mon, 13 Jun 2022 10:19:44 -0400 Subject: [PATCH 096/240] fix: resolve repoConfig.packageRules.extends with repo config (#14978) --- lib/config/options/index.ts | 3 +- lib/workers/repository/init/merge.spec.ts | 31 ++++++++++++++----- lib/workers/repository/init/merge.ts | 1 + .../onboarding/branch/index.spec.ts | 15 +++++---- 4 files changed, 34 insertions(+), 16 deletions(-) diff --git a/lib/config/options/index.ts b/lib/config/options/index.ts index bc84a2a66be7aa..9b1692ed1fde63 100644 --- a/lib/config/options/index.ts +++ b/lib/config/options/index.ts @@ -152,8 +152,7 @@ const options: RenovateOptions[] = [ }, { name: 'extends', - description: - 'Configuration presets to use or extend. Note: This config option does not work if you use a `config.js` file.', + description: 'Configuration presets to use or extend.', stage: 'package', type: 'array', subType: 'string', diff --git a/lib/workers/repository/init/merge.spec.ts b/lib/workers/repository/init/merge.spec.ts index d0f7aa03d4d7ed..c82dd31040bec5 100644 --- a/lib/workers/repository/init/merge.spec.ts +++ b/lib/workers/repository/init/merge.spec.ts @@ -199,16 +199,31 @@ describe('workers/repository/init/merge', () => { it('migrates nested config', async () => { git.getFileList.mockResolvedValue(['renovate.json']); fs.readLocalFile.mockResolvedValue('{}'); - migrateAndValidate.migrateAndValidate.mockResolvedValue({ - warnings: [], - errors: [], - }); - migrate.migrateConfig.mockReturnValueOnce({ + migrateAndValidate.migrateAndValidate.mockImplementation((_, c) => { + // We shouldn't see packageRules here (avoids #14827). + // (someday the validation should probably be reworked to know about `sourceUrl` from the repo config, but that day isn't today) + expect(c).not.toHaveProperty('packageRules'); + return Promise.resolve({ + ...c, + warnings: [], + errors: [], + }); + }); + migrate.migrateConfig.mockImplementation((c) => ({ isMigrated: true, - migratedConfig: {}, + migratedConfig: c, + })); + config.extends = [':automergeAll']; + config.packageRules = [{ extends: ['monorepo:react'] }]; + const ret = await mergeRenovateConfig(config); + expect(ret).toMatchObject({ + automerge: true, + packageRules: [ + { + matchSourceUrlPrefixes: ['https://github.com/facebook/react'], + }, + ], }); - config.extends = [':automergeDisabled']; - expect(await mergeRenovateConfig(config)).toBeDefined(); }); it('continues if no errors', async () => { diff --git a/lib/workers/repository/init/merge.ts b/lib/workers/repository/init/merge.ts index 1ead00699e8f6e..4ad24befac8a34 100644 --- a/lib/workers/repository/init/merge.ts +++ b/lib/workers/repository/init/merge.ts @@ -249,6 +249,7 @@ export async function mergeRenovateConfig( delete resolvedConfig.hostRules; } returnConfig = mergeChildConfig(returnConfig, resolvedConfig); + returnConfig = await presets.resolveConfigPresets(returnConfig, config); returnConfig.renovateJsonPresent = true; // istanbul ignore if if (returnConfig.ignorePaths?.length) { diff --git a/lib/workers/repository/onboarding/branch/index.spec.ts b/lib/workers/repository/onboarding/branch/index.spec.ts index ea25b06f2ae65e..98a55a94d0ac29 100644 --- a/lib/workers/repository/onboarding/branch/index.spec.ts +++ b/lib/workers/repository/onboarding/branch/index.spec.ts @@ -96,13 +96,16 @@ describe('workers/repository/onboarding/branch/index', () => { git.getFileList.mockResolvedValue(['package.json']); fs.readLocalFile.mockResolvedValue('{}'); await checkOnboardingBranch(config); + const expectConfig = { + ...config, + onboardingBranch: 'test', + renovateJsonPresent: true, + warnings: [], + }; + delete expectConfig.extends; + delete expectConfig.ignorePresets; expect(configModule.getOnboardingConfigContents).toHaveBeenCalledWith( - { - ...config, - onboardingBranch: 'test', - renovateJsonPresent: true, - warnings: [], - }, + expectConfig, configFileNames[0] ); const file = git.commitFiles.mock.calls[0][0].files[0] as FileAddition; From 10944d213a046c05511bc972b26e78f156670c93 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 13 Jun 2022 20:13:03 +0200 Subject: [PATCH 097/240] chore(deps): update dependency husky to v8 (#16046) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index cb000983e73f84..184d48ba0c5e7f 100644 --- a/package.json +++ b/package.json @@ -277,7 +277,7 @@ "expect-more-jest": "5.4.1", "glob": "8.0.3", "graphql": "16.5.0", - "husky": "7.0.4", + "husky": "8.0.1", "jest": "27.5.1", "jest-extended": "2.0.0", "jest-github-actions-reporter": "1.0.3", diff --git a/yarn.lock b/yarn.lock index 0af713bb894173..6a637ab8143212 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5444,10 +5444,10 @@ humanize-ms@^1.2.1: dependencies: ms "^2.0.0" -husky@7.0.4: - version "7.0.4" - resolved "https://registry.yarnpkg.com/husky/-/husky-7.0.4.tgz#242048245dc49c8fb1bf0cc7cfb98dd722531535" - integrity sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ== +husky@8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.1.tgz#511cb3e57de3e3190514ae49ed50f6bc3f50b3e9" + integrity sha512-xs7/chUH/CKdOCs7Zy0Aev9e/dKOMZf3K1Az1nar3tzlv0jfqnYtu235bstsWTmXOR0EfINrPa97yy4Lz6RiKw== iconv-lite@0.4.24: version "0.4.24" From baa6c580ffda1d55e30b08cdb587a40d5a334449 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 13 Jun 2022 18:24:27 +0000 Subject: [PATCH 098/240] chore(deps): update linters to v5.27.1 (#16055) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 4 +-- yarn.lock | 86 ++++++++++++---------------------------------------- 2 files changed, 22 insertions(+), 68 deletions(-) diff --git a/package.json b/package.json index 184d48ba0c5e7f..6e39d5297a0629 100644 --- a/package.json +++ b/package.json @@ -257,8 +257,8 @@ "@types/url-join": "4.0.1", "@types/validate-npm-package-name": "3.0.3", "@types/xmldoc": "1.1.6", - "@typescript-eslint/eslint-plugin": "5.27.0", - "@typescript-eslint/parser": "5.27.0", + "@typescript-eslint/eslint-plugin": "5.27.1", + "@typescript-eslint/parser": "5.27.1", "aws-sdk-client-mock": "0.6.2", "callsite": "1.0.0", "conventional-changelog-conventionalcommits": "5.0.0", diff --git a/yarn.lock b/yarn.lock index 6a637ab8143212..e686994a8a8166 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2750,14 +2750,14 @@ dependencies: "@types/node" "*" -"@typescript-eslint/eslint-plugin@5.27.0": - version "5.27.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.27.0.tgz#23d82a4f21aaafd8f69dbab7e716323bb6695cc8" - integrity sha512-DDrIA7GXtmHXr1VCcx9HivA39eprYBIFxbQEHI6NyraRDxCGpxAFiYQAT/1Y0vh1C+o2vfBiy4IuPoXxtTZCAQ== - dependencies: - "@typescript-eslint/scope-manager" "5.27.0" - "@typescript-eslint/type-utils" "5.27.0" - "@typescript-eslint/utils" "5.27.0" +"@typescript-eslint/eslint-plugin@5.27.1": + version "5.27.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.27.1.tgz#fdf59c905354139046b41b3ed95d1609913d0758" + integrity sha512-6dM5NKT57ZduNnJfpY81Phe9nc9wolnMCnknb1im6brWi1RYv84nbMS3olJa27B6+irUVV1X/Wb+Am0FjJdGFw== + dependencies: + "@typescript-eslint/scope-manager" "5.27.1" + "@typescript-eslint/type-utils" "5.27.1" + "@typescript-eslint/utils" "5.27.1" debug "^4.3.4" functional-red-black-tree "^1.0.1" ignore "^5.2.0" @@ -2772,24 +2772,16 @@ dependencies: "@typescript-eslint/utils" "5.27.1" -"@typescript-eslint/parser@5.27.0": - version "5.27.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.27.0.tgz#62bb091ed5cf9c7e126e80021bb563dcf36b6b12" - integrity sha512-8oGjQF46c52l7fMiPPvX4It3u3V3JipssqDfHQ2hcR0AeR8Zge+OYyKUCm5b70X72N1qXt0qgHenwN6Gc2SXZA== +"@typescript-eslint/parser@5.27.1": + version "5.27.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.27.1.tgz#3a4dcaa67e45e0427b6ca7bb7165122c8b569639" + integrity sha512-7Va2ZOkHi5NP+AZwb5ReLgNF6nWLGTeUJfxdkVUAPPSaAdbWNnFZzLZ4EGGmmiCTg+AwlbE1KyUYTBglosSLHQ== dependencies: - "@typescript-eslint/scope-manager" "5.27.0" - "@typescript-eslint/types" "5.27.0" - "@typescript-eslint/typescript-estree" "5.27.0" + "@typescript-eslint/scope-manager" "5.27.1" + "@typescript-eslint/types" "5.27.1" + "@typescript-eslint/typescript-estree" "5.27.1" debug "^4.3.4" -"@typescript-eslint/scope-manager@5.27.0": - version "5.27.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.27.0.tgz#a272178f613050ed62f51f69aae1e19e870a8bbb" - integrity sha512-VnykheBQ/sHd1Vt0LJ1JLrMH1GzHO+SzX6VTXuStISIsvRiurue/eRkTqSrG0CexHQgKG8shyJfR4o5VYioB9g== - dependencies: - "@typescript-eslint/types" "5.27.0" - "@typescript-eslint/visitor-keys" "5.27.0" - "@typescript-eslint/scope-manager@5.27.1": version "5.27.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.27.1.tgz#4d1504392d01fe5f76f4a5825991ec78b7b7894d" @@ -2798,38 +2790,20 @@ "@typescript-eslint/types" "5.27.1" "@typescript-eslint/visitor-keys" "5.27.1" -"@typescript-eslint/type-utils@5.27.0": - version "5.27.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.27.0.tgz#36fd95f6747412251d79c795b586ba766cf0974b" - integrity sha512-vpTvRRchaf628Hb/Xzfek+85o//zEUotr1SmexKvTfs7czXfYjXVT/a5yDbpzLBX1rhbqxjDdr1Gyo0x1Fc64g== +"@typescript-eslint/type-utils@5.27.1": + version "5.27.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.27.1.tgz#369f695199f74c1876e395ebea202582eb1d4166" + integrity sha512-+UC1vVUWaDHRnC2cQrCJ4QtVjpjjCgjNFpg8b03nERmkHv9JV9X5M19D7UFMd+/G7T/sgFwX2pGmWK38rqyvXw== dependencies: - "@typescript-eslint/utils" "5.27.0" + "@typescript-eslint/utils" "5.27.1" debug "^4.3.4" tsutils "^3.21.0" -"@typescript-eslint/types@5.27.0": - version "5.27.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.27.0.tgz#c3f44b9dda6177a9554f94a74745ca495ba9c001" - integrity sha512-lY6C7oGm9a/GWhmUDOs3xAVRz4ty/XKlQ2fOLr8GAIryGn0+UBOoJDWyHer3UgrHkenorwvBnphhP+zPmzmw0A== - "@typescript-eslint/types@5.27.1": version "5.27.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.27.1.tgz#34e3e629501349d38be6ae97841298c03a6ffbf1" integrity sha512-LgogNVkBhCTZU/m8XgEYIWICD6m4dmEDbKXESCbqOXfKZxRKeqpiJXQIErv66sdopRKZPo5l32ymNqibYEH/xg== -"@typescript-eslint/typescript-estree@5.27.0": - version "5.27.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.27.0.tgz#7965f5b553c634c5354a47dcce0b40b94611e995" - integrity sha512-QywPMFvgZ+MHSLRofLI7BDL+UczFFHyj0vF5ibeChDAJgdTV8k4xgEwF0geFhVlPc1p8r70eYewzpo6ps+9LJQ== - dependencies: - "@typescript-eslint/types" "5.27.0" - "@typescript-eslint/visitor-keys" "5.27.0" - debug "^4.3.4" - globby "^11.1.0" - is-glob "^4.0.3" - semver "^7.3.7" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@5.27.1": version "5.27.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.27.1.tgz#7621ee78607331821c16fffc21fc7a452d7bc808" @@ -2843,18 +2817,6 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.27.0": - version "5.27.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.27.0.tgz#d0021cbf686467a6a9499bd0589e19665f9f7e71" - integrity sha512-nZvCrkIJppym7cIbP3pOwIkAefXOmfGPnCM0LQfzNaKxJHI6VjI8NC662uoiPlaf5f6ymkTy9C3NQXev2mdXmA== - dependencies: - "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.27.0" - "@typescript-eslint/types" "5.27.0" - "@typescript-eslint/typescript-estree" "5.27.0" - eslint-scope "^5.1.1" - eslint-utils "^3.0.0" - "@typescript-eslint/utils@5.27.1", "@typescript-eslint/utils@^5.10.0": version "5.27.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.27.1.tgz#b4678b68a94bc3b85bf08f243812a6868ac5128f" @@ -2867,14 +2829,6 @@ eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/visitor-keys@5.27.0": - version "5.27.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.27.0.tgz#97aa9a5d2f3df8215e6d3b77f9d214a24db269bd" - integrity sha512-46cYrteA2MrIAjv9ai44OQDUoCZyHeGIc4lsjCUX2WT6r4C+kidz1bNiR4017wHOPUythYeH+Sc7/cFP97KEAA== - dependencies: - "@typescript-eslint/types" "5.27.0" - eslint-visitor-keys "^3.3.0" - "@typescript-eslint/visitor-keys@5.27.1": version "5.27.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.27.1.tgz#05a62666f2a89769dac2e6baa48f74e8472983af" From faedc8117e107708bd6c9aa06df3e08c6289b253 Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Mon, 13 Jun 2022 22:58:13 +0200 Subject: [PATCH 099/240] fix: Revert "fix: commit message" (#16057) Revert "fix: commit message (#13197)" This reverts commit ed639b47acd35d296147edfeaab0e01416b806cd. --- .../repository/model/commit-message.ts | 4 -- .../model/semantic-commit-message.spec.ts | 9 ---- .../repository/updates/generate.spec.ts | 14 +----- lib/workers/repository/updates/generate.ts | 50 ++++++++++++------- 4 files changed, 32 insertions(+), 45 deletions(-) diff --git a/lib/workers/repository/model/commit-message.ts b/lib/workers/repository/model/commit-message.ts index b909f5bc1d837d..0344e5b6471fc0 100644 --- a/lib/workers/repository/model/commit-message.ts +++ b/lib/workers/repository/model/commit-message.ts @@ -60,10 +60,6 @@ export abstract class CommitMessage { this._footer = this.normalizeInput(value); } - get subject(): string { - return this._subject; - } - set subject(value: string) { this._subject = this.normalizeInput(value); this._subject = this._subject?.replace( diff --git a/lib/workers/repository/model/semantic-commit-message.spec.ts b/lib/workers/repository/model/semantic-commit-message.spec.ts index 57e74b1bfc56e8..db76829ba5b957 100644 --- a/lib/workers/repository/model/semantic-commit-message.spec.ts +++ b/lib/workers/repository/model/semantic-commit-message.spec.ts @@ -25,15 +25,6 @@ describe('workers/repository/model/semantic-commit-message', () => { expect(message.toString()).toBe('fix(scope): test'); }); - it('should transform to lowercase only first letter', () => { - const message = new SemanticCommitMessage(); - message.subject = 'Update My Org dependencies'; - message.type = 'fix'; - message.scope = 'deps '; - - expect(message.toString()).toBe('fix(deps): update My Org dependencies'); - }); - it('should create instance from string without scope', () => { const instance = SemanticCommitMessage.fromString('feat: ticket 123'); diff --git a/lib/workers/repository/updates/generate.spec.ts b/lib/workers/repository/updates/generate.spec.ts index a27b4015a589e6..25ded125464fbf 100644 --- a/lib/workers/repository/updates/generate.spec.ts +++ b/lib/workers/repository/updates/generate.spec.ts @@ -504,7 +504,7 @@ describe('workers/repository/updates/generate', () => { }), ]; const res = generateBranchConfig(branch); - expect(res.prTitle).toBe('chore: update dependency some-dep to v1.2.0'); + expect(res.prTitle).toBe('chore(): update dependency some-dep to v1.2.0'); }); it('scopes monorepo commits with nested package files using parent directory', () => { @@ -908,17 +908,5 @@ describe('workers/repository/updates/generate', () => { '`1.1.1` (+1)', ]); }); - - it('fixes commit message with body', () => { - const branch = [ - partial({ - ...defaultConfig, - commitMessage: 'update to vv1.2.0', - commitBody: 'some body', - }), - ]; - const res = generateBranchConfig(branch); - expect(res.commitMessage).toBe('Update to v1.2.0\n\nsome body'); - }); }); }); diff --git a/lib/workers/repository/updates/generate.ts b/lib/workers/repository/updates/generate.ts index 777b77763ff003..f3df4f73124313 100644 --- a/lib/workers/repository/updates/generate.ts +++ b/lib/workers/repository/updates/generate.ts @@ -5,12 +5,11 @@ import semver from 'semver'; import { mergeChildConfig } from '../../../config'; import { CONFIG_SECRETS_EXPOSED } from '../../../constants/error-messages'; import { logger } from '../../../logger'; -import { regEx } from '../../../util/regex'; +import { newlineRegex, regEx } from '../../../util/regex'; import { sanitize } from '../../../util/sanitize'; import * as template from '../../../util/template'; import type { BranchConfig, BranchUpgradeConfig } from '../../types'; -import { CommitMessageFactory } from '../model/commit-message-factory'; -import { SemanticCommitMessage } from '../model/semantic-commit-message'; +import { CommitMessage } from '../model/commit-message'; function isTypesGroup(branchUpgrades: BranchUpgradeConfig[]): boolean { return ( @@ -167,24 +166,28 @@ export function generateBranchConfig( } else if (semver.valid(toVersions[0])) { upgrade.isRange = false; } - const commitMessageFactory = new CommitMessageFactory(upgrade); - const commitMessage = commitMessageFactory.create(); // Use templates to generate strings - if (SemanticCommitMessage.is(commitMessage)) { + if (upgrade.semanticCommits === 'enabled' && !upgrade.commitMessagePrefix) { logger.trace('Upgrade has semantic commits enabled'); - commitMessage.scope = template.compile( - upgrade.semanticCommitScope, - upgrade - ); + let semanticPrefix = upgrade.semanticCommitType; + if (upgrade.semanticCommitScope) { + semanticPrefix += `(${template.compile( + upgrade.semanticCommitScope, + upgrade + )})`; + } + upgrade.commitMessagePrefix = CommitMessage.formatPrefix(semanticPrefix); + upgrade.toLowerCase = + regEx(/[A-Z]/).exec(upgrade.semanticCommitType) === null && + !upgrade.semanticCommitType.startsWith(':'); } // Compile a few times in case there are nested templates - commitMessage.subject = template.compile( + upgrade.commitMessage = template.compile( upgrade.commitMessage || '', upgrade ); - commitMessage.subject = template.compile(commitMessage.subject, upgrade); - commitMessage.subject = template.compile(commitMessage.subject, upgrade); - upgrade.commitMessage = commitMessage.formatSubject(); + upgrade.commitMessage = template.compile(upgrade.commitMessage, upgrade); + upgrade.commitMessage = template.compile(upgrade.commitMessage, upgrade); // istanbul ignore if if (upgrade.commitMessage !== sanitize(upgrade.commitMessage)) { logger.debug( @@ -193,14 +196,23 @@ export function generateBranchConfig( ); throw new Error(CONFIG_SECRETS_EXPOSED); } - commitMessage.subject = commitMessage.subject.replace( + upgrade.commitMessage = upgrade.commitMessage.trim(); // Trim exterior whitespace + upgrade.commitMessage = upgrade.commitMessage.replace(regEx(/\s+/g), ' '); // Trim extra whitespace inside string + upgrade.commitMessage = upgrade.commitMessage.replace( regEx(/to vv(\d)/), 'to v$1' ); - upgrade.commitMessage = commitMessage.formatSubject(); + if (upgrade.toLowerCase) { + // We only need to lowercase the first line + const splitMessage = upgrade.commitMessage.split(newlineRegex); + splitMessage[0] = splitMessage[0].toLowerCase(); + upgrade.commitMessage = splitMessage.join('\n'); + } if (upgrade.commitBody) { - commitMessage.body = template.compile(upgrade.commitBody, upgrade); - upgrade.commitMessage = commitMessage.toString(); + upgrade.commitMessage = `${upgrade.commitMessage}\n\n${template.compile( + upgrade.commitBody, + upgrade + )}`; } logger.trace(`commitMessage: ` + JSON.stringify(upgrade.commitMessage)); if (upgrade.prTitle) { @@ -222,7 +234,7 @@ export function generateBranchConfig( upgrade.prTitle = upgrade.prTitle.toLowerCase(); } } else { - upgrade.prTitle = commitMessage.title; + [upgrade.prTitle] = upgrade.commitMessage.split(newlineRegex); } upgrade.prTitle += upgrade.hasBaseBranches ? ' ({{baseBranch}})' : ''; if (upgrade.isGroup) { From 89facd1d5de93bee6ec6fb688093051d8b24eda0 Mon Sep 17 00:00:00 2001 From: Hasan Awad <90554456+hasanwhitesource@users.noreply.github.com> Date: Tue, 14 Jun 2022 00:12:51 +0300 Subject: [PATCH 100/240] feat: add extractedConstraint field for poetry (#15922) Co-authored-by: Rhys Arkins Co-authored-by: Michael Kriese --- .../poetry/__snapshots__/extract.spec.ts.snap | 12 ++-- lib/modules/manager/poetry/extract.spec.ts | 4 +- lib/modules/manager/poetry/extract.ts | 7 ++- lib/modules/manager/types.ts | 1 + .../repository/process/lookup/common.spec.ts | 57 +++++++++++++++++++ .../repository/process/lookup/common.ts | 14 +++++ .../repository/process/lookup/index.ts | 3 + .../repository/process/lookup/types.ts | 1 + 8 files changed, 88 insertions(+), 11 deletions(-) create mode 100644 lib/workers/repository/process/lookup/common.spec.ts create mode 100644 lib/workers/repository/process/lookup/common.ts diff --git a/lib/modules/manager/poetry/__snapshots__/extract.spec.ts.snap b/lib/modules/manager/poetry/__snapshots__/extract.spec.ts.snap index 980e6cde67e796..03001cf902c407 100644 --- a/lib/modules/manager/poetry/__snapshots__/extract.spec.ts.snap +++ b/lib/modules/manager/poetry/__snapshots__/extract.spec.ts.snap @@ -2,7 +2,6 @@ exports[`modules/manager/poetry/extract extractPackageFile() extracts mixed versioning types 1`] = ` Object { - "constraints": Object {}, "deps": Array [ Object { "currentValue": "0.2", @@ -345,13 +344,13 @@ Object { "versioning": "pep440", }, ], + "extractedConstraints": Object {}, "registryUrls": undefined, } `; exports[`modules/manager/poetry/extract extractPackageFile() extracts multiple dependencies (with dep = {version = "1.2.3"} case) 1`] = ` Object { - "constraints": Object {}, "deps": Array [ Object { "currentValue": "*", @@ -424,6 +423,7 @@ Object { "versioning": "poetry", }, ], + "extractedConstraints": Object {}, "registryUrls": undefined, } `; @@ -533,7 +533,6 @@ Array [ exports[`modules/manager/poetry/extract extractPackageFile() handles multiple constraint dependencies 1`] = ` Object { - "constraints": Object {}, "deps": Array [ Object { "currentValue": "", @@ -546,15 +545,13 @@ Object { "skipReason": "multiple-constraint-dep", }, ], + "extractedConstraints": Object {}, "registryUrls": undefined, } `; exports[`modules/manager/poetry/extract extractPackageFile() resolves lockedVersions from the lockfile 1`] = ` Object { - "constraints": Object { - "python": "^3.9", - }, "deps": Array [ Object { "currentValue": "*", @@ -568,6 +565,9 @@ Object { "versioning": "poetry", }, ], + "extractedConstraints": Object { + "python": "^3.9", + }, "registryUrls": undefined, } `; diff --git a/lib/modules/manager/poetry/extract.spec.ts b/lib/modules/manager/poetry/extract.spec.ts index a3c2af1540be65..1a390223fdd2f7 100644 --- a/lib/modules/manager/poetry/extract.spec.ts +++ b/lib/modules/manager/poetry/extract.spec.ts @@ -44,7 +44,7 @@ describe('modules/manager/poetry/extract', () => { const res = await extractPackageFile(pyproject1toml, filename); expect(res.deps).toMatchSnapshot(); expect(res.deps).toHaveLength(9); - expect(res.constraints).toEqual({ + expect(res.extractedConstraints).toEqual({ python: '~2.7 || ^3.4', }); }); @@ -135,7 +135,7 @@ describe('modules/manager/poetry/extract', () => { fs.readLocalFile.mockResolvedValue(pyproject11tomlLock); const res = await extractPackageFile(pyproject11toml, filename); expect(res).toMatchSnapshot({ - constraints: { python: '^3.9' }, + extractedConstraints: { python: '^3.9' }, deps: [{ lockedVersion: '1.17.5' }], }); }); diff --git a/lib/modules/manager/poetry/extract.ts b/lib/modules/manager/poetry/extract.ts index 73ab25b3d28846..66c4aae4d8d5e5 100644 --- a/lib/modules/manager/poetry/extract.ts +++ b/lib/modules/manager/poetry/extract.ts @@ -128,16 +128,17 @@ export async function extractPackageFile( return null; } - const constraints: Record = {}; + const extractedConstraints: Record = {}; if (is.nonEmptyString(pyprojectfile.tool?.poetry?.dependencies?.python)) { - constraints.python = pyprojectfile.tool?.poetry?.dependencies?.python; + extractedConstraints.python = + pyprojectfile.tool?.poetry?.dependencies?.python; } const res: PackageFile = { deps, registryUrls: extractRegistries(pyprojectfile), - constraints, + extractedConstraints, }; // Try poetry.lock first let lockFile = getSiblingFileName(fileName, 'poetry.lock'); diff --git a/lib/modules/manager/types.ts b/lib/modules/manager/types.ts index cd92661139edc1..16204ecc6308db 100644 --- a/lib/modules/manager/types.ts +++ b/lib/modules/manager/types.ts @@ -76,6 +76,7 @@ export interface PackageFile> autoReplaceStringTemplate?: string; hasYarnWorkspaces?: boolean; constraints?: Record; + extractedConstraints?: Record; datasource?: string; registryUrls?: string[]; additionalRegistryUrls?: string[]; diff --git a/lib/workers/repository/process/lookup/common.spec.ts b/lib/workers/repository/process/lookup/common.spec.ts new file mode 100644 index 00000000000000..d859fc6239627d --- /dev/null +++ b/lib/workers/repository/process/lookup/common.spec.ts @@ -0,0 +1,57 @@ +import { mergeConfigConstraints } from './common'; +import type { LookupUpdateConfig } from './types'; + +describe('workers/repository/process/lookup/common', () => { + it('overrides extracted config with user config', () => { + const config: LookupUpdateConfig = { + datasource: '', + depName: '', + versioning: '', + rangeStrategy: 'pin', + }; + config.constraints = { + constraint1: 'configValue1', + constraint2: 'configValue2', + constraint3: 'configValue3', + }; + config.extractedConstraints = { + constraint3: 'extractedValue3', + constraint4: 'exractedValue4', + }; + expect(mergeConfigConstraints(config)).toMatchObject({ + datasource: '', + depName: '', + versioning: '', + rangeStrategy: 'pin', + constraints: { + constraint1: 'configValue1', + constraint2: 'configValue2', + constraint3: 'configValue3', + constraint4: 'exractedValue4', + }, + }); + }); + + it('sets config with extracted config', () => { + const config: LookupUpdateConfig = { + datasource: '', + depName: '', + versioning: '', + rangeStrategy: 'pin', + }; + config.extractedConstraints = { + constraint3: 'extractedValue3', + constraint4: 'exractedValue4', + }; + expect(mergeConfigConstraints(config)).toMatchObject({ + datasource: '', + depName: '', + versioning: '', + rangeStrategy: 'pin', + constraints: { + constraint3: 'extractedValue3', + constraint4: 'exractedValue4', + }, + }); + }); +}); diff --git a/lib/workers/repository/process/lookup/common.ts b/lib/workers/repository/process/lookup/common.ts new file mode 100644 index 00000000000000..521bd99496bc44 --- /dev/null +++ b/lib/workers/repository/process/lookup/common.ts @@ -0,0 +1,14 @@ +import type { LookupUpdateConfig } from './types'; + +export function mergeConfigConstraints( + config: LookupUpdateConfig +): LookupUpdateConfig { + if (config?.extractedConstraints) { + config.constraints = { + ...config.extractedConstraints, + ...config.constraints, + }; + delete config.extractedConstraints; + } + return config; +} diff --git a/lib/workers/repository/process/lookup/index.ts b/lib/workers/repository/process/lookup/index.ts index 33a1fbeefb40eb..9b682b4d03e2ae 100644 --- a/lib/workers/repository/process/lookup/index.ts +++ b/lib/workers/repository/process/lookup/index.ts @@ -19,6 +19,7 @@ import { clone } from '../../../../util/clone'; import { applyPackageRules } from '../../../../util/package-rules'; import { regEx } from '../../../../util/regex'; import { getBucket } from './bucket'; +import { mergeConfigConstraints } from './common'; import { getCurrentVersion } from './current'; import { filterVersions } from './filter'; import { filterInternalChecks } from './filter-checks'; @@ -74,6 +75,8 @@ export async function lookupUpdates( return res; } + config = mergeConfigConstraints(config); + const dependency = clone(await getPkgReleases(config)); if (!dependency) { // If dependency lookup fails then warn and return diff --git a/lib/workers/repository/process/lookup/types.ts b/lib/workers/repository/process/lookup/types.ts index 4c10d150a5e420..a985cd601a5537 100644 --- a/lib/workers/repository/process/lookup/types.ts +++ b/lib/workers/repository/process/lookup/types.ts @@ -44,6 +44,7 @@ export interface LookupUpdateConfig datasource: string; depName: string; minimumConfidence?: string; + extractedConstraints?: Record; } export interface UpdateResult { From ae74a334431f77f9824a38922835148c601d1ad5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 14 Jun 2022 02:32:15 +0000 Subject: [PATCH 101/240] chore(deps): update node.js to 8284d33 (#16060) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .devcontainer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index c2fee237d2807a..1f2903dfa8cb0b 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM containerbase/node:14.19.3@sha256:c0625aee5e86099a4680ba316a9b82d9988a1b6494009e2a9ad1fabb368d5c69 +FROM containerbase/node:14.19.3@sha256:8284d33539e37f14f623ed6a3f5b86f8e6c782ca395d9ac6daabad7a5e1aa418 USER root From 10731ddb737dbcc64885ee9b94a41477f70bcb5a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 14 Jun 2022 06:45:42 +0200 Subject: [PATCH 102/240] chore(deps): update dependency typescript to v4.7.3 (#15815) --- lib/modules/manager/npm/update/dependency/index.ts | 2 +- package.json | 2 +- yarn.lock | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/modules/manager/npm/update/dependency/index.ts b/lib/modules/manager/npm/update/dependency/index.ts index c2231d7c560e15..768a0954af4568 100644 --- a/lib/modules/manager/npm/update/dependency/index.ts +++ b/lib/modules/manager/npm/update/dependency/index.ts @@ -41,7 +41,7 @@ function replaceAsString( parsedContents[depType] = newValue; } else if (depName === oldValue) { // The old value is the name of the dependency itself - delete Object.assign(parsedContents[depType], { + delete Object.assign(parsedContents[depType]!, { [newValue]: parsedContents[depType]![oldValue], })[oldValue]; } else if (depType === 'dependenciesMeta') { diff --git a/package.json b/package.json index 6e39d5297a0629..a088ea4908b879 100644 --- a/package.json +++ b/package.json @@ -300,7 +300,7 @@ "ts-jest": "27.1.5", "ts-node": "10.8.1", "type-fest": "2.12.2", - "typescript": "4.6.4", + "typescript": "4.7.3", "unified": "9.2.2" }, "resolutions": { diff --git a/yarn.lock b/yarn.lock index e686994a8a8166..60b6ea12188517 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9544,10 +9544,10 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" -typescript@4.6.4: - version "4.6.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.4.tgz#caa78bbc3a59e6a5c510d35703f6a09877ce45e9" - integrity sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg== +typescript@4.7.3: + version "4.7.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.3.tgz#8364b502d5257b540f9de4c40be84c98e23a129d" + integrity sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA== uc.micro@^1.0.1, uc.micro@^1.0.5: version "1.0.6" From 96dc2e34d34f799b6f72ba19fba9b59281f64a31 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 14 Jun 2022 06:42:12 +0000 Subject: [PATCH 103/240] docs: update references to renovate/renovate to v32.85.0 (#16062) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- docs/usage/docker.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/docker.md b/docs/usage/docker.md index 3b0bc85c6dce52..db3ff4e93d3c75 100644 --- a/docs/usage/docker.md +++ b/docs/usage/docker.md @@ -268,7 +268,7 @@ To get access to the token a custom Renovate Docker image is needed that include The Dockerfile to create such an image can look like this: ```Dockerfile -FROM renovate/renovate:32.83.2 +FROM renovate/renovate:32.85.0 # Include the "Docker tip" which you can find here https://cloud.google.com/sdk/docs/install # under "Installation" for "Debian/Ubuntu" RUN ... From cdf328dc71e22bac0d6b9cc9166d122b175370ec Mon Sep 17 00:00:00 2001 From: Gabriel-Ladzaretti <97394622+Gabriel-Ladzaretti@users.noreply.github.com> Date: Tue, 14 Jun 2022 14:08:23 +0300 Subject: [PATCH 104/240] docs: Prettify JSON output for default objects in docs (#16015) --- tools/docs/config.ts | 85 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 77 insertions(+), 8 deletions(-) diff --git a/tools/docs/config.ts b/tools/docs/config.ts index b65f93d71831c4..e98328eb9fe3b0 100644 --- a/tools/docs/config.ts +++ b/tools/docs/config.ts @@ -1,4 +1,4 @@ -import table from 'markdown-table'; +import stringify from 'json-stringify-pretty-compact'; import { getOptions } from '../../lib/config/options'; import { getCliName } from '../../lib/workers/global/config/parse/cli'; import { getEnvName } from '../../lib/workers/global/config/parse/env'; @@ -6,6 +6,75 @@ import { readFile, updateFile } from '../utils'; const options = getOptions(); +/** + * Merge string arrays one by one + * Example: let arr1 = ['a','b','c'], arr2 = ['1','2','3','4','5'] + * merge(arr1,arr2) = ['a','1','b','2','c','3','4','5'] + * @param array1 + * @param array2 + */ +function merge(array1: string[], array2: string[]): string[] { + const arr1 = [...array1]; + const arr2 = [...array2]; + const merged: string[] = []; + + for (const str1 of arr1) { + merged.push(str1); + const str2 = arr2.pop(); + if (str2 !== undefined) { + merged.push(str2); + } + } + return merged.concat(arr2); +} + +function indent( + strings: TemplateStringsArray, + ...keys: (string | number | boolean)[] +): string { + const indent = ' '; + const strs = [...strings]; + let amount = 0; + // validate input + if (typeof keys[0] === 'number' && strings[0] === '') { + amount = keys.shift() as number; + strs.shift(); + } + return indent.repeat(amount) + merge(strs, keys.map(String)).join(''); +} + +function buildHtmlTable(data: string[][]): string { + // skip empty tables + if (data.length < 2) { + return ''; + } + let table = `\n`; + for (const [i, row] of data.entries()) { + if (i === 0) { + table += indent`${1}\n`; + } + + if (i === 1) { + table += indent`${1}\n` + indent`${1}\n`; + } + + table += indent`${2}\n`; + for (const col of row) { + if (i === 0) { + table += indent`${3}\n`; + continue; + } + table += + indent`${3}\n`; + } + table += indent`${2}\n`; + } + table += indent`${1}\n
${col}${col}` + + (`${col}`.endsWith('\n') ? indent`${3}` : '') + + `
\n`; + return table; +} + function genTable(obj: [string, string][], type: string, def: any): string { const data = [['Name', 'Value']]; const name = obj[0][1]; @@ -33,14 +102,14 @@ function genTable(obj: [string, string][], type: string, def: any): string { name !== 'prBody') ) { if (type === 'string' && el[0] === 'default') { - el[1] = `\`"${el[1]}"\``; + el[1] = `"${el[1]}"`; } if ( (type === 'boolean' && el[0] === 'default') || el[0] === 'cli' || el[0] === 'env' ) { - el[1] = `\`${el[1]}\``; + el[1] = `${el[1]}`; } if (type === 'string' && el[0] === 'default' && el[1].length > 200) { el[1] = `[template]`; @@ -51,7 +120,7 @@ function genTable(obj: [string, string][], type: string, def: any): string { if (Object.keys(el[1] ?? []).length === 0) { return; } - el[1] = `\`${JSON.stringify(el[1])}\``; + el[1] = `\n\`\`\`json\n${stringify(el[1], { indent: 2 })}\n\`\`\`\n`; } data.push(el); } @@ -61,15 +130,15 @@ function genTable(obj: [string, string][], type: string, def: any): string { data.push(['default', '`[]`']); } if (type === 'string' && def === undefined) { - data.push(['default', '`null`']); + data.push(['default', 'null']); } if (type === 'boolean' && def === undefined) { - data.push(['default', '`true`']); + data.push(['default', 'true']); } if (type === 'boolean' && def === null) { - data.push(['default', '`null`']); + data.push(['default', 'null']); } - return table(data); + return buildHtmlTable(data); } export async function generateConfig(dist: string, bot = false): Promise { From 572a01b48ecd54ddea96f372289fd891a9d59663 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 14 Jun 2022 14:29:09 +0000 Subject: [PATCH 105/240] chore(deps): update node.js to 912d9db (#16069) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .devcontainer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 1f2903dfa8cb0b..c8eac0f02a213e 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM containerbase/node:14.19.3@sha256:8284d33539e37f14f623ed6a3f5b86f8e6c782ca395d9ac6daabad7a5e1aa418 +FROM containerbase/node:14.19.3@sha256:912d9dbdbe0f5f9f0b9eb591d9ff0eef0292726b1c50757ef9c30bded6ac14c0 USER root From 6a784366009aa1bee724012f016e3c3c6f0ce365 Mon Sep 17 00:00:00 2001 From: Tobias Date: Tue, 14 Jun 2022 16:57:15 +0200 Subject: [PATCH 106/240] feat(github): enable platformAutomerge feature for GHES>=3.3 (#15924) --- lib/modules/platform/github/index.spec.ts | 88 +++++++++++++++++++++++ lib/modules/platform/github/index.ts | 23 +++++- 2 files changed, 109 insertions(+), 2 deletions(-) diff --git a/lib/modules/platform/github/index.spec.ts b/lib/modules/platform/github/index.spec.ts index 6c7a301959c3f3..f6fb3ad3f3c039 100644 --- a/lib/modules/platform/github/index.spec.ts +++ b/lib/modules/platform/github/index.spec.ts @@ -2338,6 +2338,94 @@ describe('modules/platform/github/index', () => { ]); }); + it('should skip automerge if GHE <3.3.0', async () => { + const scope = httpMock + .scope('https://github.company.com') + .head('/') + .reply(200, '', { 'x-github-enterprise-version': '3.1.7' }) + .get('/user') + .reply(200, { + login: 'renovate-bot', + }) + .get('/user/emails') + .reply(200, {}) + .post('/repos/some/repo/pulls') + .reply(200, { + number: 123, + }) + .post('/repos/some/repo/issues/123/labels') + .reply(200, []); + + initRepoMock(scope, 'some/repo'); + await github.initPlatform({ + endpoint: 'https://github.company.com', + token: '123test', + }); + hostRules.find.mockReturnValue({ + token: '123test', + }); + await github.initRepo({ + repository: 'some/repo', + } as any); + await github.createPr(prConfig); + + expect(logger.logger.debug).toHaveBeenNthCalledWith( + 10, + { prNumber: 123 }, + 'GitHub-native automerge: not supported on this GHE version. Requires >=3.3.0' + ); + }); + + it('should perform automerge if GHE >=3.3.0', async () => { + const scope = httpMock + .scope('https://github.company.com') + .head('/') + .reply(200, '', { 'x-github-enterprise-version': '3.3.5' }) + .get('/user') + .reply(200, { + login: 'renovate-bot', + }) + .get('/user/emails') + .reply(200, {}) + .post('/repos/some/repo/pulls') + .reply(200, { + number: 123, + }) + .post('/repos/some/repo/issues/123/labels') + .reply(200, []) + .post('/graphql') + .reply(200, { + data: { + repository: { + defaultBranchRef: { + name: 'main', + }, + nameWithOwner: 'some/repo', + autoMergeAllowed: true, + }, + }, + }); + + initRepoMock(scope, 'some/repo'); + await github.initPlatform({ + endpoint: 'https://github.company.com', + token: '123test', + }); + hostRules.find.mockReturnValue({ + token: '123test', + }); + await github.initRepo({ + repository: 'some/repo', + } as any); + await github.createPr(prConfig); + + expect(logger.logger.debug).toHaveBeenNthCalledWith( + 11, + { prNumber: 123 }, + 'GitHub-native automerge: success' + ); + }); + it('should set automatic merge', async () => { const scope = await mockScope(); scope.post('/graphql').reply(200, graphqlAutomergeResp); diff --git a/lib/modules/platform/github/index.ts b/lib/modules/platform/github/index.ts index 31a92292d3116f..003d4f3cdf9d22 100644 --- a/lib/modules/platform/github/index.ts +++ b/lib/modules/platform/github/index.ts @@ -269,7 +269,13 @@ export async function initRepo({ try { let infoQuery = repoInfoQuery; - if (platformConfig.isGhe) { + // GitHub Enterprise Server <3.3.0 doesn't support autoMergeAllowed and hasIssuesEnabled objects + if ( + platformConfig.isGhe && + // semver not null safe, accepts null and undefined + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + semver.satisfies(platformConfig.gheVersion!, '<3.3.0') + ) { infoQuery = infoQuery.replace(/\n\s*autoMergeAllowed\s*\n/, '\n'); infoQuery = infoQuery.replace(/\n\s*hasIssuesEnabled\s*\n/, '\n'); } @@ -1323,10 +1329,23 @@ async function tryPrAutomerge( prNodeId: string, platformOptions: PlatformPrOptions | undefined ): Promise { - if (platformConfig.isGhe || !platformOptions?.usePlatformAutomerge) { + if (!platformOptions?.usePlatformAutomerge) { return; } + // If GitHub Enterprise Server <3.3.0 it doesn't support automerge + if (platformConfig.isGhe) { + // semver not null safe, accepts null and undefined + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + if (semver.satisfies(platformConfig.gheVersion!, '<3.3.0')) { + logger.debug( + { prNumber }, + 'GitHub-native automerge: not supported on this GHE version. Requires >=3.3.0' + ); + return; + } + } + if (!config.autoMergeAllowed) { logger.debug( { prNumber }, From a4205761c8ccb6a177b08f15e8647e27d35d62ae Mon Sep 17 00:00:00 2001 From: Johannes Feichtner Date: Tue, 14 Jun 2022 21:51:11 +0200 Subject: [PATCH 107/240] feat(terraform): kubernetes image resources support (#16029) * add tests * add support for kubernetes image resources * Update lib/modules/manager/terraform/extract.ts Co-authored-by: Sebastian Poxhofer * added unknown resource * added Kubernetes to Readme * missed one spot in the Readme * Update lib/modules/manager/terraform/readme.md Co-authored-by: Sebastian Poxhofer * switch to toMatchObject() in tests Co-authored-by: Sebastian Poxhofer Co-authored-by: Rhys Arkins Co-authored-by: Michael Kriese --- .../manager/terraform/__fixtures__/docker.tf | 6 +- .../terraform/__fixtures__/kubernetes.tf | 255 ++++++++++++++++++ lib/modules/manager/terraform/common.ts | 54 ++-- lib/modules/manager/terraform/extract.spec.ts | 85 ++++++ lib/modules/manager/terraform/extract.ts | 4 +- lib/modules/manager/terraform/readme.md | 42 ++- lib/modules/manager/terraform/resources.ts | 43 ++- lib/modules/manager/terraform/types.ts | 7 +- 8 files changed, 427 insertions(+), 69 deletions(-) create mode 100644 lib/modules/manager/terraform/__fixtures__/kubernetes.tf diff --git a/lib/modules/manager/terraform/__fixtures__/docker.tf b/lib/modules/manager/terraform/__fixtures__/docker.tf index 9111419102e301..de04d0cd91d607 100644 --- a/lib/modules/manager/terraform/__fixtures__/docker.tf +++ b/lib/modules/manager/terraform/__fixtures__/docker.tf @@ -1,5 +1,5 @@ # docker_image resources -# https://www.terraform.io/docs/providers/docker/r/image.html +# https://registry.terraform.io/providers/kreuzwerker/docker/latest/docs/resources/image resource "docker_image" "nginx" { name = "nginx:1.7.8" } @@ -14,7 +14,7 @@ resource "docker_image" "ignore_variable" { # docker_container resources -# https://www.terraform.io/docs/providers/docker/r/container.html +# https://registry.terraform.io/providers/kreuzwerker/docker/latest/docs/resources/container resource "docker_container" "foo" { name = "foo" image = "nginx:1.7.8" @@ -26,7 +26,7 @@ resource "docker_container" "invalid" { # docker_service resources -# https://www.terraform.io/docs/providers/docker/r/service.html +# https://registry.terraform.io/providers/kreuzwerker/docker/latest/docs/resources/service resource "docker_service" "foo" { name = "foo-service" diff --git a/lib/modules/manager/terraform/__fixtures__/kubernetes.tf b/lib/modules/manager/terraform/__fixtures__/kubernetes.tf new file mode 100644 index 00000000000000..bd8e5886b4f494 --- /dev/null +++ b/lib/modules/manager/terraform/__fixtures__/kubernetes.tf @@ -0,0 +1,255 @@ +resource "kubernetes_cron_job_v1" "demo" { + metadata {} + spec { + job_template { + metadata {} + spec { + template { + metadata {} + spec { + container { + name = "kaniko" + image = "gcr.io/kaniko-project/executor:v1.7.0@sha256:8504bde9a9a8c9c4e9a4fe659703d265697a36ff13607b7669a4caa4407baa52" + } + } + } + } + } + schedule = "" + } +} + +resource "kubernetes_cron_job" "demo" { + metadata {} + spec { + job_template { + metadata {} + spec { + template { + metadata {} + spec { + container { + name = "kaniko" + image = "gcr.io/kaniko-project/executor:v1.8.0@sha256:8504bde9a9a8c9c4e9a4fe659703d265697a36ff13607b7669a4caa4407baa52" + } + } + } + } + } + schedule = "" + } +} + +resource "kubernetes_daemon_set_v1" "example" { + metadata {} + spec { + template { + metadata {} + spec { + container { + image = "nginx:1.21.1" + name = "example1" + } + } + } + } +} + +resource "kubernetes_daemonset" "example" { + metadata {} + spec { + template { + metadata {} + spec { + container { + image = "nginx:1.21.2" + name = "example2" + } + } + } + } +} + +resource "kubernetes_deployment" "example" { + metadata {} + spec { + template { + metadata {} + spec { + container { + image = "nginx:1.21.3" + name = "example3" + } + } + } + } +} + +resource "kubernetes_deployment_v1" "example" { + metadata {} + spec { + template { + metadata {} + spec { + container { + image = "nginx:1.21.4" + name = "example4" + } + } + } + } +} + +resource "kubernetes_job" "demo" { + metadata {} + spec { + template { + metadata {} + spec { + container { + name = "example5" + image = "nginx:1.21.5" + } + } + } + } +} + +resource "kubernetes_job" "demo_invalid" { + metadata {} + spec { + template { + metadata {} + spec { + container { + name = "example5-invalid" + } + } + } + } +} + +resource "kubernetes_job_invalid" "demo_invalid2" { + metadata {} + spec { + template { + metadata {} + spec { + container { + name = "example5" + image = "nginx:1.21.6" + } + } + } + } +} + +resource "kubernetes_job_v1" "demo" { + metadata {} + spec { + template { + metadata {} + spec { + container { + name = "example6" + image = "nginx:1.21.6" + } + } + } + } +} + +resource "kubernetes_pod" "test" { + metadata {} + spec { + container { + image = "nginx:1.21.7" + name = "example7" + } + } +} + +resource "kubernetes_pod_v1" "test" { + metadata {} + spec { + container { + image = "nginx:1.21.8" + name = "example8" + } + } +} + +resource "kubernetes_replication_controller" "example" { + metadata {} + spec { + selector = {} + template { + metadata {} + spec { + container { + image = "nginx:1.21.9" + name = "example9" + } + } + } + } +} + +resource "kubernetes_replication_controller_v1" "example" { + metadata {} + spec { + selector = {} + template { + metadata {} + spec { + container { + image = "nginx:1.21.10" + name = "example10" + } + } + } + } +} + +resource "kubernetes_stateful_set" "prometheus" { + metadata {} + spec { + template { + metadata {} + spec { + init_container { + name = "example11" + image = "nginx:1.21.11" + } + container { + name = "prometheus-server1" + image = "prom/prometheus:v2.2.1" + } + } + } + service_name = "" + selector {} + } +} + +resource "kubernetes_stateful_set_v1" "prometheus" { + metadata {} + spec { + template { + metadata {} + spec { + init_container { + name = "example12" + image = "nginx:1.21.12" + } + + container { + name = "prometheus-server2" + image = "prom/prometheus:v2.2.2" + } + } + } + service_name = "" + selector {} + } +} diff --git a/lib/modules/manager/terraform/common.ts b/lib/modules/manager/terraform/common.ts index 8e168d7d02b884..8e123299a04d28 100644 --- a/lib/modules/manager/terraform/common.ts +++ b/lib/modules/manager/terraform/common.ts @@ -11,27 +11,33 @@ export enum TerraformDependencyTypes { terraform_version = 'terraform_version', } -// eslint-disable-next-line typescript-enum/no-enum -export enum TerraformResourceTypes { - unknown = 'unknown', - /** - * https://www.terraform.io/docs/providers/docker/r/container.html - */ - docker_container = 'docker_container', - /** - * https://www.terraform.io/docs/providers/docker/r/image.html - */ - docker_image = 'docker_image', - /** - * https://www.terraform.io/docs/providers/docker/r/service.html - */ - docker_service = 'docker_service', - /** - * https://www.terraform.io/docs/providers/helm/r/release.html - */ - helm_release = 'helm_release', - /** - * https://registry.terraform.io/providers/hashicorp/tfe/latest/docs/resources/workspace - */ - tfe_workspace = 'tfe_workspace', -} +export const TerraformResourceTypes: Record = { + unknown: ['unknown'], + generic_image_resource: [ + // Docker provider: https://registry.terraform.io/providers/kreuzwerker/docker + 'docker_container', + 'docker_service', + // Kubernetes provider: https://registry.terraform.io/providers/hashicorp/kubernetes + 'kubernetes_cron_job', + 'kubernetes_cron_job_v1', + 'kubernetes_daemon_set', + 'kubernetes_daemon_set_v1', + 'kubernetes_daemonset', + 'kubernetes_deployment', + 'kubernetes_deployment_v1', + 'kubernetes_job', + 'kubernetes_job_v1', + 'kubernetes_pod', + 'kubernetes_pod_v1', + 'kubernetes_replication_controller', + 'kubernetes_replication_controller_v1', + 'kubernetes_stateful_set', + 'kubernetes_stateful_set_v1', + ], + // https://registry.terraform.io/providers/kreuzwerker/docker/latest/docs/resources/image + docker_image: ['docker_image'], + // https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release + helm_release: ['helm_release'], + // https://registry.terraform.io/providers/hashicorp/tfe/latest/docs/resources/workspace + tfe_workspace: ['tfe_workspace'], +}; diff --git a/lib/modules/manager/terraform/extract.spec.ts b/lib/modules/manager/terraform/extract.spec.ts index d1d82d8556787a..e876b5bc0a56a9 100644 --- a/lib/modules/manager/terraform/extract.spec.ts +++ b/lib/modules/manager/terraform/extract.spec.ts @@ -10,6 +10,7 @@ const bitbucketModules = Fixtures.get('bitbucketModules.tf'); const azureDevOpsModules = Fixtures.get('azureDevOpsModules.tf'); const providers = Fixtures.get('providers.tf'); const docker = Fixtures.get('docker.tf'); +const kubernetes = Fixtures.get('kubernetes.tf'); const tf2 = `module "relative" { source = "../fe" @@ -104,6 +105,90 @@ describe('modules/manager/terraform/extract', () => { expect(res).toMatchSnapshot(); }); + it('extracts kubernetes resources', async () => { + const res = await extractPackageFile(kubernetes, 'kubernetes.tf', {}); + expect(res.deps).toHaveLength(16); + expect(res.deps.filter((dep) => dep.skipReason)).toHaveLength(2); + expect(res.deps).toMatchObject([ + { + depName: 'gcr.io/kaniko-project/executor', + currentValue: 'v1.7.0', + currentDigest: + 'sha256:8504bde9a9a8c9c4e9a4fe659703d265697a36ff13607b7669a4caa4407baa52', + depType: 'kubernetes_cron_job_v1', + }, + { + depName: 'gcr.io/kaniko-project/executor', + currentValue: 'v1.8.0', + currentDigest: + 'sha256:8504bde9a9a8c9c4e9a4fe659703d265697a36ff13607b7669a4caa4407baa52', + depType: 'kubernetes_cron_job', + }, + { + depName: 'nginx', + currentValue: '1.21.1', + depType: 'kubernetes_daemon_set_v1', + }, + { + depName: 'nginx', + currentValue: '1.21.2', + depType: 'kubernetes_daemonset', + }, + { + depName: 'nginx', + currentValue: '1.21.3', + depType: 'kubernetes_deployment', + }, + { + depName: 'nginx', + currentValue: '1.21.4', + depType: 'kubernetes_deployment_v1', + }, + { + depName: 'nginx', + currentValue: '1.21.5', + depType: 'kubernetes_job', + }, + { skipReason: 'invalid-dependency-specification' }, + { skipReason: 'invalid-value' }, + { + depName: 'nginx', + currentValue: '1.21.6', + depType: 'kubernetes_job_v1', + }, + { + depName: 'nginx', + currentValue: '1.21.7', + depType: 'kubernetes_pod', + }, + { + depName: 'nginx', + currentValue: '1.21.8', + depType: 'kubernetes_pod_v1', + }, + { + depName: 'nginx', + currentValue: '1.21.9', + depType: 'kubernetes_replication_controller', + }, + { + depName: 'nginx', + currentValue: '1.21.10', + depType: 'kubernetes_replication_controller_v1', + }, + { + depName: 'prom/prometheus', + currentValue: 'v2.2.1', + depType: 'kubernetes_stateful_set', + }, + { + depName: 'prom/prometheus', + currentValue: 'v2.2.2', + depType: 'kubernetes_stateful_set_v1', + }, + ]); + }); + it('returns null if only local deps', async () => { expect(await extractPackageFile(tf2, '2.tf', {})).toBeNull(); }); diff --git a/lib/modules/manager/terraform/extract.ts b/lib/modules/manager/terraform/extract.ts index 1f2aae7a146384..73df9d7b295e52 100644 --- a/lib/modules/manager/terraform/extract.ts +++ b/lib/modules/manager/terraform/extract.ts @@ -34,11 +34,13 @@ const dependencyBlockExtractionRegex = regEx( const contentCheckList = [ 'module "', 'provider "', + '"docker_', + '"kubernetes_', 'required_providers ', ' "helm_release" ', ' "docker_image" ', 'required_version', - 'terraform_version', // part of tfe_workspace + 'terraform_version', // part of tfe_workspace ]; export async function extractPackageFile( diff --git a/lib/modules/manager/terraform/readme.md b/lib/modules/manager/terraform/readme.md index d158f3e0803592..405ada1aec2725 100644 --- a/lib/modules/manager/terraform/readme.md +++ b/lib/modules/manager/terraform/readme.md @@ -1,4 +1,4 @@ -Currently, Terraform supports renovating the following dependencies, where sub points represent hosting options of the dependencies: +Currently, Terraform supports renovating the following dependencies, where sub-points represent hosting options of the dependencies: - modules - GitTags @@ -13,6 +13,8 @@ Currently, Terraform supports renovating the following dependencies, where sub p - chart repository ( Public and Private ) - docker\_\* - Docker registry ( Public and Private ) +- kubernetes\_\* + - Docker registry ( Public and Private ) - [tfe_workspace](https://registry.terraform.io/providers/hashicorp/tfe/latest/docs/resources/workspace) ( `terraform_version` argument ) Terraform range constraints are supported: @@ -23,18 +25,32 @@ Terraform range constraints are supported: - `~> 1.2`: any non-beta version >= 1.2.0 and < 2.0.0, e.g. 1.X.Y - `>= 1.0.0, <= 2.0.0`: any version between 1.0.0 and 2.0.0 inclusive -For fine-grained control, e.g. to turn off only parts of this manager, you can use the following `depTypes`: +For fine-grained control, e.g., to turn off only parts of this manager, you can use the following `depTypes`: -| resource | depType | Notes | -| --------------------------- | :-----------------: | :------------------------------------------------------------------------: | -| Terraform provider | `provider` | | -| required Terraform provider | `required_provider` | | -| required Terraform version | `required_version` | This handles the `required_version` in terraform blocks | -| TFE workspace | `tfe_workspace` | This handles the `terraform_version` argument in `tfe_workspace` resources | -| Terraform module | `module` | | -| Helm release | `helm_release` | | -| Docker container | `docker_container` | | -| Docker image | `docker_image` | | -| Docker service | `docker_service` | | +| resource | depType | Notes | +| ------------------------------------ | :------------------------------------: | :------------------------------------------------------------------------: | +| Terraform provider | `provider` | | +| required Terraform provider | `required_provider` | | +| required Terraform version | `required_version` | This handles the `required_version` in terraform blocks | +| TFE workspace | `tfe_workspace` | This handles the `terraform_version` argument in `tfe_workspace` resources | +| Terraform module | `module` | | +| Helm release | `helm_release` | | +| Docker container | `docker_container` | | +| Docker image | `docker_image` | | +| Docker service | `docker_service` | | +| Kubernetes CronJob | `kubernetes_cron_job` | | +| Kubernetes CronJob v1 | `kubernetes_cron_job_v1` | | +| Kubernetes DaemonSet | `kubernetes_daemon_set` | | +| Kubernetes DaemonSet v1 | `kubernetes_daemon_set_v1` | | +| Kubernetes Deployment | `kubernetes_deployment` | | +| Kubernetes Deployment v1 | `kubernetes_deployment_v1` | | +| Kubernetes Job | `kubernetes_job` | | +| Kubernetes Job v1 | `kubernetes_job_v1` | | +| Kubernetes Pod | `kubernetes_pod` | | +| Kubernetes Pod v1 | `kubernetes_pod_v1` | | +| Kubernetes Replication Controller | `kubernetes_replication_controller` | | +| Kubernetes Replication Controller v1 | `kubernetes_replication_controller_v1` | | +| Kubernetes StatefulSet | `kubernetes_stateful_set` | | +| Kubernetes StatefulSet v1 | `kubernetes_stateful_set_v1` | | If you need to change the versioning format, read the [versioning](https://docs.renovatebot.com/modules/versioning/) documentation to learn more. diff --git a/lib/modules/manager/terraform/resources.ts b/lib/modules/manager/terraform/resources.ts index 587b52aac0b8ca..9811c8f1041961 100644 --- a/lib/modules/manager/terraform/resources.ts +++ b/lib/modules/manager/terraform/resources.ts @@ -37,10 +37,18 @@ export function extractTerraformResource( const typeMatch = resourceTypeExtractionRegex.exec(line); - // Sets the resourceType, e.g. "helm_release" 'resource "helm_release" "test_release"' - managerData.resourceType = - TerraformResourceTypes[typeMatch?.groups?.type as TerraformResourceTypes] ?? - TerraformResourceTypes.unknown; + // Sets the resourceType, e.g., 'resource "helm_release" "test_release"' -> helm_release + const resourceType = typeMatch?.groups?.type; + + const isKnownType = + resourceType && + Object.keys(TerraformResourceTypes).some((key) => { + return TerraformResourceTypes[key].includes(resourceType); + }); + + managerData.resourceType = isKnownType + ? resourceType + : TerraformResourceTypes.unknown[0]; /** * Iterates over all lines of the resource to extract the relevant key value pairs, @@ -96,21 +104,19 @@ export function extractTerraformResource( export function analyseTerraformResource( dep: PackageDependency ): void { - // istanbul ignore if: should tested? - if (!dep.managerData) { - return; - } - switch (dep.managerData.resourceType) { - case TerraformResourceTypes.docker_container: + switch (dep.managerData?.resourceType) { + case TerraformResourceTypes.generic_image_resource.find( + (key) => key === dep.managerData?.resourceType + ): if (dep.managerData.image) { applyDockerDependency(dep, dep.managerData.image); - dep.depType = 'docker_container'; + dep.depType = dep.managerData.resourceType; } else { dep.skipReason = 'invalid-dependency-specification'; } break; - case TerraformResourceTypes.docker_image: + case TerraformResourceTypes.docker_image[0]: if (dep.managerData.name) { applyDockerDependency(dep, dep.managerData.name); dep.depType = 'docker_image'; @@ -119,16 +125,7 @@ export function analyseTerraformResource( } break; - case TerraformResourceTypes.docker_service: - if (dep.managerData.image) { - applyDockerDependency(dep, dep.managerData.image); - dep.depType = 'docker_service'; - } else { - dep.skipReason = 'invalid-dependency-specification'; - } - break; - - case TerraformResourceTypes.helm_release: + case TerraformResourceTypes.helm_release[0]: if (!dep.managerData.chart) { dep.skipReason = 'invalid-name'; } else if (checkIfStringIsPath(dep.managerData.chart)) { @@ -141,7 +138,7 @@ export function analyseTerraformResource( dep.datasource = HelmDatasource.id; break; - case TerraformResourceTypes.tfe_workspace: + case TerraformResourceTypes.tfe_workspace[0]: if (dep.currentValue) { analyseTerraformVersion(dep); dep.depType = 'tfe_workspace'; diff --git a/lib/modules/manager/terraform/types.ts b/lib/modules/manager/terraform/types.ts index 584ac9f08d294e..bfe592b1c50892 100644 --- a/lib/modules/manager/terraform/types.ts +++ b/lib/modules/manager/terraform/types.ts @@ -1,8 +1,5 @@ import type { PackageDependency } from '../types'; -import type { - TerraformDependencyTypes, - TerraformResourceTypes, -} from './common'; +import type { TerraformDependencyTypes } from './common'; export interface ExtractionResult { lineNumber: number; @@ -17,7 +14,7 @@ export interface TerraformManagerData { } export interface ResourceManagerData extends TerraformManagerData { - resourceType?: TerraformResourceTypes; + resourceType?: string; chart?: string; image?: string; name?: string; From 445caa7a1ade9e5f9ef0903fcf08e3cce59a8df2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 14 Jun 2022 20:52:03 +0000 Subject: [PATCH 108/240] chore(deps): update dependency @types/node to v16.11.39 (#16076) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index a088ea4908b879..7f9c1c8f76c80f 100644 --- a/package.json +++ b/package.json @@ -247,7 +247,7 @@ "@types/marshal": "0.5.1", "@types/moo": "0.5.5", "@types/nock": "10.0.3", - "@types/node": "16.11.38", + "@types/node": "16.11.39", "@types/parse-link-header": "2.0.0", "@types/semver": "7.3.9", "@types/semver-stable": "3.0.0", diff --git a/yarn.lock b/yarn.lock index 60b6ea12188517..83ddefa81a8847 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2617,10 +2617,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.42.tgz#d7e8f22700efc94d125103075c074396b5f41f9b" integrity sha512-Q5BPGyGKcvQgAMbsr7qEGN/kIPN6zZecYYABeTDBizOsau+2NMdSVTar9UQw21A2+JyA2KRNDYaYrPB0Rpk2oQ== -"@types/node@16.11.38": - version "16.11.38" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.38.tgz#be0edd097b23eace6c471c525a74b3f98803017f" - integrity sha512-hjO/0K140An3GWDw2HJfq7gko3wWeznbjXgg+rzPdVzhe198hp4x2i1dgveAOEiFKd8sOilAxzoSJiVv5P/CUg== +"@types/node@16.11.39": + version "16.11.39" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.39.tgz#07223cd2bc332ad9d92135e3a522eebdee3b060e" + integrity sha512-K0MsdV42vPwm9L6UwhIxMAOmcvH/1OoVkZyCgEtVu4Wx7sElGloy/W7kMBNe/oJ7V/jW9BVt1F6RahH6e7tPXw== "@types/node@^13.7.0": version "13.13.52" From b52e765a8bd9e085b12561a4177fb45e3a3a3e5c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 14 Jun 2022 21:04:58 +0000 Subject: [PATCH 109/240] chore(deps): update node.js to 955d6ad (#16075) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .devcontainer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index c8eac0f02a213e..75332cb8f8d5ca 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM containerbase/node:14.19.3@sha256:912d9dbdbe0f5f9f0b9eb591d9ff0eef0292726b1c50757ef9c30bded6ac14c0 +FROM containerbase/node:14.19.3@sha256:955d6ad675a7d06aca889eab947917573285fc781ea843cec5e0bffd38c7fb11 USER root From cc9112a998050518810104aa9e26b7e8f4ba21bf Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 15 Jun 2022 02:40:47 +0000 Subject: [PATCH 110/240] chore(deps): update dependency yarn to v1.22.19 (#16077) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .devcontainer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 75332cb8f8d5ca..62f5a96865a2c4 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -3,4 +3,4 @@ FROM containerbase/node:14.19.3@sha256:955d6ad675a7d06aca889eab947917573285fc781 USER root # renovate: datasource=npm -RUN install-tool yarn 1.22.18 +RUN install-tool yarn 1.22.19 From 87f85951a20b60c1aaf2242e2bfb097cb3ac2fde Mon Sep 17 00:00:00 2001 From: RahulGautamSingh Date: Wed, 15 Jun 2022 09:51:37 +0530 Subject: [PATCH 111/240] refactor: move update internal deps to lookup (#16059) --- lib/workers/repository/extract/index.spec.ts | 24 ----------- lib/workers/repository/extract/index.ts | 8 ---- lib/workers/repository/process/fetch.spec.ts | 45 ++++++++++++++++++++ lib/workers/repository/process/fetch.ts | 3 ++ 4 files changed, 48 insertions(+), 32 deletions(-) diff --git a/lib/workers/repository/extract/index.spec.ts b/lib/workers/repository/extract/index.spec.ts index 91e7bdfe04fe4e..8ede75b44ee10f 100644 --- a/lib/workers/repository/extract/index.spec.ts +++ b/lib/workers/repository/extract/index.spec.ts @@ -46,30 +46,6 @@ describe('workers/repository/extract/index', () => { expect(await extractAllDependencies(config)).toEqual({}); }); - it('adds skipReason to internal deps when updateInternalDeps is false/undefined', async () => { - config.enabledManagers = ['npm']; - managerFiles.getManagerPackageFiles.mockResolvedValue([ - { - deps: [{ depName: 'a', isInternal: true }, { depName: 'b' }], - }, - ]); - expect(await extractAllDependencies(config)).toEqual({ - npm: [ - { - deps: [ - { - depName: 'a', - isInternal: true, - skipReason: 'internal-package', - }, - { depName: 'b' }, - ], - }, - ], - }); - expect(logger.debug).toHaveBeenCalled(); - }); - it('checks custom managers', async () => { managerFiles.getManagerPackageFiles.mockResolvedValue([{} as never]); config.regexManagers = [{ fileMatch: ['README'], matchStrings: [''] }]; diff --git a/lib/workers/repository/extract/index.ts b/lib/workers/repository/extract/index.ts index f24010ba9d3c53..11e228e8466b9d 100644 --- a/lib/workers/repository/extract/index.ts +++ b/lib/workers/repository/extract/index.ts @@ -48,14 +48,6 @@ export async function extractAllDependencies( const extractResults = await Promise.all( extractList.map(async (managerConfig) => { const packageFiles = await getManagerPackageFiles(managerConfig); - for (const p of packageFiles ?? []) { - for (const dep of p.deps ?? []) { - if (!config.updateInternalDeps && dep.isInternal) { - dep.skipReason = 'internal-package'; - } - } - } - return { manager: managerConfig.manager, packageFiles }; }) ); diff --git a/lib/workers/repository/process/fetch.spec.ts b/lib/workers/repository/process/fetch.spec.ts index cde26cb0f3d793..4c85f5d86e007e 100644 --- a/lib/workers/repository/process/fetch.spec.ts +++ b/lib/workers/repository/process/fetch.spec.ts @@ -96,5 +96,50 @@ describe('workers/repository/process/fetch', () => { expect(packageFiles.docker[0].deps[5].skipReason).toBe('invalid-name'); expect(packageFiles.docker[0].deps[6].skipReason).toBe('invalid-name'); }); + + it('skips internal deps by default', async () => { + const packageFiles: Record = { + docker: [ + { + packageFile: 'values.yaml', + deps: [ + { + depName: 'dep-name', + currentValue: '2.8.11', + datasource: 'docker', + isInternal: true, + }, + ], + }, + ], + }; + await fetchUpdates(config, packageFiles); + expect(packageFiles.docker[0].deps[0].skipReason).toBe( + 'internal-package' + ); + expect(packageFiles.docker[0].deps[0].updates).toHaveLength(0); + }); + + it('fetch updates for internal deps if updateInternalDeps is true', async () => { + config.updateInternalDeps = true; + config.rangeStrategy = 'auto'; + const packageFiles: any = { + maven: [ + { + packageFile: 'pom.xml', + deps: [ + { + datasource: MavenDatasource.id, + depName: 'bbb', + isInternal: true, + }, + ], + }, + ], + }; + lookupUpdates.mockResolvedValue({ updates: ['a', 'b'] } as never); + await fetchUpdates(config, packageFiles); + expect(packageFiles.maven[0].deps[0].updates).toHaveLength(2); + }); }); }); diff --git a/lib/workers/repository/process/fetch.ts b/lib/workers/repository/process/fetch.ts index 4b6324a4d93c5b..2c5fc00604432a 100644 --- a/lib/workers/repository/process/fetch.ts +++ b/lib/workers/repository/process/fetch.ts @@ -26,6 +26,9 @@ async function fetchDepUpdates( if (!is.nonEmptyString(dep.depName)) { dep.skipReason = 'invalid-name'; } + if (dep.isInternal && !packageFileConfig.updateInternalDeps) { + dep.skipReason = 'internal-package'; + } if (dep.skipReason) { return dep; } From 9fd3db728043a8da054187356dc4ec00cf1c27ed Mon Sep 17 00:00:00 2001 From: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Date: Wed, 15 Jun 2022 13:48:25 +0200 Subject: [PATCH 112/240] docs(docker): rewrite sections (#16083) --- docs/usage/docker.md | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/docs/usage/docker.md b/docs/usage/docker.md index db3ff4e93d3c75..ef345f1fe1843d 100644 --- a/docs/usage/docker.md +++ b/docs/usage/docker.md @@ -75,43 +75,42 @@ See the docs for `versioning` for documentation and examples of `regex` versioni ## Digest Pinning We recommend that you pin your Docker images to an exact digest. -By pinning to a digest you ensure your Docker builds are **immutable**: every time you do a `pull` you get the same content. +By pinning to a digest you make your Docker builds immutable, every time you do a `pull` you get the same content. -If you have experience with the way dependency versioning is handled in the JavaScript/npm ecosystem, you might be used to exact versions being immutable. -e.g. if you specify a version like `2.0.1`, you and your colleagues always get the exact same "code". +If you work with dependencies in the JavaScript/npm ecosystem, you may be used to exact versions being immutable. +For example, if you set a version like `2.0.1`, you and your colleagues always get the exact same "code". -What you may not know is that Docker's tags are not immutable versions, even if they look like a version. -e.g. you probably expect `myimage:1` and `myimage:1.2` to change over time, but you might incorrectly assume that `myimage:1.2.0` never changes. +Docker's tags are not immutable versions, even if tags _look_ like a version. +You probably expect `myimage:1` and `myimage:1.2` to change over time, but you might incorrectly assume that `myimage:1.2.0` never changes. Although it probably _shouldn't_, the reality is that any Docker image tag _can_ change content, and potentially break. -Using a Docker digest as the image's primary identifier instead of using a Docker tag will achieve immutability. -It's not easy to work with strings like `FROM node@sha256:d938c1761e3afbae9242848ffbb95b9cc1cb0a24d889f8bd955204d347a7266e`. +By replacing Docker tags with Docker digests as the image's primary identifier you'll get immutable builds. +It's hard to work with strings like `FROM node@sha256:d938c1761e3afbae9242848ffbb95b9cc1cb0a24d889f8bd955204d347a7266e`. Luckily Renovate can update the digests for you, so you don't have to. -To keep things simple, Renovate retains the Docker tag in the `FROM` line, e.g. `FROM node:14.15.1@sha256:d938c1761e3afbae9242848ffbb95b9cc1cb0a24d889f8bd955204d347a7266e`. -Read on to see how Renovate updates Docker digests. +To keep things simple, Renovate keeps the Docker tag in the `FROM` line, like this: `FROM node:14.15.1@sha256:d938c1761e3afbae9242848ffbb95b9cc1cb0a24d889f8bd955204d347a7266e`. ## Digest Updating -If you follow our advice to go from a simple tag like `node:14` to using a pinned digest `node:14@sha256:d938c1761e3afbae9242848ffbb95b9cc1cb0a24d889f8bd955204d347a7266e`, you will get Renovate PRs whenever the `node:14` image is updated on Docker Hub. +If you follow our advice to replace a simple tag like `node:14` with a pinned digest `node:14@sha256:d938c1761e3afbae9242848ffbb95b9cc1cb0a24d889f8bd955204d347a7266e`, you will get Renovate PRs whenever the `node:14` image is updated on Docker Hub. -Previously this update would have been "invisible" to you - one day you pull code that represents `node:14.15.0` and the next day you get code that represents `node:14.15.1`. +Previously this update would have been "invisible" to you - one day you pull code that represents `node:14.15.0` and the next day you pull code that represents `node:14.15.1`. But you can never be sure, especially as Docker caches. -Perhaps some of your colleagues or worse still your build machine are stuck on an older version with a security vulnerability. +Maybe some of your colleagues, or worse still your build machine, are stuck on an older version with a security vulnerability. By pinning to a digest instead, you will get these updates via Pull Requests, or even committed directly to your repository if you enable branch automerge for convenience. -This ensures everyone on the team uses the latest versions and is in sync. +This makes sure everyone on your team uses the latest versions. ## Version Upgrading Renovate also supports _upgrading_ versions in Docker tags, e.g. from `myimage:1.2.0` to `myimage:1.2.1` or `myimage:1.2` to `myimage:1.3`. If a tag looks like a version, Renovate will upgrade it like a version. -We recommend you use the major.minor.patch tagging scheme e.g. change from `myimage:1` to `myimage:1.1.1`. +We recommend you use the major.minor.patch tagging scheme, e.g. change from `myimage:1` to `myimage:1.1.1`. This way it's easy to see what the Renovate PR is going to change. -You can see the difference between a PR that upgrades `myimage` from `1.1.1` to `1.1.2`. and a PR that changes the contents of the version you already use (`1.1.1`). +You can see the difference between a PR that upgrades `myimage` from `1.1.1` to `1.1.2` and a PR that changes the contents of the version you already use (`1.1.1`). -Currently, Renovate will upgrade minor/patch versions (e.g. from `1.2.0` to `1.2.1`) by default, but not upgrade major versions. +By default, Renovate will upgrade minor/patch versions (like from `1.2.0` to `1.2.1`), but not upgrade major versions. If you wish to enable major versions then add the preset `docker:enableMajor` to your `extends` array in your `renovate.json`. Renovate has some Docker-specific intelligence when it comes to versions. From b7c6126d92e98e20507d85ff78c6ae5b6deb67c8 Mon Sep 17 00:00:00 2001 From: Gabriel-Ladzaretti <97394622+Gabriel-Ladzaretti@users.noreply.github.com> Date: Wed, 15 Jun 2022 18:04:23 +0300 Subject: [PATCH 113/240] docs: add whitespaces around items with multiple allowed values (#16085) --- tools/docs/config.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/docs/config.ts b/tools/docs/config.ts index e98328eb9fe3b0..7a2a412424bc46 100644 --- a/tools/docs/config.ts +++ b/tools/docs/config.ts @@ -141,6 +141,14 @@ function genTable(obj: [string, string][], type: string, def: any): string { return buildHtmlTable(data); } +function stringifyArrays(el: Record): void { + for (const [key, value] of Object.entries(el)) { + if (key !== 'default' && Array.isArray(value)) { + el[key] = value.join(', '); + } + } +} + export async function generateConfig(dist: string, bot = false): Promise { let configFile = `configuration-options.md`; if (bot) { @@ -162,6 +170,7 @@ export async function generateConfig(dist: string, bot = false): Promise { } el.cli = getCliName(option); el.env = getEnvName(option); + stringifyArrays(el); configOptionsRaw[headerIndex] += `\n${option.description}\n\n` + From b72534d20c840f48abe8c82e9b0a4fb2decb44d8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 15 Jun 2022 15:48:35 +0000 Subject: [PATCH 114/240] build(deps): update dependency @renovatebot/pep440 to v2.1.3 (#16090) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 7f9c1c8f76c80f..b82c2da29e5d89 100644 --- a/package.json +++ b/package.json @@ -139,7 +139,7 @@ "@cheap-glitch/mi-cron": "1.0.1", "@iarna/toml": "2.2.5", "@jamiemagee/osv-offline": "1.2.7", - "@renovatebot/pep440": "2.1.2", + "@renovatebot/pep440": "2.1.3", "@renovatebot/ruby-semver": "1.1.4", "@sindresorhus/is": "4.6.0", "@yarnpkg/core": "3.1.0", diff --git a/yarn.lock b/yarn.lock index 83ddefa81a8847..159c4fc51ae656 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2061,10 +2061,10 @@ uid "0c444386e79d6145901212507521b8a0a48af000" resolved "https://github.com/renovatebot/eslint-plugin#0c444386e79d6145901212507521b8a0a48af000" -"@renovatebot/pep440@2.1.2": - version "2.1.2" - resolved "https://registry.yarnpkg.com/@renovatebot/pep440/-/pep440-2.1.2.tgz#2daf92c1f3641d38698a594ebbc6749a890c9ec6" - integrity sha512-5E61yI69foKY0hxoYWabUZLYras9S3Mrzrz7bhf4W5pKVZJse1ypNUjKW5bsiSQoAiZqXFECiD0q1Nw8LA3gyQ== +"@renovatebot/pep440@2.1.3": + version "2.1.3" + resolved "https://registry.yarnpkg.com/@renovatebot/pep440/-/pep440-2.1.3.tgz#9845809ab50f98f08c2914c7ab50b0931e43968d" + integrity sha512-ZCBEyZ19sA/Anp/Ke74Kdn7aL06T7v1RL15wzKDJrLuScZrpgZ6eMFQKY4vgTzSikXShlox73NGF8qHJ+z+7Gw== "@renovatebot/ruby-semver@1.1.4": version "1.1.4" From 40c50479d7514eb2966f026f5dda3cf215463238 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 15 Jun 2022 16:02:06 +0000 Subject: [PATCH 115/240] build(deps): update dependency openpgp to v5.3.0 (#16091) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index b82c2da29e5d89..80ca5403fb5a2f 100644 --- a/package.json +++ b/package.json @@ -190,7 +190,7 @@ "moo": "0.5.1", "nanoid": "3.3.4", "node-html-parser": "5.3.3", - "openpgp": "5.2.1", + "openpgp": "5.3.0", "p-all": "3.0.0", "p-map": "4.0.0", "p-queue": "6.6.2", diff --git a/yarn.lock b/yarn.lock index 159c4fc51ae656..c8200d83c07d6b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7781,10 +7781,10 @@ opener@^1.5.2: resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.2.tgz#5d37e1f35077b9dcac4301372271afdeb2a13598" integrity sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A== -openpgp@5.2.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/openpgp/-/openpgp-5.2.1.tgz#cc48b25eb7d1b4613a167c9e6def8717eea53429" - integrity sha512-zvu63kxe70q3D6WlKC/TB2pzI59I8V/l4G+z/VYgNVOyARsoH9q4i/WqwoHPjWG5HnRjhII3WSvp3gXH2DMPVg== +openpgp@5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/openpgp/-/openpgp-5.3.0.tgz#e8fc97e538865b8c095dbd91c7be4203bd1dd1df" + integrity sha512-qjCj0vYpV3dmmkE+vURiJ5kVAJwrMk8BPukvpWJiHcTNWKwPVsRS810plIe4klIcHVf1ScgUQwqtBbv99ff+kQ== dependencies: asn1.js "^5.0.0" From 0c76f701d67fafeba297db1d8bc95cda1a435b72 Mon Sep 17 00:00:00 2001 From: Justin Waite Date: Wed, 15 Jun 2022 14:02:33 -0600 Subject: [PATCH 116/240] feat(preset): add remix monorepo (#16092) feat(preset): add monorepo location for remix framework --- lib/config/presets/internal/monorepo.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/config/presets/internal/monorepo.ts b/lib/config/presets/internal/monorepo.ts index b2606b085ca6ae..dd031570f8492e 100644 --- a/lib/config/presets/internal/monorepo.ts +++ b/lib/config/presets/internal/monorepo.ts @@ -187,6 +187,7 @@ const repoGroups = { reakit: 'https://github.com/reakit/reakit', redwood: 'https://github.com/redwoodjs/redwood', remark: 'https://github.com/remarkjs/remark', + remix: 'https://github.com/remix-run/remix', router5: 'https://github.com/router5/router5', 'rust-futures': 'https://github.com/rust-lang/futures-rs', 'rust-wasm-bindgen': 'https://github.com/rustwasm/wasm-bindgen', From 26a4d482a6834315cffedc2d46ecbeb7621bae62 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 15 Jun 2022 21:35:15 +0000 Subject: [PATCH 117/240] chore(deps): update dependency @types/eslint to v8.4.3 (#16095) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 80ca5403fb5a2f..162f144fed6540 100644 --- a/package.json +++ b/package.json @@ -231,7 +231,7 @@ "@types/clean-git-ref": "2.0.0", "@types/conventional-commits-detector": "1.0.0", "@types/diff": "5.0.2", - "@types/eslint": "8.4.2", + "@types/eslint": "8.4.3", "@types/fs-extra": "9.0.13", "@types/git-url-parse": "9.0.1", "@types/github-url-from-git": "1.5.1", diff --git a/yarn.lock b/yarn.lock index c8200d83c07d6b..1b862382955441 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2424,10 +2424,10 @@ resolved "https://registry.yarnpkg.com/@types/emscripten/-/emscripten-1.39.6.tgz#698b90fe60d44acf93c31064218fbea93fbfd85a" integrity sha512-H90aoynNhhkQP6DRweEjJp5vfUVdIj7tdPLsu7pq89vODD/lcugKfZOsfgwpvM6XUewEp2N5dCg1Uf3Qe55Dcg== -"@types/eslint@8.4.2": - version "8.4.2" - resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.4.2.tgz#48f2ac58ab9c631cb68845c3d956b28f79fad575" - integrity sha512-Z1nseZON+GEnFjJc04sv4NSALGjhFwy6K0HXt7qsn5ArfAKtb63dXNJHf+1YW6IpOIYRBGUbu3GwJdj8DGnCjA== +"@types/eslint@8.4.3": + version "8.4.3" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.4.3.tgz#5c92815a3838b1985c90034cd85f26f59d9d0ece" + integrity sha512-YP1S7YJRMPs+7KZKDb9G63n8YejIwW9BALq7a5j2+H4yl6iOv9CB29edho+cuFRrvmJbbaH2yiVChKLJVysDGw== dependencies: "@types/estree" "*" "@types/json-schema" "*" From f19eb5b841c0643705b6316a615b05ffa08c77fc Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Thu, 16 Jun 2022 09:42:23 +0300 Subject: [PATCH 118/240] fix(github): Don't append `/api/v3/` to the endpoint twice (#16097) * fix(github): Don't attach `/api/v3/` to the endpoint twice * Add test * More correct replacing --- .../github-releases/cache/cache-base.ts | 2 +- .../datasource/github-releases/common.spec.ts | 8 ++++++-- lib/modules/datasource/github-releases/common.ts | 16 +++++++++++++--- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/lib/modules/datasource/github-releases/cache/cache-base.ts b/lib/modules/datasource/github-releases/cache/cache-base.ts index 11b2797a8d4c5d..90c80a18ea3ac7 100644 --- a/lib/modules/datasource/github-releases/cache/cache-base.ts +++ b/lib/modules/datasource/github-releases/cache/cache-base.ts @@ -181,7 +181,7 @@ export abstract class AbstractGithubDatasourceCache< // so that soft update mechanics is immediately starting. let cacheUpdatedAt = now.minus(this.updateDuration).toISO(); - const baseUrl = getApiBaseUrl(registryUrl).replace('/v3/', '/'); // Replace for GHE + const baseUrl = getApiBaseUrl(registryUrl).replace(/\/v3\/$/, '/'); // Replace for GHE const [owner, name] = packageName.split('/'); if (owner && name) { diff --git a/lib/modules/datasource/github-releases/common.spec.ts b/lib/modules/datasource/github-releases/common.spec.ts index e386f33750a804..ebcaffcbbf9bd9 100644 --- a/lib/modules/datasource/github-releases/common.spec.ts +++ b/lib/modules/datasource/github-releases/common.spec.ts @@ -20,8 +20,12 @@ describe('modules/datasource/github-releases/common', () => { }); it('supports local github installations', () => { - const apiUrl = getApiBaseUrl('https://gh.my-company.com/'); - expect(apiUrl).toBe('https://gh.my-company.com/api/v3/'); + expect(getApiBaseUrl('https://gh.my-company.com/')).toBe( + 'https://gh.my-company.com/api/v3/' + ); + expect(getApiBaseUrl('https://gh.my-company.com/api/v3/')).toBe( + 'https://gh.my-company.com/api/v3/' + ); }); }); }); diff --git a/lib/modules/datasource/github-releases/common.ts b/lib/modules/datasource/github-releases/common.ts index 638ebdeff5f7a1..58969644bda5ef 100644 --- a/lib/modules/datasource/github-releases/common.ts +++ b/lib/modules/datasource/github-releases/common.ts @@ -10,9 +10,19 @@ export function getSourceUrlBase(registryUrl: string | undefined): string { export function getApiBaseUrl(registryUrl: string | undefined): string { const sourceUrlBase = getSourceUrlBase(registryUrl); - return [defaultSourceUrlBase, defaultApiBaseUrl].includes(sourceUrlBase) - ? defaultApiBaseUrl - : `${sourceUrlBase}api/v3/`; + + if ( + sourceUrlBase === defaultSourceUrlBase || + sourceUrlBase === defaultApiBaseUrl + ) { + return defaultApiBaseUrl; + } + + if (sourceUrlBase.endsWith('/api/v3/')) { + return sourceUrlBase; + } + + return `${sourceUrlBase}api/v3/`; } export function getSourceUrl( From 70084a61ef43a8d927b30b99577dd26ae40950d3 Mon Sep 17 00:00:00 2001 From: Maron <98313426+MaronHatoum@users.noreply.github.com> Date: Thu, 16 Jun 2022 10:47:16 +0300 Subject: [PATCH 119/240] refactor: move error-warning.ts (#16098) --- .../{onboarding/pr => }/errors-warnings.spec.ts | 6 +++--- .../repository/{onboarding/pr => }/errors-warnings.ts | 8 ++++---- lib/workers/repository/onboarding/pr/index.ts | 2 +- tsconfig.strict.json | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) rename lib/workers/repository/{onboarding/pr => }/errors-warnings.spec.ts (92%) rename lib/workers/repository/{onboarding/pr => }/errors-warnings.ts (91%) diff --git a/lib/workers/repository/onboarding/pr/errors-warnings.spec.ts b/lib/workers/repository/errors-warnings.spec.ts similarity index 92% rename from lib/workers/repository/onboarding/pr/errors-warnings.spec.ts rename to lib/workers/repository/errors-warnings.spec.ts index 00fa9a892415d6..b316427391e176 100644 --- a/lib/workers/repository/onboarding/pr/errors-warnings.spec.ts +++ b/lib/workers/repository/errors-warnings.spec.ts @@ -1,8 +1,8 @@ -import { RenovateConfig, getConfig } from '../../../../../test/util'; -import type { PackageFile } from '../../../../modules/manager/types'; +import { RenovateConfig, getConfig } from '../../../test/util'; +import type { PackageFile } from '../../modules/manager/types'; import { getDepWarnings, getErrors, getWarnings } from './errors-warnings'; -describe('workers/repository/onboarding/pr/errors-warnings', () => { +describe('workers/repository/errors-warnings', () => { describe('getWarnings()', () => { let config: RenovateConfig; diff --git a/lib/workers/repository/onboarding/pr/errors-warnings.ts b/lib/workers/repository/errors-warnings.ts similarity index 91% rename from lib/workers/repository/onboarding/pr/errors-warnings.ts rename to lib/workers/repository/errors-warnings.ts index f87ed62e1567bd..056a50b624c816 100644 --- a/lib/workers/repository/onboarding/pr/errors-warnings.ts +++ b/lib/workers/repository/errors-warnings.ts @@ -1,7 +1,7 @@ -import type { RenovateConfig } from '../../../../config/types'; -import { logger } from '../../../../logger'; -import type { PackageFile } from '../../../../modules/manager/types'; -import { emojify } from '../../../../util/emoji'; +import type { RenovateConfig } from '../../config/types'; +import { logger } from '../../logger'; +import type { PackageFile } from '../../modules/manager/types'; +import { emojify } from '../../util/emoji'; export function getWarnings(config: RenovateConfig): string { if (!config.warnings.length) { diff --git a/lib/workers/repository/onboarding/pr/index.ts b/lib/workers/repository/onboarding/pr/index.ts index 8952bf5936e466..dc3c6a5302c66f 100644 --- a/lib/workers/repository/onboarding/pr/index.ts +++ b/lib/workers/repository/onboarding/pr/index.ts @@ -13,12 +13,12 @@ import { } from '../../../../util/git'; import * as template from '../../../../util/template'; import type { BranchConfig } from '../../../types'; +import { getDepWarnings, getErrors, getWarnings } from '../../errors-warnings'; import { getPlatformPrOptions } from '../../update/pr'; import { prepareLabels } from '../../update/pr/labels'; import { addParticipants } from '../../update/pr/participants'; import { getBaseBranchDesc } from './base-branch'; import { getConfigDesc } from './config-description'; -import { getDepWarnings, getErrors, getWarnings } from './errors-warnings'; import { getPrList } from './pr-list'; export async function ensureOnboardingPr( diff --git a/tsconfig.strict.json b/tsconfig.strict.json index 245cf31cc54808..2516c1b9392735 100644 --- a/tsconfig.strict.json +++ b/tsconfig.strict.json @@ -48,7 +48,7 @@ "lib/workers/repository/onboarding/branch/rebase.ts", "lib/workers/repository/onboarding/pr/base-branch.ts", "lib/workers/repository/onboarding/pr/config-description.ts", - "lib/workers/repository/onboarding/pr/errors-warnings.ts", + "lib/workers/repository/errors-warnings.ts", "lib/workers/repository/onboarding/pr/index.ts", "lib/workers/repository/onboarding/pr/pr-list.ts", "lib/workers/repository/process/deprecated.ts", From 9e28ef32752536501af3fbff8a63ccbe5343591c Mon Sep 17 00:00:00 2001 From: RahulGautamSingh Date: Thu, 16 Jun 2022 16:30:11 +0530 Subject: [PATCH 120/240] refactor: redefine defaultRegistryUrls (#15856) Co-authored-by: Rhys Arkins Co-authored-by: Michael Kriese --- lib/modules/datasource/datasource.ts | 2 +- lib/modules/datasource/index.spec.ts | 65 ++++++++++++++++++++++++++++ lib/modules/datasource/index.ts | 7 ++- lib/modules/datasource/types.ts | 2 +- 4 files changed, 73 insertions(+), 3 deletions(-) diff --git a/lib/modules/datasource/datasource.ts b/lib/modules/datasource/datasource.ts index eb9ffa1ce8e949..3d7fa807a3be69 100644 --- a/lib/modules/datasource/datasource.ts +++ b/lib/modules/datasource/datasource.ts @@ -19,7 +19,7 @@ export abstract class Datasource implements DatasourceApi { defaultConfig: Record | undefined; - defaultRegistryUrls: string[] | undefined; + defaultRegistryUrls?: string[] | (() => string[]); defaultVersioning: string | undefined; diff --git a/lib/modules/datasource/index.spec.ts b/lib/modules/datasource/index.spec.ts index c2054c683a693f..ace1cba910a42d 100644 --- a/lib/modules/datasource/index.spec.ts +++ b/lib/modules/datasource/index.spec.ts @@ -43,6 +43,47 @@ class DummyDatasource extends Datasource { } } +class DummyDatasource2 extends Datasource { + override defaultRegistryUrls = function () { + return ['https://reg1.com']; + }; + + constructor(private registriesMock: RegistriesMock = defaultRegistriesMock) { + super(datasource); + } + + override getReleases({ + registryUrl, + }: GetReleasesConfig): Promise { + const fn = this.registriesMock[registryUrl]; + if (typeof fn === 'function') { + return Promise.resolve(fn()); + } + return Promise.resolve(fn ?? null); + } +} + +class DummyDatasource3 extends Datasource { + override customRegistrySupport = false; + override defaultRegistryUrls = function () { + return ['https://reg1.com']; + }; + + constructor(private registriesMock: RegistriesMock = defaultRegistriesMock) { + super(datasource); + } + + override getReleases({ + registryUrl, + }: GetReleasesConfig): Promise { + const fn = this.registriesMock[registryUrl]; + if (typeof fn === 'function') { + return Promise.resolve(fn()); + } + return Promise.resolve(fn ?? null); + } +} + jest.mock('./metadata-manual', () => ({ manualChangelogUrls: { dummy: { @@ -212,6 +253,30 @@ describe('modules/datasource/index', () => { expect(res).toMatchObject({ releases: [{ version: '0.0.1' }] }); }); + it('defaultRegistryUrls function works', async () => { + datasources.set(datasource, new DummyDatasource2()); + const res = await getPkgReleases({ + datasource, + depName, + }); + expect(res).toMatchObject({ + releases: [{ version: '1.2.3' }], + registryUrl: 'https://reg1.com', + }); + }); + + it('defaultRegistryUrls function with customRegistrySupport works', async () => { + datasources.set(datasource, new DummyDatasource3()); + const res = await getPkgReleases({ + datasource, + depName, + }); + expect(res).toMatchObject({ + releases: [{ version: '1.2.3' }], + registryUrl: 'https://reg1.com', + }); + }); + it('applies extractVersion', async () => { const registries: RegistriesMock = { 'https://reg1.com': { diff --git a/lib/modules/datasource/index.ts b/lib/modules/datasource/index.ts index b55b1c2e1a76dd..ece88626ad2201 100644 --- a/lib/modules/datasource/index.ts +++ b/lib/modules/datasource/index.ts @@ -209,7 +209,9 @@ function resolveRegistryUrls( 'Custom registries are not allowed for this datasource and will be ignored' ); } - return datasource.defaultRegistryUrls ?? []; + return is.function_(datasource.defaultRegistryUrls) + ? datasource.defaultRegistryUrls() + : datasource.defaultRegistryUrls ?? []; } const customUrls = registryUrls?.filter(Boolean); let resolvedUrls: string[] = []; @@ -218,6 +220,9 @@ function resolveRegistryUrls( } else if (is.nonEmptyArray(defaultRegistryUrls)) { resolvedUrls = [...defaultRegistryUrls]; resolvedUrls.concat(additionalRegistryUrls ?? []); + } else if (is.function_(datasource.defaultRegistryUrls)) { + resolvedUrls = [...datasource.defaultRegistryUrls()]; + resolvedUrls.concat(additionalRegistryUrls ?? []); } else if (is.nonEmptyArray(datasource.defaultRegistryUrls)) { resolvedUrls = [...datasource.defaultRegistryUrls]; resolvedUrls.concat(additionalRegistryUrls ?? []); diff --git a/lib/modules/datasource/types.ts b/lib/modules/datasource/types.ts index be5e106ec04fd2..867c8829f11936 100644 --- a/lib/modules/datasource/types.ts +++ b/lib/modules/datasource/types.ts @@ -76,7 +76,7 @@ export interface DatasourceApi extends ModuleApi { id: string; getDigest?(config: DigestConfig, newValue?: string): Promise; getReleases(config: GetReleasesConfig): Promise; - defaultRegistryUrls?: string[]; + defaultRegistryUrls?: string[] | (() => string[]); defaultVersioning?: string; defaultConfig?: Record; From 33b5b9980d050e9a93d22aca500e2d7a08528d5e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 16 Jun 2022 15:01:02 +0200 Subject: [PATCH 121/240] chore(deps): update jest monorepo to v28 (major) (#16103) * chore(deps): update jest monorepo to v28 * chore: force v28 deps Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Michael Kriese --- package.json | 16 +- yarn.lock | 1253 +++++++++++++++++++------------------------------- 2 files changed, 490 insertions(+), 779 deletions(-) diff --git a/package.json b/package.json index 162f144fed6540..bedf90aa169d45 100644 --- a/package.json +++ b/package.json @@ -216,9 +216,9 @@ }, "devDependencies": { "@actions/core": "1.8.2", - "@jest/globals": "27.5.1", - "@jest/reporters": "27.5.1", - "@jest/test-result": "27.5.1", + "@jest/globals": "28.1.1", + "@jest/reporters": "28.1.1", + "@jest/test-result": "28.1.1", "@ls-lint/ls-lint": "1.11.2", "@openpgp/web-stream-tools": "0.0.10", "@renovate/eslint-plugin": "https://github.com/renovatebot/eslint-plugin#v0.0.4", @@ -237,7 +237,7 @@ "@types/github-url-from-git": "1.5.1", "@types/global-agent": "2.1.1", "@types/ini": "1.3.31", - "@types/jest": "27.5.2", + "@types/jest": "28.1.1", "@types/js-yaml": "4.0.5", "@types/json-dup-key-validator": "1.0.0", "@types/linkify-markdown": "1.0.1", @@ -278,7 +278,7 @@ "glob": "8.0.3", "graphql": "16.5.0", "husky": "8.0.1", - "jest": "27.5.1", + "jest": "28.1.1", "jest-extended": "2.0.0", "jest-github-actions-reporter": "1.0.3", "jest-junit": "13.2.0", @@ -297,14 +297,16 @@ "shelljs": "0.8.5", "strip-ansi": "6.0.1", "tmp-promise": "3.0.3", - "ts-jest": "27.1.5", + "ts-jest": "28.0.4", "ts-node": "10.8.1", "type-fest": "2.12.2", "typescript": "4.7.3", "unified": "9.2.2" }, "resolutions": { - "**/json-schema": "^0.4.0" + "**/json-schema": "^0.4.0", + "@types/jest/jest-matcher-utils": "^28.0.0", + "@types/jest/pretty-format": "^28.0.0" }, "files": [ "dist" diff --git a/yarn.lock b/yarn.lock index 1b862382955441..d48a9cb79c8b72 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1028,7 +1028,28 @@ resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.17.10.tgz#711dc726a492dfc8be8220028b1b92482362baab" integrity sha512-GZt/TCsG70Ms19gfZO1tM4CVnXsPgEPBCpJu+Qz3L0LUDsY5nZqFZglIoPC1kIYOtNBZlrnFT+klg12vFGZXrw== -"@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.7.2", "@babel/core@^7.8.0": +"@babel/core@^7.11.6": + version "7.18.5" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.18.5.tgz#c597fa680e58d571c28dda9827669c78cdd7f000" + integrity sha512-MGY8vg3DxMnctw0LdvSEojOsumc70g0t18gNyUdAZqB1Rpd1Bqo/svHGvt+UJ6JcGX+DIekGFDxxIWofBxLCnQ== + dependencies: + "@ampproject/remapping" "^2.1.0" + "@babel/code-frame" "^7.16.7" + "@babel/generator" "^7.18.2" + "@babel/helper-compilation-targets" "^7.18.2" + "@babel/helper-module-transforms" "^7.18.0" + "@babel/helpers" "^7.18.2" + "@babel/parser" "^7.18.5" + "@babel/template" "^7.16.7" + "@babel/traverse" "^7.18.5" + "@babel/types" "^7.18.4" + convert-source-map "^1.7.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.1" + semver "^6.3.0" + +"@babel/core@^7.12.3": version "7.18.2" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.18.2.tgz#87b2fcd7cce9becaa7f5acebdc4f09f3dd19d876" integrity sha512-A8pri1YJiC5UnkdrWcmfZTJTV85b4UXTAfImGmCfYmax4TR9Cw8sDS0MOk++Gp2mE/BefVJ5nwy5yzqNJbP/DQ== @@ -1161,6 +1182,11 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.18.4.tgz#6774231779dd700e0af29f6ad8d479582d7ce5ef" integrity sha512-FDge0dFazETFcxGw/EXzOkN8uJp0PC7Qbm+Pe9T+av2zlBpOgunFHkQPPn+eRuClU73JF+98D531UgayY89tow== +"@babel/parser@^7.18.5": + version "7.18.5" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.18.5.tgz#337062363436a893a2d22faa60be5bb37091c83c" + integrity sha512-YZWVaglMiplo7v8f1oMQ5ZPQr0vn7HPeZXxXWsxXJRjGVrzUFn9OxFQl1sb5wzfootjA/yChhW84BV+383FSOw== + "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" @@ -1277,7 +1303,23 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.16.7", "@babel/types@^7.17.0", "@babel/types@^7.18.0", "@babel/types@^7.18.2", "@babel/types@^7.3.0", "@babel/types@^7.3.3": +"@babel/traverse@^7.18.5": + version "7.18.5" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.18.5.tgz#94a8195ad9642801837988ab77f36e992d9a20cd" + integrity sha512-aKXj1KT66sBj0vVzk6rEeAO6Z9aiiQ68wfDgge3nHhA/my6xMM/7HGQUNumKZaoa2qUPQ5whJG9aAifsxUKfLA== + dependencies: + "@babel/code-frame" "^7.16.7" + "@babel/generator" "^7.18.2" + "@babel/helper-environment-visitor" "^7.18.2" + "@babel/helper-function-name" "^7.17.9" + "@babel/helper-hoist-variables" "^7.16.7" + "@babel/helper-split-export-declaration" "^7.16.7" + "@babel/parser" "^7.18.5" + "@babel/types" "^7.18.4" + debug "^4.1.0" + globals "^11.1.0" + +"@babel/types@^7.0.0", "@babel/types@^7.16.7", "@babel/types@^7.17.0", "@babel/types@^7.18.0", "@babel/types@^7.18.2", "@babel/types@^7.18.4", "@babel/types@^7.3.0", "@babel/types@^7.3.3": version "7.18.4" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.18.4.tgz#27eae9b9fd18e9dccc3f9d6ad051336f307be354" integrity sha512-ThN1mBcMq5pG/Vm2IcBmPPfyPXbd8S02rS+OBIDENdufvqC7Z/jHPCv9IcP01277aKtDI8g/2XysBN4hA8niiw== @@ -1401,61 +1443,62 @@ got "11.8.5" luxon "2.4.0" -"@jest/console@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.5.1.tgz#260fe7239602fe5130a94f1aa386eff54b014bba" - integrity sha512-kZ/tNpS3NXn0mlXXXPNuDZnb4c0oZ20r4K5eemM2k30ZC3G0T02nXUvyhf5YdbXWHPEJLc9qGLxEZ216MdL+Zg== +"@jest/console@^28.1.1": + version "28.1.1" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-28.1.1.tgz#305f8ca50b6e70413839f54c0e002b60a0f2fd7d" + integrity sha512-0RiUocPVFEm3WRMOStIHbRWllG6iW6E3/gUPnf4lkrVFyXIIDeCe+vlKeYyFOMhB2EPE6FLFCNADSOOQMaqvyA== dependencies: - "@jest/types" "^27.5.1" + "@jest/types" "^28.1.1" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^27.5.1" - jest-util "^27.5.1" + jest-message-util "^28.1.1" + jest-util "^28.1.1" slash "^3.0.0" -"@jest/core@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.5.1.tgz#267ac5f704e09dc52de2922cbf3af9edcd64b626" - integrity sha512-AK6/UTrvQD0Cd24NSqmIA6rKsu0tKIxfiCducZvqxYdmMisOYAsdItspT+fQDQYARPf8XgjAFZi0ogW2agH5nQ== - dependencies: - "@jest/console" "^27.5.1" - "@jest/reporters" "^27.5.1" - "@jest/test-result" "^27.5.1" - "@jest/transform" "^27.5.1" - "@jest/types" "^27.5.1" +"@jest/core@^28.1.1": + version "28.1.1" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-28.1.1.tgz#086830bec6267accf9af5ca76f794858e9f9f092" + integrity sha512-3pYsBoZZ42tXMdlcFeCc/0j9kOlK7MYuXs2B1QbvDgMoW1K9NJ4G/VYvIbMb26iqlkTfPHo7SC2JgjDOk/mxXw== + dependencies: + "@jest/console" "^28.1.1" + "@jest/reporters" "^28.1.1" + "@jest/test-result" "^28.1.1" + "@jest/transform" "^28.1.1" + "@jest/types" "^28.1.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - emittery "^0.8.1" + ci-info "^3.2.0" exit "^0.1.2" graceful-fs "^4.2.9" - jest-changed-files "^27.5.1" - jest-config "^27.5.1" - jest-haste-map "^27.5.1" - jest-message-util "^27.5.1" - jest-regex-util "^27.5.1" - jest-resolve "^27.5.1" - jest-resolve-dependencies "^27.5.1" - jest-runner "^27.5.1" - jest-runtime "^27.5.1" - jest-snapshot "^27.5.1" - jest-util "^27.5.1" - jest-validate "^27.5.1" - jest-watcher "^27.5.1" + jest-changed-files "^28.0.2" + jest-config "^28.1.1" + jest-haste-map "^28.1.1" + jest-message-util "^28.1.1" + jest-regex-util "^28.0.2" + jest-resolve "^28.1.1" + jest-resolve-dependencies "^28.1.1" + jest-runner "^28.1.1" + jest-runtime "^28.1.1" + jest-snapshot "^28.1.1" + jest-util "^28.1.1" + jest-validate "^28.1.1" + jest-watcher "^28.1.1" micromatch "^4.0.4" + pretty-format "^28.1.1" rimraf "^3.0.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.5.1.tgz#d7425820511fe7158abbecc010140c3fd3be9c74" - integrity sha512-/WQjhPJe3/ghaol/4Bq480JKXV/Rfw8nQdN7f41fM8VDHLcxKXou6QyXAh3EFr9/bVG3x74z1NWDkP87EiY8gA== +"@jest/environment@^28.1.1": + version "28.1.1" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-28.1.1.tgz#c4cbf85283278d768f816ebd1a258ea6f9e39d4f" + integrity sha512-9auVQ2GzQ7nrU+lAr8KyY838YahElTX9HVjbQPPS2XjlxQ+na18G113OoBhyBGBtD6ZnO/SrUy5WR8EzOj1/Uw== dependencies: - "@jest/fake-timers" "^27.5.1" - "@jest/types" "^27.5.1" + "@jest/fake-timers" "^28.1.1" + "@jest/types" "^28.1.1" "@types/node" "*" - jest-mock "^27.5.1" + jest-mock "^28.1.1" "@jest/expect-utils@28.1.0": version "28.1.0" @@ -1464,57 +1507,72 @@ dependencies: jest-get-type "^28.0.2" -"@jest/fake-timers@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.5.1.tgz#76979745ce0579c8a94a4678af7a748eda8ada74" - integrity sha512-/aPowoolwa07k7/oM3aASneNeBGCmGQsc3ugN4u6s4C/+s5M64MFo/+djTdiwcbQlRfFElGuDXWzaWj6QgKObQ== +"@jest/expect-utils@^28.1.1": + version "28.1.1" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-28.1.1.tgz#d84c346025b9f6f3886d02c48a6177e2b0360587" + integrity sha512-n/ghlvdhCdMI/hTcnn4qV57kQuV9OTsZzH1TTCVARANKhl6hXJqLKUkwX69ftMGpsbpt96SsDD8n8LD2d9+FRw== + dependencies: + jest-get-type "^28.0.2" + +"@jest/expect@^28.1.1": + version "28.1.1" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-28.1.1.tgz#ea4fcc8504b45835029221c0dc357c622a761326" + integrity sha512-/+tQprrFoT6lfkMj4mW/mUIfAmmk/+iQPmg7mLDIFOf2lyf7EBHaS+x3RbeR0VZVMe55IvX7QRoT/2aK3AuUXg== + dependencies: + expect "^28.1.1" + jest-snapshot "^28.1.1" + +"@jest/fake-timers@^28.1.1": + version "28.1.1" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-28.1.1.tgz#47ce33296ab9d680c76076d51ddbe65ceb3337f1" + integrity sha512-BY/3+TyLs5+q87rGWrGUY5f8e8uC3LsVHS9Diz8+FV3ARXL4sNnkLlIB8dvDvRrp+LUCGM+DLqlsYubizGUjIA== dependencies: - "@jest/types" "^27.5.1" - "@sinonjs/fake-timers" "^8.0.1" + "@jest/types" "^28.1.1" + "@sinonjs/fake-timers" "^9.1.1" "@types/node" "*" - jest-message-util "^27.5.1" - jest-mock "^27.5.1" - jest-util "^27.5.1" + jest-message-util "^28.1.1" + jest-mock "^28.1.1" + jest-util "^28.1.1" -"@jest/globals@27.5.1", "@jest/globals@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.5.1.tgz#7ac06ce57ab966566c7963431cef458434601b2b" - integrity sha512-ZEJNB41OBQQgGzgyInAv0UUfDDj3upmHydjieSxFvTRuZElrx7tXg/uVQ5hYVEwiXs3+aMsAeEc9X7xiSKCm4Q== +"@jest/globals@28.1.1", "@jest/globals@^28.1.1": + version "28.1.1" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-28.1.1.tgz#c0a7977f85e26279cc090d9adcdf82b8a34c4061" + integrity sha512-dEgl/6v7ToB4vXItdvcltJBgny0xBE6xy6IYQrPJAJggdEinGxCDMivNv7sFzPcTITGquXD6UJwYxfJ/5ZwDSg== dependencies: - "@jest/environment" "^27.5.1" - "@jest/types" "^27.5.1" - expect "^27.5.1" + "@jest/environment" "^28.1.1" + "@jest/expect" "^28.1.1" + "@jest/types" "^28.1.1" -"@jest/reporters@27.5.1", "@jest/reporters@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.5.1.tgz#ceda7be96170b03c923c37987b64015812ffec04" - integrity sha512-cPXh9hWIlVJMQkVk84aIvXuBB4uQQmFqZiacloFuGiP3ah1sbCxCosidXFDfqG8+6fO1oR2dTJTlsOy4VFmUfw== +"@jest/reporters@28.1.1", "@jest/reporters@^28.1.1": + version "28.1.1" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-28.1.1.tgz#9389f4bb3cce4d9b586f6195f83c79cd2a1c8662" + integrity sha512-597Zj4D4d88sZrzM4atEGLuO7SdA/YrOv9SRXHXRNC+/FwPCWxZhBAEzhXoiJzfRwn8zes/EjS8Lo6DouGN5Gg== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^27.5.1" - "@jest/test-result" "^27.5.1" - "@jest/transform" "^27.5.1" - "@jest/types" "^27.5.1" + "@jest/console" "^28.1.1" + "@jest/test-result" "^28.1.1" + "@jest/transform" "^28.1.1" + "@jest/types" "^28.1.1" + "@jridgewell/trace-mapping" "^0.3.7" "@types/node" "*" chalk "^4.0.0" collect-v8-coverage "^1.0.0" exit "^0.1.2" - glob "^7.1.2" + glob "^7.1.3" graceful-fs "^4.2.9" istanbul-lib-coverage "^3.0.0" istanbul-lib-instrument "^5.1.0" istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-haste-map "^27.5.1" - jest-resolve "^27.5.1" - jest-util "^27.5.1" - jest-worker "^27.5.1" + jest-message-util "^28.1.1" + jest-util "^28.1.1" + jest-worker "^28.1.1" slash "^3.0.0" - source-map "^0.6.0" string-length "^4.0.1" + strip-ansi "^6.0.0" terminal-link "^2.0.0" - v8-to-istanbul "^8.1.0" + v8-to-istanbul "^9.0.0" "@jest/schemas@^28.0.2": version "28.0.2" @@ -1523,55 +1581,55 @@ dependencies: "@sinclair/typebox" "^0.23.3" -"@jest/source-map@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-27.5.1.tgz#6608391e465add4205eae073b55e7f279e04e8cf" - integrity sha512-y9NIHUYF3PJRlHk98NdC/N1gl88BL08aQQgu4k4ZopQkCw9t9cV8mtl3TV8b/YCB8XaVTFrmUTAJvjsntDireg== +"@jest/source-map@^28.0.2": + version "28.0.2" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-28.0.2.tgz#914546f4410b67b1d42c262a1da7e0406b52dc90" + integrity sha512-Y9dxC8ZpN3kImkk0LkK5XCEneYMAXlZ8m5bflmSL5vrwyeUpJfentacCUg6fOb8NOpOO7hz2+l37MV77T6BFPw== dependencies: + "@jridgewell/trace-mapping" "^0.3.7" callsites "^3.0.0" graceful-fs "^4.2.9" - source-map "^0.6.0" -"@jest/test-result@27.5.1", "@jest/test-result@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.5.1.tgz#56a6585fa80f7cdab72b8c5fc2e871d03832f5bb" - integrity sha512-EW35l2RYFUcUQxFJz5Cv5MTOxlJIQs4I7gxzi2zVU7PJhOwfYq1MdC5nhSmYjX1gmMmLPvB3sIaC+BkcHRBfag== +"@jest/test-result@28.1.1", "@jest/test-result@^28.1.1": + version "28.1.1" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-28.1.1.tgz#c6f18d1bbb01aa88925dd687872a75f8414b317a" + integrity sha512-hPmkugBktqL6rRzwWAtp1JtYT4VHwv8OQ+9lE5Gymj6dHzubI/oJHMUpPOt8NrdVWSrz9S7bHjJUmv2ggFoUNQ== dependencies: - "@jest/console" "^27.5.1" - "@jest/types" "^27.5.1" + "@jest/console" "^28.1.1" + "@jest/types" "^28.1.1" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.5.1.tgz#4057e0e9cea4439e544c6353c6affe58d095745b" - integrity sha512-LCheJF7WB2+9JuCS7VB/EmGIdQuhtqjRNI9A43idHv3E4KltCTsPsLxvdaubFHSYwY/fNjMWjl6vNRhDiN7vpQ== +"@jest/test-sequencer@^28.1.1": + version "28.1.1" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-28.1.1.tgz#f594ee2331df75000afe0d1ae3237630ecec732e" + integrity sha512-nuL+dNSVMcWB7OOtgb0EGH5AjO4UBCt68SLP08rwmC+iRhyuJWS9MtZ/MpipxFwKAlHFftbMsydXqWre8B0+XA== dependencies: - "@jest/test-result" "^27.5.1" + "@jest/test-result" "^28.1.1" graceful-fs "^4.2.9" - jest-haste-map "^27.5.1" - jest-runtime "^27.5.1" + jest-haste-map "^28.1.1" + slash "^3.0.0" -"@jest/transform@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.5.1.tgz#6c3501dcc00c4c08915f292a600ece5ecfe1f409" - integrity sha512-ipON6WtYgl/1329g5AIJVbUuEh0wZVbdpGwC99Jw4LwuoBNS95MVphU6zOeD9pDkon+LLbFL7lOQRapbB8SCHw== +"@jest/transform@^28.1.1": + version "28.1.1" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-28.1.1.tgz#83541f2a3f612077c8501f49cc4e205d4e4a6b27" + integrity sha512-PkfaTUuvjUarl1EDr5ZQcCA++oXkFCP9QFUkG0yVKVmNObjhrqDy0kbMpMebfHWm3CCDHjYNem9eUSH8suVNHQ== dependencies: - "@babel/core" "^7.1.0" - "@jest/types" "^27.5.1" + "@babel/core" "^7.11.6" + "@jest/types" "^28.1.1" + "@jridgewell/trace-mapping" "^0.3.7" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.9" - jest-haste-map "^27.5.1" - jest-regex-util "^27.5.1" - jest-util "^27.5.1" + jest-haste-map "^28.1.1" + jest-regex-util "^28.0.2" + jest-util "^28.1.1" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" - source-map "^0.6.1" - write-file-atomic "^3.0.0" + write-file-atomic "^4.0.1" "@jest/types@^26.6.2": version "26.6.2" @@ -1584,15 +1642,16 @@ "@types/yargs" "^15.0.0" chalk "^4.0.0" -"@jest/types@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.5.1.tgz#3c79ec4a8ba61c170bf937bcf9e98a9df175ec80" - integrity sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw== +"@jest/types@^28.1.1": + version "28.1.1" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-28.1.1.tgz#d059bbc80e6da6eda9f081f293299348bd78ee0b" + integrity sha512-vRXVqSg1VhDnB8bWcmvLzmg0Bt9CRKVgHPXqYwvWMX3TvAjeO+nRuK6+VdTKCtWOvYlmkF/HqNAL/z+N3B53Kw== dependencies: + "@jest/schemas" "^28.0.2" "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" "@types/node" "*" - "@types/yargs" "^16.0.0" + "@types/yargs" "^17.0.8" chalk "^4.0.0" "@jridgewell/gen-mapping@^0.1.0": @@ -1635,7 +1694,7 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" -"@jridgewell/trace-mapping@^0.3.9": +"@jridgewell/trace-mapping@^0.3.7", "@jridgewell/trace-mapping@^0.3.9": version "0.3.13" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.13.tgz#dcfe3e95f224c8fe97a87a5235defec999aa92ea" integrity sha512-o1xbKhp9qnIAoHJSWd6KlCZfqslL4valSF81H8ImioOAxluWYWOpWkpyktY2vnt4tbrX9XYaxovq6cgowaJp2w== @@ -2058,7 +2117,6 @@ "@renovate/eslint-plugin@https://github.com/renovatebot/eslint-plugin#v0.0.4": version "0.0.4" - uid "0c444386e79d6145901212507521b8a0a48af000" resolved "https://github.com/renovatebot/eslint-plugin#0c444386e79d6145901212507521b8a0a48af000" "@renovatebot/pep440@2.1.3": @@ -2196,7 +2254,7 @@ dependencies: type-detect "4.0.8" -"@sinonjs/fake-timers@>=5": +"@sinonjs/fake-timers@>=5", "@sinonjs/fake-timers@^9.1.1": version "9.1.2" resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-9.1.2.tgz#4eaab737fab77332ab132d396a3c0d364bd0ea8c" integrity sha512-BPS4ynJW/o92PUR4wgriz2Ud5gpST5vz6GQfMixEDK0Z8ZCUv2M7SkBLykH56T++Xs+8ln9zTGbOvNGIe02/jw== @@ -2210,13 +2268,6 @@ dependencies: "@sinonjs/commons" "^1.7.0" -"@sinonjs/fake-timers@^8.0.1": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-8.1.0.tgz#3fdc2b6cb58935b21bfb8d1625eb1300484316e7" - integrity sha512-OAPJUAtgeINhh/TAlUID4QTs53Njm7xzddaVlEs/SXwgtiD1tW22zAB/W1wdqfrpmikgaWQ9Fw6Ws+hsiRm5Vg== - dependencies: - "@sinonjs/commons" "^1.7.0" - "@sinonjs/samsam@^6.0.2": version "6.1.1" resolved "https://registry.yarnpkg.com/@sinonjs/samsam/-/samsam-6.1.1.tgz#627f7f4cbdb56e6419fa2c1a3e4751ce4f6a00b1" @@ -2337,7 +2388,7 @@ resolved "https://registry.yarnpkg.com/@types/auth-header/-/auth-header-1.0.2.tgz#45879542c5c754debbb753b1491bbf690888b4ef" integrity sha512-KWpTfyz+F5GtURfp7W9c4ubFSXaPAvb1dUN5MlU3xSvlNIYhFrmrTNE7vd6SUOfSOO7FI/ePe03Y/KCPM/YOoA== -"@types/babel__core@^7.0.0", "@types/babel__core@^7.1.14": +"@types/babel__core@^7.1.14": version "7.1.19" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.19.tgz#7b497495b7d1b4812bdb9d02804d0576f43ee460" integrity sha512-WEOTgRsbYkvA/KCsDwVEGkd7WAr1e3g31VHQ8zy5gul/V1qKullU/BU5I68X5v7V3GnB9eotmom4v5a5gjxorw== @@ -2363,7 +2414,7 @@ "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" -"@types/babel__traverse@*", "@types/babel__traverse@^7.0.4", "@types/babel__traverse@^7.0.6": +"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": version "7.17.1" resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.17.1.tgz#1a0e73e8c28c7e832656db372b779bfd2ef37314" integrity sha512-kVzjari1s2YVi77D3w1yuvohV2idweYXMCDzqBiVNN63TcDWrIlTVOYpqVrvbbyOE/IyzBoTKF0fdnLPEORFxA== @@ -2467,7 +2518,7 @@ resolved "https://registry.yarnpkg.com/@types/global-agent/-/global-agent-2.1.1.tgz#3f93185e48a3a36e377a52a8301320cd162a831b" integrity sha512-sVox8Phk1UKgP6LQPAdeRxfww6vHKt7Bf59dXzYLsQBUEMEn8S10a+ESp/yO0i4fJ3WS4+CIuz42hgJcuA+3mA== -"@types/graceful-fs@^4.1.2": +"@types/graceful-fs@^4.1.3": version "4.1.5" resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.5.tgz#21ffba0d98da4350db64891f92a9e5db3cdb4e15" integrity sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw== @@ -2503,10 +2554,10 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/jest@27.5.2": - version "27.5.2" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.5.2.tgz#ec49d29d926500ffb9fd22b84262e862049c026c" - integrity sha512-mpT8LJJ4CMeeahobofYWIjFo0xonRS/HfxnVEPMPFSQdGUt1uHCnoPT7Zhb+sjDU2wz0oKV0OLUR0WzrHNgfeA== +"@types/jest@28.1.1": + version "28.1.1" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-28.1.1.tgz#8c9ba63702a11f8c386ee211280e8b68cb093cd1" + integrity sha512-C2p7yqleUKtCkVjlOur9BWVA4HgUQmEj/HWCt5WzZ5mLXrWnyIfl0wGuArc+kBXsy0ZZfLp+7dywB4HtSVYGVA== dependencies: jest-matcher-utils "^27.0.0" pretty-format "^27.0.0" @@ -2736,10 +2787,10 @@ dependencies: "@types/yargs-parser" "*" -"@types/yargs@^16.0.0": - version "16.0.4" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-16.0.4.tgz#26aad98dd2c2a38e421086ea9ad42b9e51642977" - integrity sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw== +"@types/yargs@^17.0.8": + version "17.0.10" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.10.tgz#591522fce85d8739bca7b8bb90d048e4478d186a" + integrity sha512-gmEaFwpj/7f/ROdtIlci1R1VYU1J4j95m8T+Tj3iBgiBFKg1foE/PSl93bBd5T9LDXNPo8UlNN6W0qwD8O5OaA== dependencies: "@types/yargs-parser" "*" @@ -2939,45 +2990,22 @@ JSONStream@^1.0.4: jsonparse "^1.2.0" through ">=2.2.7 <3" -abab@^2.0.3, abab@^2.0.5: - version "2.0.6" - resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.6.tgz#41b80f2c871d19686216b82309231cfd3cb3d291" - integrity sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA== - abbrev@1, abbrev@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== -acorn-globals@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-6.0.0.tgz#46cdd39f0f8ff08a876619b55f5ac8a6dc770b45" - integrity sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg== - dependencies: - acorn "^7.1.1" - acorn-walk "^7.1.1" - acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== -acorn-walk@^7.1.1: - version "7.2.0" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" - integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== - acorn-walk@^8.1.1: version "8.2.0" resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== -acorn@^7.1.1: - version "7.4.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" - integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== - -acorn@^8.2.4, acorn@^8.4.1, acorn@^8.7.1: +acorn@^8.4.1, acorn@^8.7.1: version "8.7.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.1.tgz#0197122c843d1bf6d0a5e83220a788f278f63c30" integrity sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A== @@ -3183,11 +3211,6 @@ asn1.js@^5.0.0: minimalistic-assert "^1.0.0" safer-buffer "^2.1.0" -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== - auth-header@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/auth-header/-/auth-header-1.0.0.tgz#ea24fdc5588e1eb8b750df8655a396aa48fc9076" @@ -3215,16 +3238,15 @@ azure-devops-node-api@11.1.1: tunnel "0.0.6" typed-rest-client "^1.8.4" -babel-jest@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.5.1.tgz#a1bf8d61928edfefd21da27eb86a695bfd691444" - integrity sha512-cdQ5dXjGRd0IBRATiQ4mZGlGlRE8kJpjPOixdNRdT+m3UcNqmYWN6rK6nvtXYfY3D76cb8s/O1Ss8ea24PIwcg== +babel-jest@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-28.1.1.tgz#2a3a4ae50964695b2d694ccffe4bec537c5a3586" + integrity sha512-MEt0263viUdAkTq5D7upHPNxvt4n9uLUGa6pPz3WviNBMtOmStb1lIXS3QobnoqM+qnH+vr4EKlvhe8QcmxIYw== dependencies: - "@jest/transform" "^27.5.1" - "@jest/types" "^27.5.1" + "@jest/transform" "^28.1.1" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" - babel-preset-jest "^27.5.1" + babel-preset-jest "^28.1.1" chalk "^4.0.0" graceful-fs "^4.2.9" slash "^3.0.0" @@ -3240,14 +3262,14 @@ babel-plugin-istanbul@^6.1.1: istanbul-lib-instrument "^5.0.4" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.5.1.tgz#9be98ecf28c331eb9f5df9c72d6f89deb8181c2e" - integrity sha512-50wCwD5EMNW4aRpOwtqzyZHIewTYNxLA4nhB+09d8BIssfNfzBRhkBIHiaPv1Si226TQSvp8gxAJm2iY2qs2hQ== +babel-plugin-jest-hoist@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-28.1.1.tgz#5e055cdcc47894f28341f87f5e35aad2df680b11" + integrity sha512-NovGCy5Hn25uMJSAU8FaHqzs13cFoOI4lhIujiepssjCKRsAo3TA734RDWSGxuFTsUJXerYOqQQodlxgmtqbzw== dependencies: "@babel/template" "^7.3.3" "@babel/types" "^7.3.3" - "@types/babel__core" "^7.0.0" + "@types/babel__core" "^7.1.14" "@types/babel__traverse" "^7.0.6" babel-preset-current-node-syntax@^1.0.0: @@ -3268,12 +3290,12 @@ babel-preset-current-node-syntax@^1.0.0: "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-top-level-await" "^7.8.3" -babel-preset-jest@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-27.5.1.tgz#91f10f58034cb7989cb4f962b69fa6eef6a6bc81" - integrity sha512-Nptf2FzlPCWYuJg41HBqXVT8ym6bXOevuCTbhxlUpjwtysGaIWFvDEjp4y+G7fl13FgOdjs7P/DmErqH7da0Ag== +babel-preset-jest@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-28.1.1.tgz#5b6e5e69f963eb2d70f739c607b8f723c0ee75e4" + integrity sha512-FCq9Oud0ReTeWtcneYf/48981aTfXYuB9gbU4rBNNJVBSQ6ssv7E6v/qvbBxtOWwZFXjLZwpg+W3q7J6vhH25g== dependencies: - babel-plugin-jest-hoist "^27.5.1" + babel-plugin-jest-hoist "^28.1.1" babel-preset-current-node-syntax "^1.0.0" backslash@^0.2.0: @@ -3360,11 +3382,6 @@ braces@^3.0.1, braces@^3.0.2: dependencies: fill-range "^7.0.1" -browser-process-hrtime@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" - integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== - browserslist@^4.20.2: version "4.20.4" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.20.4.tgz#98096c9042af689ee1e0271333dbc564b8ce4477" @@ -3745,13 +3762,6 @@ columnify@^1.6.0: strip-ansi "^6.0.1" wcwidth "^1.0.0" -combined-stream@^1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" - integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== - dependencies: - delayed-stream "~1.0.0" - commander@9.3.0: version "9.3.0" resolved "https://registry.yarnpkg.com/commander/-/commander-9.3.0.tgz#f619114a5a2d2054e0d9ff1b31d5ccf89255e26b" @@ -3938,37 +3948,11 @@ css-what@^6.0.1: resolved "https://registry.yarnpkg.com/css-what/-/css-what-6.1.0.tgz#fb5effcf76f1ddea2c81bdfaa4de44e79bac70f4" integrity sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw== -cssom@^0.4.4: - version "0.4.4" - resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.4.4.tgz#5a66cf93d2d0b661d80bf6a44fb65f5c2e4e0a10" - integrity sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw== - -cssom@~0.3.6: - version "0.3.8" - resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" - integrity sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg== - -cssstyle@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-2.3.0.tgz#ff665a0ddbdc31864b09647f34163443d90b0852" - integrity sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A== - dependencies: - cssom "~0.3.6" - dargs@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/dargs/-/dargs-7.0.0.tgz#04015c41de0bcb69ec84050f3d9be0caf8d6d5cc" integrity sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg== -data-urls@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-2.0.0.tgz#156485a72963a970f5d5821aaf642bef2bf2db9b" - integrity sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ== - dependencies: - abab "^2.0.3" - whatwg-mimetype "^2.3.0" - whatwg-url "^8.0.0" - dateformat@^3.0.0: version "3.0.3" resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" @@ -4020,11 +4004,6 @@ decamelize@^1.1.0, decamelize@^1.2.0: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== -decimal.js@^10.2.1: - version "10.3.1" - resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.3.1.tgz#d8c3a444a9c6774ba60ca6ad7261c3a94fd5e783" - integrity sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ== - decode-uri-component@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" @@ -4047,7 +4026,7 @@ deep-extend@^0.6.0: resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== -deep-is@^0.1.3, deep-is@~0.1.3: +deep-is@^0.1.3: version "0.1.4" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== @@ -4096,11 +4075,6 @@ delay@5.0.0: resolved "https://registry.yarnpkg.com/delay/-/delay-5.0.0.tgz#137045ef1b96e5071060dd5be60bf9334436bd1d" integrity sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw== -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== - delegates@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" @@ -4199,13 +4173,6 @@ domelementtype@^2.0.1, domelementtype@^2.2.0: resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.3.0.tgz#5c45e8e869952626331d7aab326d01daf65d589d" integrity sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw== -domexception@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/domexception/-/domexception-2.0.1.tgz#fb44aefba793e1574b0af6aed2801d057529f304" - integrity sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg== - dependencies: - webidl-conversions "^5.0.0" - domhandler@^4.2.0, domhandler@^4.3.1: version "4.3.1" resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-4.3.1.tgz#8d792033416f59d68bc03a5aa7b018c1ca89279c" @@ -4263,10 +4230,10 @@ email-addresses@5.0.0: resolved "https://registry.yarnpkg.com/email-addresses/-/email-addresses-5.0.0.tgz#7ae9e7f58eef7d5e3e2c2c2d3ea49b78dc854fa6" integrity sha512-4OIPYlA6JXqtVn8zpHpGiI7vE6EQOAg16aGnDMIAlZVinnoZ8208tW1hAbjWydgN/4PLTT9q+O1K6AH/vALJGw== -emittery@^0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.8.1.tgz#bb23cc86d03b30aa75a7f734819dee2e1ba70860" - integrity sha512-uDfvUjVrfGJJhymx/kz6prltenw1u7WrCg1oa94zYY8xxVpLLUu045LAT0dhDZdXG58/EpPL/5kA180fQ/qudg== +emittery@^0.10.2: + version "0.10.2" + resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.10.2.tgz#902eec8aedb8c41938c46e9385e9db7e03182933" + integrity sha512-aITqOwnLanpHLNXZJENbOgjUBeHocD+xsSJmNrjovKBW5HbSpW3d1pEls7GFQPUWXiwG9+0P4GtHfEqC/4M0Iw== emoji-regex@10.1.0: version "10.1.0" @@ -4425,18 +4392,6 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -escodegen@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-2.0.0.tgz#5e32b12833e8aa8fa35e1bf0befa89380484c7dd" - integrity sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw== - dependencies: - esprima "^4.0.1" - estraverse "^5.2.0" - esutils "^2.0.2" - optionator "^0.8.1" - optionalDependencies: - source-map "~0.6.1" - eslint-config-prettier@8.5.0: version "8.5.0" resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz#5a81680ec934beca02c7b1a61cf8ca34b66feab1" @@ -4618,7 +4573,7 @@ espree@^9.3.2: acorn-jsx "^5.3.2" eslint-visitor-keys "^3.3.0" -esprima@^4.0.0, esprima@^4.0.1, esprima@~4.0.0: +esprima@^4.0.0, esprima@~4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== @@ -4706,15 +4661,16 @@ expect-more@1.2.0: resolved "https://registry.yarnpkg.com/expect-more/-/expect-more-1.2.0.tgz#cc7b3b6ad194ee54deaf601cf5c80449ed7a276d" integrity sha512-AVnjc5oh2jgiJjOrjbiKxbwLlNA/zsl2044Nbd09H4+2KwThtSLYKhdOusLYOrcToFAa2uBOWR1ExCN4kOWgbQ== -expect@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/expect/-/expect-27.5.1.tgz#83ce59f1e5bdf5f9d2b94b61d2050db48f3fef74" - integrity sha512-E1q5hSUG2AmYQwQJ041nvgpkODHQvB+RKlB4IYdru6uJsyFTRyZAP463M+1lINorwbqAmUggi6+WwkD8lCS/Dw== +expect@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/expect/-/expect-28.1.1.tgz#ca6fff65f6517cf7220c2e805a49c19aea30b420" + integrity sha512-/AANEwGL0tWBwzLNOvO0yUdy2D52jVdNXppOqswC49sxMN2cPWsGCQdzuIf9tj6hHoBQzNvx75JUYuQAckPo3w== dependencies: - "@jest/types" "^27.5.1" - jest-get-type "^27.5.1" - jest-matcher-utils "^27.5.1" - jest-message-util "^27.5.1" + "@jest/expect-utils" "^28.1.1" + jest-get-type "^28.0.2" + jest-matcher-utils "^28.1.1" + jest-message-util "^28.1.1" + jest-util "^28.1.1" extend@^3.0.0: version "3.0.2" @@ -4753,7 +4709,7 @@ fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0: resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== -fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6: +fast-levenshtein@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== @@ -4887,15 +4843,6 @@ for-each@^0.3.3: dependencies: is-callable "^1.1.3" -form-data@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" - integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - from2@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/from2/-/from2-2.3.0.tgz#8bfb5502bde4a4d36cfdeea007fcca21d7e382af" @@ -5116,7 +5063,7 @@ glob@^6.0.1: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.0.0, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.2.0: +glob@^7.0.0, glob@^7.1.3, glob@^7.1.4, glob@^7.2.0: version "7.2.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== @@ -5330,13 +5277,6 @@ hosted-git-info@^5.0.0: dependencies: lru-cache "^7.5.1" -html-encoding-sniffer@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz#42a6dc4fd33f00281176e8b23759ca4e4fa185f3" - integrity sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ== - dependencies: - whatwg-encoding "^1.0.5" - html-escaper@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" @@ -5403,13 +5343,6 @@ husky@8.0.1: resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.1.tgz#511cb3e57de3e3190514ae49ed50f6bc3f50b3e9" integrity sha512-xs7/chUH/CKdOCs7Zy0Aev9e/dKOMZf3K1Az1nar3tzlv0jfqnYtu235bstsWTmXOR0EfINrPa97yy4Lz6RiKw== -iconv-lite@0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - iconv-lite@^0.6.2: version "0.6.3" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" @@ -5713,11 +5646,6 @@ is-plain-object@^5.0.0: resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== -is-potential-custom-element-name@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" - integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== - is-regex@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" @@ -5872,89 +5800,86 @@ java-properties@^1.0.0: resolved "https://registry.yarnpkg.com/java-properties/-/java-properties-1.0.2.tgz#ccd1fa73907438a5b5c38982269d0e771fe78211" integrity sha512-qjdpeo2yKlYTH7nFdK0vbZWuTCesk4o63v5iVOlhMQPfuIZQfW/HI35SjfhA+4qpg36rnFSvUK5b1m+ckIblQQ== -jest-changed-files@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.5.1.tgz#a348aed00ec9bf671cc58a66fcbe7c3dfd6a68f5" - integrity sha512-buBLMiByfWGCoMsLLzGUUSpAmIAGnbR2KJoMN10ziLhOLvP4e0SlypHnAel8iqQXTrcbmfEY9sSqae5sgUsTvw== +jest-changed-files@^28.0.2: + version "28.0.2" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-28.0.2.tgz#7d7810660a5bd043af9e9cfbe4d58adb05e91531" + integrity sha512-QX9u+5I2s54ZnGoMEjiM2WeBvJR2J7w/8ZUmH2um/WLAuGAYFQcsVXY9+1YL6k0H/AGUdH8pXUAv6erDqEsvIA== dependencies: - "@jest/types" "^27.5.1" execa "^5.0.0" throat "^6.0.1" -jest-circus@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.5.1.tgz#37a5a4459b7bf4406e53d637b49d22c65d125ecc" - integrity sha512-D95R7x5UtlMA5iBYsOHFFbMD/GVA4R/Kdq15f7xYWUfWHBto9NYRsOvnSauTgdF+ogCpJ4tyKOXhUifxS65gdw== +jest-circus@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-28.1.1.tgz#3d27da6a974d85a466dc0cdc6ddeb58daaa57bb4" + integrity sha512-75+BBVTsL4+p2w198DQpCeyh1RdaS2lhEG87HkaFX/UG0gJExVq2skG2pT7XZEGBubNj2CytcWSPan4QEPNosw== dependencies: - "@jest/environment" "^27.5.1" - "@jest/test-result" "^27.5.1" - "@jest/types" "^27.5.1" + "@jest/environment" "^28.1.1" + "@jest/expect" "^28.1.1" + "@jest/test-result" "^28.1.1" + "@jest/types" "^28.1.1" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" - expect "^27.5.1" is-generator-fn "^2.0.0" - jest-each "^27.5.1" - jest-matcher-utils "^27.5.1" - jest-message-util "^27.5.1" - jest-runtime "^27.5.1" - jest-snapshot "^27.5.1" - jest-util "^27.5.1" - pretty-format "^27.5.1" + jest-each "^28.1.1" + jest-matcher-utils "^28.1.1" + jest-message-util "^28.1.1" + jest-runtime "^28.1.1" + jest-snapshot "^28.1.1" + jest-util "^28.1.1" + pretty-format "^28.1.1" slash "^3.0.0" stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.5.1.tgz#278794a6e6458ea8029547e6c6cbf673bd30b145" - integrity sha512-Hc6HOOwYq4/74/c62dEE3r5elx8wjYqxY0r0G/nFrLDPMFRu6RA/u8qINOIkvhxG7mMQ5EJsOGfRpI8L6eFUVw== +jest-cli@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-28.1.1.tgz#23ddfde8940e1818585ae4a568877b33b0e51cfe" + integrity sha512-+sUfVbJqb1OjBZ0OdBbI6OWfYM1i7bSfzYy6gze1F1w3OKWq8ZTEKkZ8a7ZQPq6G/G1qMh/uKqpdWhgl11NFQQ== dependencies: - "@jest/core" "^27.5.1" - "@jest/test-result" "^27.5.1" - "@jest/types" "^27.5.1" + "@jest/core" "^28.1.1" + "@jest/test-result" "^28.1.1" + "@jest/types" "^28.1.1" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^27.5.1" - jest-util "^27.5.1" - jest-validate "^27.5.1" + jest-config "^28.1.1" + jest-util "^28.1.1" + jest-validate "^28.1.1" prompts "^2.0.1" - yargs "^16.2.0" + yargs "^17.3.1" -jest-config@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.5.1.tgz#5c387de33dca3f99ad6357ddeccd91bf3a0e4a41" - integrity sha512-5sAsjm6tGdsVbW9ahcChPAFCk4IlkQUknH5AvKjuLTSlcO/wCZKyFdn7Rg0EkC+OGgWODEy2hDpWB1PgzH0JNA== +jest-config@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-28.1.1.tgz#e90b97b984f14a6c24a221859e81b258990fce2f" + integrity sha512-tASynMhS+jVV85zKvjfbJ8nUyJS/jUSYZ5KQxLUN2ZCvcQc/OmhQl2j6VEL3ezQkNofxn5pQ3SPYWPHb0unTZA== dependencies: - "@babel/core" "^7.8.0" - "@jest/test-sequencer" "^27.5.1" - "@jest/types" "^27.5.1" - babel-jest "^27.5.1" + "@babel/core" "^7.11.6" + "@jest/test-sequencer" "^28.1.1" + "@jest/types" "^28.1.1" + babel-jest "^28.1.1" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" - glob "^7.1.1" + glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^27.5.1" - jest-environment-jsdom "^27.5.1" - jest-environment-node "^27.5.1" - jest-get-type "^27.5.1" - jest-jasmine2 "^27.5.1" - jest-regex-util "^27.5.1" - jest-resolve "^27.5.1" - jest-runner "^27.5.1" - jest-util "^27.5.1" - jest-validate "^27.5.1" + jest-circus "^28.1.1" + jest-environment-node "^28.1.1" + jest-get-type "^28.0.2" + jest-regex-util "^28.0.2" + jest-resolve "^28.1.1" + jest-runner "^28.1.1" + jest-util "^28.1.1" + jest-validate "^28.1.1" micromatch "^4.0.4" parse-json "^5.2.0" - pretty-format "^27.5.1" + pretty-format "^28.1.1" slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@^27.2.5, jest-diff@^27.5.1: +jest-diff@^27.2.5: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.5.1.tgz#a07f5011ac9e6643cf8a95a462b7b1ecf6680def" integrity sha512-m0NvkX55LDt9T4mctTEgnZk3fmEg3NRYutvMPWM/0iPnkFj2wIeF45O1718cMSOFO1vINkqmxqD8vE37uTEbqw== @@ -5964,7 +5889,7 @@ jest-diff@^27.2.5, jest-diff@^27.5.1: jest-get-type "^27.5.1" pretty-format "^27.5.1" -jest-diff@^28.1.0: +jest-diff@^28.1.0, jest-diff@^28.1.1: version "28.1.1" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-28.1.1.tgz#1a3eedfd81ae79810931c63a1d0f201b9120106c" integrity sha512-/MUUxeR2fHbqHoMMiffe/Afm+U8U4olFRJ0hiVG2lZatPJcnGxx292ustVu7bULhjV65IYMxRdploAKLbcrsyg== @@ -5974,48 +5899,35 @@ jest-diff@^28.1.0: jest-get-type "^28.0.2" pretty-format "^28.1.1" -jest-docblock@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.5.1.tgz#14092f364a42c6108d42c33c8cf30e058e25f6c0" - integrity sha512-rl7hlABeTsRYxKiUfpHrQrG4e2obOiTQWfMEH3PxPjOtdsfLQO4ReWSZaQ7DETm4xu07rl4q/h4zcKXyU0/OzQ== +jest-docblock@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-28.1.1.tgz#6f515c3bf841516d82ecd57a62eed9204c2f42a8" + integrity sha512-3wayBVNiOYx0cwAbl9rwm5kKFP8yHH3d/fkEaL02NPTkDojPtheGB7HZSFY4wzX+DxyrvhXz0KSCVksmCknCuA== dependencies: detect-newline "^3.0.0" -jest-each@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.5.1.tgz#5bc87016f45ed9507fed6e4702a5b468a5b2c44e" - integrity sha512-1Ff6p+FbhT/bXQnEouYy00bkNSY7OUpfIcmdl8vZ31A1UUaurOLPA8a8BbJOF2RDUElwJhmeaV7LnagI+5UwNQ== +jest-each@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-28.1.1.tgz#ba5238dacf4f31d9fe23ddc2c44c01e7c23885c4" + integrity sha512-A042rqh17ZvEhRceDMi784ppoXR7MWGDEKTXEZXb4svt0eShMZvijGxzKsx+yIjeE8QYmHPrnHiTSQVhN4nqaw== dependencies: - "@jest/types" "^27.5.1" + "@jest/types" "^28.1.1" chalk "^4.0.0" - jest-get-type "^27.5.1" - jest-util "^27.5.1" - pretty-format "^27.5.1" - -jest-environment-jsdom@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.5.1.tgz#ea9ccd1fc610209655a77898f86b2b559516a546" - integrity sha512-TFBvkTC1Hnnnrka/fUb56atfDtJ9VMZ94JkjTbggl1PEpwrYtUBKMezB3inLmWqQsXYLcMwNoDQwoBTAvFfsfw== - dependencies: - "@jest/environment" "^27.5.1" - "@jest/fake-timers" "^27.5.1" - "@jest/types" "^27.5.1" - "@types/node" "*" - jest-mock "^27.5.1" - jest-util "^27.5.1" - jsdom "^16.6.0" + jest-get-type "^28.0.2" + jest-util "^28.1.1" + pretty-format "^28.1.1" -jest-environment-node@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.5.1.tgz#dedc2cfe52fab6b8f5714b4808aefa85357a365e" - integrity sha512-Jt4ZUnxdOsTGwSRAfKEnE6BcwsSPNOijjwifq5sDFSA2kesnXTvNqKHYgM0hDq3549Uf/KzdXNYn4wMZJPlFLw== +jest-environment-node@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-28.1.1.tgz#1c86c59003a7d319fa06ea3b1bbda6c193715c67" + integrity sha512-2aV/eeY/WNgUUJrrkDJ3cFEigjC5fqT1+fCclrY6paqJ5zVPoM//sHmfgUUp7WLYxIdbPwMiVIzejpN56MxnNA== dependencies: - "@jest/environment" "^27.5.1" - "@jest/fake-timers" "^27.5.1" - "@jest/types" "^27.5.1" + "@jest/environment" "^28.1.1" + "@jest/fake-timers" "^28.1.1" + "@jest/types" "^28.1.1" "@types/node" "*" - jest-mock "^27.5.1" - jest-util "^27.5.1" + jest-mock "^28.1.1" + jest-util "^28.1.1" jest-extended@2.0.0: version "2.0.0" @@ -6042,49 +5954,25 @@ jest-github-actions-reporter@1.0.3: dependencies: "@actions/core" "^1.2.0" -jest-haste-map@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.5.1.tgz#9fd8bd7e7b4fa502d9c6164c5640512b4e811e7f" - integrity sha512-7GgkZ4Fw4NFbMSDSpZwXeBiIbx+t/46nJ2QitkOjvwPYyZmqttu2TDSimMHP1EkPOi4xUZAN1doE5Vd25H4Jng== +jest-haste-map@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-28.1.1.tgz#471685f1acd365a9394745bb97c8fc16289adca3" + integrity sha512-ZrRSE2o3Ezh7sb1KmeLEZRZ4mgufbrMwolcFHNRSjKZhpLa8TdooXOOFlSwoUzlbVs1t0l7upVRW2K7RWGHzbQ== dependencies: - "@jest/types" "^27.5.1" - "@types/graceful-fs" "^4.1.2" + "@jest/types" "^28.1.1" + "@types/graceful-fs" "^4.1.3" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.9" - jest-regex-util "^27.5.1" - jest-serializer "^27.5.1" - jest-util "^27.5.1" - jest-worker "^27.5.1" + jest-regex-util "^28.0.2" + jest-util "^28.1.1" + jest-worker "^28.1.1" micromatch "^4.0.4" - walker "^1.0.7" + walker "^1.0.8" optionalDependencies: fsevents "^2.3.2" -jest-jasmine2@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.5.1.tgz#a037b0034ef49a9f3d71c4375a796f3b230d1ac4" - integrity sha512-jtq7VVyG8SqAorDpApwiJJImd0V2wv1xzdheGHRGyuT7gZm6gG47QEskOlzsN1PG/6WNaCo5pmwMHDf3AkG2pQ== - dependencies: - "@jest/environment" "^27.5.1" - "@jest/source-map" "^27.5.1" - "@jest/test-result" "^27.5.1" - "@jest/types" "^27.5.1" - "@types/node" "*" - chalk "^4.0.0" - co "^4.6.0" - expect "^27.5.1" - is-generator-fn "^2.0.0" - jest-each "^27.5.1" - jest-matcher-utils "^27.5.1" - jest-message-util "^27.5.1" - jest-runtime "^27.5.1" - jest-snapshot "^27.5.1" - jest-util "^27.5.1" - pretty-format "^27.5.1" - throat "^6.0.1" - jest-junit@13.2.0: version "13.2.0" resolved "https://registry.yarnpkg.com/jest-junit/-/jest-junit-13.2.0.tgz#66eeb86429aafac8c1745a70f44ace185aacb943" @@ -6095,13 +5983,13 @@ jest-junit@13.2.0: uuid "^8.3.2" xml "^1.0.1" -jest-leak-detector@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.5.1.tgz#6ec9d54c3579dd6e3e66d70e3498adf80fde3fb8" - integrity sha512-POXfWAMvfU6WMUXftV4HolnJfnPOGEu10fscNCA76KBpRRhcMN2c8d3iT2pxQS3HLbA+5X4sOUPzYO2NUyIlHQ== +jest-leak-detector@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-28.1.1.tgz#537f37afd610a4b3f4cab15e06baf60484548efb" + integrity sha512-4jvs8V8kLbAaotE+wFR7vfUGf603cwYtFf1/PYEsyX2BAjSzj8hQSVTP6OWzseTl0xL6dyHuKs2JAks7Pfubmw== dependencies: - jest-get-type "^27.5.1" - pretty-format "^27.5.1" + jest-get-type "^28.0.2" + pretty-format "^28.1.1" jest-matcher-utils@28.1.0: version "28.1.0" @@ -6113,28 +6001,28 @@ jest-matcher-utils@28.1.0: jest-get-type "^28.0.2" pretty-format "^28.1.0" -jest-matcher-utils@^27.0.0, jest-matcher-utils@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.5.1.tgz#9c0cdbda8245bc22d2331729d1091308b40cf8ab" - integrity sha512-z2uTx/T6LBaCoNWNFWwChLBKYxTMcGBRjAt+2SbP929/Fflb9aa5LGma654Rz8z9HLxsrUaYzxE9T/EFIL/PAw== +jest-matcher-utils@^27.0.0, jest-matcher-utils@^28.0.0, jest-matcher-utils@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-28.1.1.tgz#a7c4653c2b782ec96796eb3088060720f1e29304" + integrity sha512-NPJPRWrbmR2nAJ+1nmnfcKKzSwgfaciCCrYZzVnNoxVoyusYWIjkBMNvu0RHJe7dNj4hH3uZOPZsQA+xAYWqsw== dependencies: chalk "^4.0.0" - jest-diff "^27.5.1" - jest-get-type "^27.5.1" - pretty-format "^27.5.1" + jest-diff "^28.1.1" + jest-get-type "^28.0.2" + pretty-format "^28.1.1" -jest-message-util@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.5.1.tgz#bdda72806da10d9ed6425e12afff38cd1458b6cf" - integrity sha512-rMyFe1+jnyAAf+NHwTclDz0eAaLkVDdKVHHBFWsBWHnnh5YeJMNWWsv7AbFYXfK3oTqvL7VTWkhNLu1jX24D+g== +jest-message-util@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-28.1.1.tgz#60aa0b475cfc08c8a9363ed2fb9108514dd9ab89" + integrity sha512-xoDOOT66fLfmTRiqkoLIU7v42mal/SqwDKvfmfiWAdJMSJiU+ozgluO7KbvoAgiwIrrGZsV7viETjc8GNrA/IQ== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^27.5.1" + "@jest/types" "^28.1.1" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^27.5.1" + pretty-format "^28.1.1" slash "^3.0.0" stack-utils "^2.0.3" @@ -6145,12 +6033,12 @@ jest-mock-extended@2.0.6: dependencies: ts-essentials "^7.0.3" -jest-mock@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.5.1.tgz#19948336d49ef4d9c52021d34ac7b5f36ff967d6" - integrity sha512-K4jKbY1d4ENhbrG2zuPWaQBvDly+iZ2yAW+T1fATN78hc0sInwn7wZB8XtlNnvHug5RMwV897Xm4LqmPM4e2Og== +jest-mock@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-28.1.1.tgz#37903d269427fa1ef5b2447be874e1c62a39a371" + integrity sha512-bDCb0FjfsmKweAvE09dZT59IMkzgN0fYBH6t5S45NoJfd2DHkS3ySG2K+hucortryhO3fVuXdlxWcbtIuV/Skw== dependencies: - "@jest/types" "^27.5.1" + "@jest/types" "^28.1.1" "@types/node" "*" jest-pnp-resolver@^1.2.2: @@ -6158,99 +6046,89 @@ jest-pnp-resolver@^1.2.2: resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c" integrity sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w== -jest-regex-util@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.5.1.tgz#4da143f7e9fd1e542d4aa69617b38e4a78365b95" - integrity sha512-4bfKq2zie+x16okqDXjXn9ql2B0dScQu+vcwe4TvFVhkVyuWLqpZrZtXxLLWoXYgn0E87I6r6GRYHF7wFZBUvg== +jest-regex-util@^28.0.2: + version "28.0.2" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-28.0.2.tgz#afdc377a3b25fb6e80825adcf76c854e5bf47ead" + integrity sha512-4s0IgyNIy0y9FK+cjoVYoxamT7Zeo7MhzqRGx7YDYmaQn1wucY9rotiGkBzzcMXTtjrCAP/f7f+E0F7+fxPNdw== -jest-resolve-dependencies@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.5.1.tgz#d811ecc8305e731cc86dd79741ee98fed06f1da8" - integrity sha512-QQOOdY4PE39iawDn5rzbIePNigfe5B9Z91GDD1ae/xNDlu9kaat8QQ5EKnNmVWPV54hUdxCVwwj6YMgR2O7IOg== +jest-resolve-dependencies@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-28.1.1.tgz#3dffaaa56f4b41bc6b61053899d1756401763a27" + integrity sha512-p8Y150xYJth4EXhOuB8FzmS9r8IGLEioiaetgdNGb9VHka4fl0zqWlVe4v7mSkYOuEUg2uB61iE+zySDgrOmgQ== dependencies: - "@jest/types" "^27.5.1" - jest-regex-util "^27.5.1" - jest-snapshot "^27.5.1" + jest-regex-util "^28.0.2" + jest-snapshot "^28.1.1" -jest-resolve@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.5.1.tgz#a2f1c5a0796ec18fe9eb1536ac3814c23617b384" - integrity sha512-FFDy8/9E6CV83IMbDpcjOhumAQPDyETnU2KZ1O98DwTnz8AOBsW/Xv3GySr1mOZdItLR+zDZ7I/UdTFbgSOVCw== +jest-resolve@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-28.1.1.tgz#bc2eaf384abdcc1aaf3ba7c50d1adf01e59095e5" + integrity sha512-/d1UbyUkf9nvsgdBildLe6LAD4DalgkgZcKd0nZ8XUGPyA/7fsnaQIlKVnDiuUXv/IeZhPEDrRJubVSulxrShA== dependencies: - "@jest/types" "^27.5.1" chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^27.5.1" + jest-haste-map "^28.1.1" jest-pnp-resolver "^1.2.2" - jest-util "^27.5.1" - jest-validate "^27.5.1" + jest-util "^28.1.1" + jest-validate "^28.1.1" resolve "^1.20.0" resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.5.1.tgz#071b27c1fa30d90540805c5645a0ec167c7b62e5" - integrity sha512-g4NPsM4mFCOwFKXO4p/H/kWGdJp9V8kURY2lX8Me2drgXqG7rrZAx5kv+5H7wtt/cdFIjhqYx1HrlqWHaOvDaQ== - dependencies: - "@jest/console" "^27.5.1" - "@jest/environment" "^27.5.1" - "@jest/test-result" "^27.5.1" - "@jest/transform" "^27.5.1" - "@jest/types" "^27.5.1" +jest-runner@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-28.1.1.tgz#9ecdb3f27a00059986797aa6b012ba8306aa436c" + integrity sha512-W5oFUiDBgTsCloTAj6q95wEvYDB0pxIhY6bc5F26OucnwBN+K58xGTGbliSMI4ChQal5eANDF+xvELaYkJxTmA== + dependencies: + "@jest/console" "^28.1.1" + "@jest/environment" "^28.1.1" + "@jest/test-result" "^28.1.1" + "@jest/transform" "^28.1.1" + "@jest/types" "^28.1.1" "@types/node" "*" chalk "^4.0.0" - emittery "^0.8.1" + emittery "^0.10.2" graceful-fs "^4.2.9" - jest-docblock "^27.5.1" - jest-environment-jsdom "^27.5.1" - jest-environment-node "^27.5.1" - jest-haste-map "^27.5.1" - jest-leak-detector "^27.5.1" - jest-message-util "^27.5.1" - jest-resolve "^27.5.1" - jest-runtime "^27.5.1" - jest-util "^27.5.1" - jest-worker "^27.5.1" - source-map-support "^0.5.6" + jest-docblock "^28.1.1" + jest-environment-node "^28.1.1" + jest-haste-map "^28.1.1" + jest-leak-detector "^28.1.1" + jest-message-util "^28.1.1" + jest-resolve "^28.1.1" + jest-runtime "^28.1.1" + jest-util "^28.1.1" + jest-watcher "^28.1.1" + jest-worker "^28.1.1" + source-map-support "0.5.13" throat "^6.0.1" -jest-runtime@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.5.1.tgz#4896003d7a334f7e8e4a53ba93fb9bcd3db0a1af" - integrity sha512-o7gxw3Gf+H2IGt8fv0RiyE1+r83FJBRruoA+FXrlHw6xEyBsU8ugA6IPfTdVyA0w8HClpbK+DGJxH59UrNMx8A== - dependencies: - "@jest/environment" "^27.5.1" - "@jest/fake-timers" "^27.5.1" - "@jest/globals" "^27.5.1" - "@jest/source-map" "^27.5.1" - "@jest/test-result" "^27.5.1" - "@jest/transform" "^27.5.1" - "@jest/types" "^27.5.1" +jest-runtime@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-28.1.1.tgz#569e1dc3c36c6c4c0b29516c1c49b6ad580abdaf" + integrity sha512-J89qEJWW0leOsqyi0D9zHpFEYHwwafFdS9xgvhFHtIdRghbadodI0eA+DrthK/1PebBv3Px8mFSMGKrtaVnleg== + dependencies: + "@jest/environment" "^28.1.1" + "@jest/fake-timers" "^28.1.1" + "@jest/globals" "^28.1.1" + "@jest/source-map" "^28.0.2" + "@jest/test-result" "^28.1.1" + "@jest/transform" "^28.1.1" + "@jest/types" "^28.1.1" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" execa "^5.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^27.5.1" - jest-message-util "^27.5.1" - jest-mock "^27.5.1" - jest-regex-util "^27.5.1" - jest-resolve "^27.5.1" - jest-snapshot "^27.5.1" - jest-util "^27.5.1" + jest-haste-map "^28.1.1" + jest-message-util "^28.1.1" + jest-mock "^28.1.1" + jest-regex-util "^28.0.2" + jest-resolve "^28.1.1" + jest-snapshot "^28.1.1" + jest-util "^28.1.1" slash "^3.0.0" strip-bom "^4.0.0" -jest-serializer@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-27.5.1.tgz#81438410a30ea66fd57ff730835123dea1fb1f64" - integrity sha512-jZCyo6iIxO1aqUxpuBlwTDMkzOAJS4a3eYz3YzgxxVQFwLeSA7Jfq5cbqCY+JLvTDrWirgusI/0KwxKMgrdf7w== - dependencies: - "@types/node" "*" - graceful-fs "^4.2.9" - jest-silent-reporter@0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/jest-silent-reporter/-/jest-silent-reporter-0.5.0.tgz#5fd8ccd61665227e3bf19d908b7350719d06ff38" @@ -6259,33 +6137,34 @@ jest-silent-reporter@0.5.0: chalk "^4.0.0" jest-util "^26.0.0" -jest-snapshot@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.5.1.tgz#b668d50d23d38054a51b42c4039cab59ae6eb6a1" - integrity sha512-yYykXI5a0I31xX67mgeLw1DZ0bJB+gpq5IpSuCAoyDi0+BhgU/RIrL+RTzDmkNTchvDFWKP8lp+w/42Z3us5sA== +jest-snapshot@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-28.1.1.tgz#ab825c16c8d8b5e883bd57eee6ca8748c42ab848" + integrity sha512-1KjqHJ98adRcbIdMizjF5DipwZFbvxym/kFO4g4fVZCZRxH/dqV8TiBFCa6rqic3p0karsy8RWS1y4E07b7P0A== dependencies: - "@babel/core" "^7.7.2" + "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" - "@babel/types" "^7.0.0" - "@jest/transform" "^27.5.1" - "@jest/types" "^27.5.1" - "@types/babel__traverse" "^7.0.4" + "@babel/types" "^7.3.3" + "@jest/expect-utils" "^28.1.1" + "@jest/transform" "^28.1.1" + "@jest/types" "^28.1.1" + "@types/babel__traverse" "^7.0.6" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^27.5.1" + expect "^28.1.1" graceful-fs "^4.2.9" - jest-diff "^27.5.1" - jest-get-type "^27.5.1" - jest-haste-map "^27.5.1" - jest-matcher-utils "^27.5.1" - jest-message-util "^27.5.1" - jest-util "^27.5.1" + jest-diff "^28.1.1" + jest-get-type "^28.0.2" + jest-haste-map "^28.1.1" + jest-matcher-utils "^28.1.1" + jest-message-util "^28.1.1" + jest-util "^28.1.1" natural-compare "^1.4.0" - pretty-format "^27.5.1" - semver "^7.3.2" + pretty-format "^28.1.1" + semver "^7.3.5" jest-util@^26.0.0: version "26.6.2" @@ -6299,60 +6178,62 @@ jest-util@^26.0.0: is-ci "^2.0.0" micromatch "^4.0.2" -jest-util@^27.0.0, jest-util@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.5.1.tgz#3ba9771e8e31a0b85da48fe0b0891fb86c01c2f9" - integrity sha512-Kv2o/8jNvX1MQ0KGtw480E/w4fBCDOnH6+6DmeKi6LZUIlKA5kwY0YNdlzaWTiVgxqAqik11QyxDOKk543aKXw== +jest-util@^28.0.0, jest-util@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-28.1.1.tgz#ff39e436a1aca397c0ab998db5a51ae2b7080d05" + integrity sha512-FktOu7ca1DZSyhPAxgxB6hfh2+9zMoJ7aEQA759Z6p45NuO8mWcqujH+UdHlCm/V6JTWwDztM2ITCzU1ijJAfw== dependencies: - "@jest/types" "^27.5.1" + "@jest/types" "^28.1.1" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.5.1.tgz#9197d54dc0bdb52260b8db40b46ae668e04df067" - integrity sha512-thkNli0LYTmOI1tDB3FI1S1RTp/Bqyd9pTarJwL87OIBFuqEb5Apv5EaApEudYg4g86e3CT6kM0RowkhtEnCBQ== +jest-validate@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-28.1.1.tgz#59b7b339b3c85b5144bd0c06ad3600f503a4acc8" + integrity sha512-Kpf6gcClqFCIZ4ti5++XemYJWUPCFUW+N2gknn+KgnDf549iLul3cBuKVe1YcWRlaF8tZV8eJCap0eECOEE3Ug== dependencies: - "@jest/types" "^27.5.1" + "@jest/types" "^28.1.1" camelcase "^6.2.0" chalk "^4.0.0" - jest-get-type "^27.5.1" + jest-get-type "^28.0.2" leven "^3.1.0" - pretty-format "^27.5.1" + pretty-format "^28.1.1" -jest-watcher@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.5.1.tgz#71bd85fb9bde3a2c2ec4dc353437971c43c642a2" - integrity sha512-z676SuD6Z8o8qbmEGhoEUFOM1+jfEiL3DXHK/xgEiG2EyNYfFG60jluWcupY6dATjfEsKQuibReS1djInQnoVw== +jest-watcher@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-28.1.1.tgz#533597fb3bfefd52b5cd115cd916cffd237fb60c" + integrity sha512-RQIpeZ8EIJMxbQrXpJQYIIlubBnB9imEHsxxE41f54ZwcqWLysL/A0ZcdMirf+XsMn3xfphVQVV4EW0/p7i7Ug== dependencies: - "@jest/test-result" "^27.5.1" - "@jest/types" "^27.5.1" + "@jest/test-result" "^28.1.1" + "@jest/types" "^28.1.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - jest-util "^27.5.1" + emittery "^0.10.2" + jest-util "^28.1.1" string-length "^4.0.1" -jest-worker@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.5.1.tgz#8d146f0900e8973b106b6f73cc1e9a8cb86f8db0" - integrity sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg== +jest-worker@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-28.1.1.tgz#3480c73247171dfd01eda77200f0063ab6a3bf28" + integrity sha512-Au7slXB08C6h+xbJPp7VIb6U0XX5Kc9uel/WFc6/rcTzGiaVCBRngBExSYuXSLFPULPSYU3cJ3ybS988lNFQhQ== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^8.0.0" -jest@27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.5.1.tgz#dadf33ba70a779be7a6fc33015843b51494f63fc" - integrity sha512-Yn0mADZB89zTtjkPJEXwrac3LHudkQMR+Paqa8uxJHCBr9agxztUifWCyiYrjhMPBoUVBjyny0I7XH6ozDr7QQ== +jest@28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest/-/jest-28.1.1.tgz#3c39a3a09791e16e9ef283597d24ab19a0df701e" + integrity sha512-qw9YHBnjt6TCbIDMPMpJZqf9E12rh6869iZaN08/vpOGgHJSAaLLUn6H8W3IAEuy34Ls3rct064mZLETkxJ2XA== dependencies: - "@jest/core" "^27.5.1" + "@jest/core" "^28.1.1" + "@jest/types" "^28.1.1" import-local "^3.0.2" - jest-cli "^27.5.1" + jest-cli "^28.1.1" js-tokens@^4.0.0: version "4.0.0" @@ -6374,39 +6255,6 @@ js-yaml@^3.10.0, js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" -jsdom@^16.6.0: - version "16.7.0" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.7.0.tgz#918ae71965424b197c819f8183a754e18977b710" - integrity sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw== - dependencies: - abab "^2.0.5" - acorn "^8.2.4" - acorn-globals "^6.0.0" - cssom "^0.4.4" - cssstyle "^2.3.0" - data-urls "^2.0.0" - decimal.js "^10.2.1" - domexception "^2.0.1" - escodegen "^2.0.0" - form-data "^3.0.0" - html-encoding-sniffer "^2.0.1" - http-proxy-agent "^4.0.1" - https-proxy-agent "^5.0.0" - is-potential-custom-element-name "^1.0.1" - nwsapi "^2.2.0" - parse5 "6.0.1" - saxes "^5.0.1" - symbol-tree "^3.2.4" - tough-cookie "^4.0.0" - w3c-hr-time "^1.0.2" - w3c-xmlserializer "^2.0.0" - webidl-conversions "^6.1.0" - whatwg-encoding "^1.0.5" - whatwg-mimetype "^2.3.0" - whatwg-url "^8.5.0" - ws "^7.4.6" - xml-name-validator "^3.0.0" - jsesc@^2.5.1: version "2.5.2" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" @@ -6475,7 +6323,7 @@ json-stringify-safe@^5.0.1: resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== -json5@2.2.1, json5@2.x, json5@^2.1.3, json5@^2.2.1: +json5@2.2.1, json5@^2.1.3, json5@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c" integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA== @@ -6552,14 +6400,6 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" -levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - integrity sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA== - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - libnpmaccess@^6.0.2: version "6.0.3" resolved "https://registry.yarnpkg.com/libnpmaccess/-/libnpmaccess-6.0.3.tgz#473cc3e4aadb2bc713419d92e45d23b070d8cded" @@ -6781,7 +6621,7 @@ lodash.uniqby@^4.7.0: resolved "https://registry.yarnpkg.com/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz#d99c07a669e9e6d24e1362dfe266c67616af1302" integrity sha512-e/zcLx6CSbmaEgFHCA7BnoQKyCtKMxnuWrJygbwPs/AIn+IMKl66L8/s+wBUn5LRw2pZx3bUHibiV1b6aTWIww== -lodash@^4.17.15, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.7.0: +lodash@^4.17.15, lodash@^4.17.21, lodash@^4.17.4: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -7111,18 +6951,6 @@ micromatch@^4.0.2, micromatch@^4.0.4: braces "^3.0.2" picomatch "^2.3.1" -mime-db@1.52.0: - version "1.52.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" - integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== - -mime-types@^2.1.12: - version "2.1.35" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" - integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== - dependencies: - mime-db "1.52.0" - mime@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/mime/-/mime-3.0.0.tgz#b374550dca3a0c18443b0c950a6a58f1931cf7a7" @@ -7721,11 +7549,6 @@ nth-check@^2.0.1: dependencies: boolbase "^1.0.0" -nwsapi@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.0.tgz#204879a9e3d068ff2a55139c2c772780681a38b7" - integrity sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ== - object-inspect@^1.12.0, object-inspect@^1.9.0: version "1.12.2" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.2.tgz#c0641f26394532f28ab8d796ab954e43c009a8ea" @@ -7788,18 +7611,6 @@ openpgp@5.3.0: dependencies: asn1.js "^5.0.0" -optionator@^0.8.1: - version "0.8.3" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" - integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== - dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.6" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - word-wrap "~1.2.3" - optionator@^0.9.1: version "0.9.1" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" @@ -8038,11 +7849,6 @@ parse-url@^6.0.0: parse-path "^4.0.0" protocols "^1.4.0" -parse5@6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" - integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== - path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" @@ -8147,11 +7953,6 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - integrity sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w== - prettier@2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.2.tgz#e26d71a18a74c3d0f0597f55f01fb6c06c206032" @@ -8162,16 +7963,7 @@ pretty-bytes@^5.1.0: resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb" integrity sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg== -pretty-format@^27.0.0, pretty-format@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.5.1.tgz#2181879fdea51a7a5851fb39d920faa63f01d88e" - integrity sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ== - dependencies: - ansi-regex "^5.0.1" - ansi-styles "^5.0.0" - react-is "^17.0.1" - -pretty-format@^28.1.0, pretty-format@^28.1.1: +pretty-format@^27.0.0, pretty-format@^28.0.0, pretty-format@^28.1.0, pretty-format@^28.1.1: version "28.1.1" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-28.1.1.tgz#f731530394e0f7fcd95aba6b43c50e02d86b95cb" integrity sha512-wwJbVTGFHeucr5Jw2bQ9P+VYHyLdAqedFLEkdQUVaBF/eiidDwH5OpilINq4mEfhbCjLnirt6HTTDhv1HaTIQw== @@ -8181,6 +7973,15 @@ pretty-format@^28.1.0, pretty-format@^28.1.1: ansi-styles "^5.0.0" react-is "^18.0.0" +pretty-format@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.5.1.tgz#2181879fdea51a7a5851fb39d920faa63f01d88e" + integrity sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ== + dependencies: + ansi-regex "^5.0.1" + ansi-styles "^5.0.0" + react-is "^17.0.1" + pretty-quick@3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/pretty-quick/-/pretty-quick-3.1.3.tgz#15281108c0ddf446675157ca40240099157b638e" @@ -8278,11 +8079,6 @@ pseudomap@^1.0.2: resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" integrity sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ== -psl@^1.1.33: - version "1.8.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24" - integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ== - pump@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" @@ -8291,7 +8087,7 @@ pump@^3.0.0: end-of-stream "^1.1.0" once "^1.3.1" -punycode@^2.1.0, punycode@^2.1.1: +punycode@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== @@ -8673,7 +8469,7 @@ safe-json-stringify@~1: resolved "https://registry.yarnpkg.com/safe-json-stringify/-/safe-json-stringify-1.2.0.tgz#356e44bc98f1f93ce45df14bcd7c01cda86e0afd" integrity sha512-gH8eh2nZudPQO6TytOvbxnuhYBOvDBBLW52tz5q6X58lJcd/tkmqFR+5Z9adS8aJtURSXWThWy/xJtJwixErvg== -"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.0.2, safer-buffer@^2.1.0: +"safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.0.2, safer-buffer@^2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== @@ -8683,13 +8479,6 @@ sax@^1.2.1: resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== -saxes@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/saxes/-/saxes-5.0.1.tgz#eebab953fa3b7608dbe94e5dadb15c888fa6696d" - integrity sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw== - dependencies: - xmlchars "^2.2.0" - semantic-release@19.0.3: version "19.0.3" resolved "https://registry.yarnpkg.com/semantic-release/-/semantic-release-19.0.3.tgz#9291053ad9890052f28e7c5921d4741530d516fd" @@ -8932,24 +8721,19 @@ sort-keys@^4.2.0: dependencies: is-plain-obj "^2.0.0" -source-map-support@^0.5.6: - version "0.5.21" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" - integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== +source-map-support@0.5.13: + version "0.5.13" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932" + integrity sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" -source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: +source-map@^0.6.0, source-map@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -source-map@^0.7.3: - version "0.7.4" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656" - integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA== - spawn-error-forwarder@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/spawn-error-forwarder/-/spawn-error-forwarder-1.0.0.tgz#1afd94738e999b0346d7b9fc373be55e07577029" @@ -9208,11 +8992,6 @@ supports-preserve-symlinks-flag@^1.0.0: resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== -symbol-tree@^3.2.4: - version "3.2.4" - resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" - integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== - tar@^6.0.2, tar@^6.0.5, tar@^6.1.0, tar@^6.1.11, tar@^6.1.2: version "6.1.11" resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.11.tgz#6760a38f003afa1b2ffd0ffe9e9abbd0eab3d621" @@ -9343,22 +9122,6 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -tough-cookie@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.0.0.tgz#d822234eeca882f991f0f908824ad2622ddbece4" - integrity sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg== - dependencies: - psl "^1.1.33" - punycode "^2.1.1" - universalify "^0.1.2" - -tr46@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-2.1.0.tgz#fa87aa81ca5d5941da8cbf1f9b749dc969a4e240" - integrity sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw== - dependencies: - punycode "^2.1.1" - tr46@~0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" @@ -9394,19 +9157,19 @@ ts-essentials@^7.0.3: resolved "https://registry.yarnpkg.com/ts-essentials/-/ts-essentials-7.0.3.tgz#686fd155a02133eedcc5362dc8b5056cde3e5a38" integrity sha512-8+gr5+lqO3G84KdiTSMRLtuyJ+nTBVRKuCrK4lidMPdVeEp0uqC875uE5NMcaA7YYMN7XsNiFQuMvasF8HT/xQ== -ts-jest@27.1.5: - version "27.1.5" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.1.5.tgz#0ddf1b163fbaae3d5b7504a1e65c914a95cff297" - integrity sha512-Xv6jBQPoBEvBq/5i2TeSG9tt/nqkbpcurrEG1b+2yfBrcJelOZF9Ml6dmyMh7bcW9JyFbRYpR5rxROSlBLTZHA== +ts-jest@28.0.4: + version "28.0.4" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-28.0.4.tgz#0ab705a60fc4b9f3506f35e26edfa9e9c915c31b" + integrity sha512-S6uRDDdCJBvnZqyGjB4VCnwbQrbgdL8WPeP4jevVSpYsBaeGRQAIS08o3Svav2Ex+oXwLgJ/m7F24TNq62kA1A== dependencies: bs-logger "0.x" fast-json-stable-stringify "2.x" - jest-util "^27.0.0" - json5 "2.x" + jest-util "^28.0.0" + json5 "^2.2.1" lodash.memoize "4.x" make-error "1.x" semver "7.x" - yargs-parser "20.x" + yargs-parser "^20.x" ts-node@10.8.1: version "10.8.1" @@ -9471,13 +9234,6 @@ type-check@^0.4.0, type-check@~0.4.0: dependencies: prelude-ls "^1.2.1" -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - integrity sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg== - dependencies: - prelude-ls "~1.1.2" - type-detect@4.0.8, type-detect@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" @@ -9641,11 +9397,6 @@ universal-user-agent@^6.0.0: resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-6.0.0.tgz#3381f8503b251c0d9cd21bc1de939ec9df5480ee" integrity sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w== -universalify@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" - integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== - universalify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" @@ -9700,14 +9451,14 @@ v8-compile-cache@^2.0.3: resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== -v8-to-istanbul@^8.1.0: - version "8.1.1" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.1.1.tgz#77b752fd3975e31bbcef938f85e9bd1c7a8d60ed" - integrity sha512-FGtKtv3xIpR6BYhvgH8MI/y78oT7d8Au3ww4QIxymrCtZEh5b8gCw2siywE+puhEmuWKDtmfrvF5UlB298ut3w== +v8-to-istanbul@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.0.0.tgz#be0dae58719fc53cb97e5c7ac1d7e6d4f5b19511" + integrity sha512-HcvgY/xaRm7isYmyx+lFKA4uQmfUbN0J4M0nNItvzTvH/iQ9kW5j/t4YSR+Ge323/lrgDAWJoF46tzGQHwBHFw== dependencies: + "@jridgewell/trace-mapping" "^0.3.7" "@types/istanbul-lib-coverage" "^2.0.1" convert-source-map "^1.6.0" - source-map "^0.7.3" validate-npm-package-license@^3.0.1, validate-npm-package-license@^3.0.4: version "3.0.4" @@ -9742,26 +9493,12 @@ vfile@^4.0.0: unist-util-stringify-position "^2.0.0" vfile-message "^2.0.0" -w3c-hr-time@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd" - integrity sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ== - dependencies: - browser-process-hrtime "^1.0.0" - -w3c-xmlserializer@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz#3e7104a05b75146cc60f564380b7f683acf1020a" - integrity sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA== - dependencies: - xml-name-validator "^3.0.0" - walk-up-path@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/walk-up-path/-/walk-up-path-1.0.0.tgz#d4745e893dd5fd0dbb58dd0a4c6a33d9c9fec53e" integrity sha512-hwj/qMDUEjCU5h0xr90KGCf0tg0/LgJbmOWgrWKYlcJZM7XvquvUJZ0G/HMGr7F7OQMOUuPHWP9JpriinkAlkg== -walker@^1.0.7: +walker@^1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.8.tgz#bd498db477afe573dc04185f011d3ab8a8d7653f" integrity sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ== @@ -9785,28 +9522,6 @@ webidl-conversions@^3.0.0: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== -webidl-conversions@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-5.0.0.tgz#ae59c8a00b121543a2acc65c0434f57b0fc11aff" - integrity sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA== - -webidl-conversions@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-6.1.0.tgz#9111b4d7ea80acd40f5270d666621afa78b69514" - integrity sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w== - -whatwg-encoding@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" - integrity sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw== - dependencies: - iconv-lite "0.4.24" - -whatwg-mimetype@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" - integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== - whatwg-url@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" @@ -9815,15 +9530,6 @@ whatwg-url@^5.0.0: tr46 "~0.0.3" webidl-conversions "^3.0.0" -whatwg-url@^8.0.0, whatwg-url@^8.5.0: - version "8.7.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.7.0.tgz#656a78e510ff8f3937bc0bcbe9f5c0ac35941b77" - integrity sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg== - dependencies: - lodash "^4.7.0" - tr46 "^2.1.0" - webidl-conversions "^6.1.0" - which-boxed-primitive@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" @@ -9868,7 +9574,7 @@ wide-align@^1.1.5: dependencies: string-width "^1.0.2 || 2 || 3 || 4" -word-wrap@^1.2.3, word-wrap@~1.2.3: +word-wrap@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== @@ -9892,7 +9598,7 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== -write-file-atomic@^3.0.0, write-file-atomic@^3.0.3: +write-file-atomic@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q== @@ -9918,26 +9624,11 @@ write-yaml-file@^4.2.0: js-yaml "^4.0.0" write-file-atomic "^3.0.3" -ws@^7.4.6: - version "7.5.8" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.8.tgz#ac2729881ab9e7cbaf8787fe3469a48c5c7f636a" - integrity sha512-ri1Id1WinAX5Jqn9HejiGb8crfRio0Qgu8+MtL36rlTA6RLsMdWt1Az/19A2Qij6uSHUMphEFaTKa4WG+UNHNw== - -xml-name-validator@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" - integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== - xml@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5" integrity sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw== -xmlchars@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" - integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== - xmldoc@1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/xmldoc/-/xmldoc-1.1.2.tgz#6666e029fe25470d599cd30e23ff0d1ed50466d7" @@ -9970,11 +9661,6 @@ yaml@1.10.2, yaml@^1.10.0: resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== -yargs-parser@20.x, yargs-parser@^20.2.2, yargs-parser@^20.2.3: - version "20.2.9" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" - integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== - yargs-parser@^18.1.3: version "18.1.3" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" @@ -9983,6 +9669,16 @@ yargs-parser@^18.1.3: camelcase "^5.0.0" decamelize "^1.2.0" +yargs-parser@^20.2.2, yargs-parser@^20.2.3, yargs-parser@^20.x: + version "20.2.9" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== + +yargs-parser@^21.0.0: + version "21.0.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.0.1.tgz#0267f286c877a4f0f728fceb6f8a3e4cb95c6e35" + integrity sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg== + yargs@^16.2.0: version "16.2.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" @@ -9996,6 +9692,19 @@ yargs@^16.2.0: y18n "^5.0.5" yargs-parser "^20.2.2" +yargs@^17.3.1: + version "17.5.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.5.1.tgz#e109900cab6fcb7fd44b1d8249166feb0b36e58e" + integrity sha512-t6YAJcxDkNX7NFYiVtKvWUz8l+PaKTLiL63mJYWR2GnHq2gjEWISzsLp9wg3aY36dY1j+gfIEL3pIF+XlJJfbA== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.3" + y18n "^5.0.5" + yargs-parser "^21.0.0" + yauzl@^2.10.0: version "2.10.0" resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9" From d05e22e08132bba0796aa27d23ac8506bf08c573 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 16 Jun 2022 15:38:02 +0200 Subject: [PATCH 122/240] chore(deps): update actions/dependency-review-action action to v2 (#16101) --- .github/workflows/dependency-review.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index 0842f6ada3345e..0840379bf96296 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -12,4 +12,4 @@ jobs: uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2 - name: 'Dependency Review' - uses: actions/dependency-review-action@a9c83d3af6b9031e20feba03b904645bb23d1dab # tag=v1.0.2 + uses: actions/dependency-review-action@1c59cdf2a9c7f29c90e8da32237eb04b81bad9f0 # tag=v2.0.2 From 827d313de447478f81f183b63175417603527f33 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Thu, 16 Jun 2022 16:06:36 +0200 Subject: [PATCH 123/240] feat(manager/terraform): support multiple container images (#16107) Co-authored-by: Rhys Arkins --- .../terraform/__fixtures__/kubernetes.tf | 5 ++ lib/modules/manager/terraform/extract.spec.ts | 20 ++++- .../manager/terraform/extract/kubernetes.ts | 76 +++++++++++++++++++ .../manager/terraform/lockfile/index.spec.ts | 2 +- lib/modules/manager/terraform/resources.ts | 9 +++ 5 files changed, 108 insertions(+), 4 deletions(-) create mode 100644 lib/modules/manager/terraform/extract/kubernetes.ts diff --git a/lib/modules/manager/terraform/__fixtures__/kubernetes.tf b/lib/modules/manager/terraform/__fixtures__/kubernetes.tf index bd8e5886b4f494..cba164672a054c 100644 --- a/lib/modules/manager/terraform/__fixtures__/kubernetes.tf +++ b/lib/modules/manager/terraform/__fixtures__/kubernetes.tf @@ -11,6 +11,10 @@ resource "kubernetes_cron_job_v1" "demo" { name = "kaniko" image = "gcr.io/kaniko-project/executor:v1.7.0@sha256:8504bde9a9a8c9c4e9a4fe659703d265697a36ff13607b7669a4caa4407baa52" } + container { + name = "node" + image = "node:14" + } } } } @@ -126,6 +130,7 @@ resource "kubernetes_job" "demo_invalid" { } } } + image = "nginx:1.21.6" } } diff --git a/lib/modules/manager/terraform/extract.spec.ts b/lib/modules/manager/terraform/extract.spec.ts index e876b5bc0a56a9..cc82364c0cbdd0 100644 --- a/lib/modules/manager/terraform/extract.spec.ts +++ b/lib/modules/manager/terraform/extract.spec.ts @@ -107,8 +107,8 @@ describe('modules/manager/terraform/extract', () => { it('extracts kubernetes resources', async () => { const res = await extractPackageFile(kubernetes, 'kubernetes.tf', {}); - expect(res.deps).toHaveLength(16); - expect(res.deps.filter((dep) => dep.skipReason)).toHaveLength(2); + expect(res.deps).toHaveLength(18); + expect(res.deps.filter((dep) => dep.skipReason)).toHaveLength(1); expect(res.deps).toMatchObject([ { depName: 'gcr.io/kaniko-project/executor', @@ -117,6 +117,11 @@ describe('modules/manager/terraform/extract', () => { 'sha256:8504bde9a9a8c9c4e9a4fe659703d265697a36ff13607b7669a4caa4407baa52', depType: 'kubernetes_cron_job_v1', }, + { + depName: 'node', + currentValue: '14', + depType: 'kubernetes_cron_job_v1', + }, { depName: 'gcr.io/kaniko-project/executor', currentValue: 'v1.8.0', @@ -149,7 +154,6 @@ describe('modules/manager/terraform/extract', () => { currentValue: '1.21.5', depType: 'kubernetes_job', }, - { skipReason: 'invalid-dependency-specification' }, { skipReason: 'invalid-value' }, { depName: 'nginx', @@ -176,11 +180,21 @@ describe('modules/manager/terraform/extract', () => { currentValue: '1.21.10', depType: 'kubernetes_replication_controller_v1', }, + { + depName: 'nginx', + currentValue: '1.21.11', + depType: 'kubernetes_stateful_set', + }, { depName: 'prom/prometheus', currentValue: 'v2.2.1', depType: 'kubernetes_stateful_set', }, + { + depName: 'nginx', + currentValue: '1.21.12', + depType: 'kubernetes_stateful_set_v1', + }, { depName: 'prom/prometheus', currentValue: 'v2.2.2', diff --git a/lib/modules/manager/terraform/extract/kubernetes.ts b/lib/modules/manager/terraform/extract/kubernetes.ts new file mode 100644 index 00000000000000..dee54e8fb0e29e --- /dev/null +++ b/lib/modules/manager/terraform/extract/kubernetes.ts @@ -0,0 +1,76 @@ +import is from '@sindresorhus/is'; +import { logger } from '../../../../logger'; +import { regEx } from '../../../../util/regex'; +import type { PackageDependency } from '../../types'; +import { TerraformDependencyTypes } from '../common'; +import type { ExtractionResult, ResourceManagerData } from '../types'; +import { keyValueExtractionRegex } from '../util'; + +export function extractTerraformKubernetesResource( + startingLine: number, + lines: string[], + resourceType: string +): ExtractionResult { + let lineNumber = startingLine; + const deps: PackageDependency[] = []; + + /** + * Iterates over all lines of the resource to extract the relevant key value pairs, + * e.g. the chart name for helm charts or the terraform_version for tfe_workspace + */ + let braceCounter = 0; + let inContainer = -1; + do { + // istanbul ignore if + if (lineNumber > lines.length - 1) { + logger.debug(`Malformed Terraform file detected.`); + } + + const line = lines[lineNumber]; + + // istanbul ignore else + if (is.string(line)) { + // `{` will be counted with +1 and `}` with -1. Therefore if we reach braceCounter == 0. We have found the end of the terraform block + const openBrackets = (line.match(regEx(/\{/g)) || []).length; + const closedBrackets = (line.match(regEx(/\}/g)) || []).length; + braceCounter = braceCounter + openBrackets - closedBrackets; + + if (line.match(regEx(/^\s*(?:init_)?container(?:\s*\{|$)/s))) { + inContainer = braceCounter; + } else if (braceCounter < inContainer) { + inContainer = -1; + } + + const managerData: ResourceManagerData = { + terraformDependencyType: TerraformDependencyTypes.resource, + resourceType, + }; + const dep: PackageDependency = { + managerData, + }; + + const kvMatch = keyValueExtractionRegex.exec(line); + if (kvMatch?.groups && inContainer > 0) { + switch (kvMatch.groups.key) { + case 'image': + managerData[kvMatch.groups.key] = kvMatch.groups.value; + managerData.sourceLine = lineNumber; + deps.push(dep); + break; + default: + /* istanbul ignore next */ + break; + } + } + } else { + // stop - something went wrong + braceCounter = 0; + inContainer = -1; + } + lineNumber += 1; + } while (braceCounter !== 0); + + // remove last lineNumber addition to not skip a line after the last bracket + lineNumber -= 1; + return { lineNumber, dependencies: deps }; +} diff --git a/lib/modules/manager/terraform/lockfile/index.spec.ts b/lib/modules/manager/terraform/lockfile/index.spec.ts index 3aa366621aa7fe..350666da081dde 100644 --- a/lib/modules/manager/terraform/lockfile/index.spec.ts +++ b/lib/modules/manager/terraform/lockfile/index.spec.ts @@ -3,8 +3,8 @@ import { fs, loadFixture, mocked } from '../../../../../test/util'; import { GlobalConfig } from '../../../../config/global'; import { getPkgReleases } from '../../../datasource'; import type { UpdateArtifactsConfig } from '../../types'; +import { updateArtifacts } from '../index'; import { TerraformProviderHash } from './hash'; -import { updateArtifacts } from './index'; // auto-mock fs jest.mock('../../../../util/fs'); diff --git a/lib/modules/manager/terraform/resources.ts b/lib/modules/manager/terraform/resources.ts index 9811c8f1041961..c691e940e7fe52 100644 --- a/lib/modules/manager/terraform/resources.ts +++ b/lib/modules/manager/terraform/resources.ts @@ -5,6 +5,7 @@ import { HelmDatasource } from '../../datasource/helm'; import { getDep } from '../dockerfile/extract'; import type { PackageDependency } from '../types'; import { TerraformDependencyTypes, TerraformResourceTypes } from './common'; +import { extractTerraformKubernetesResource } from './extract/kubernetes'; import { analyseTerraformVersion } from './required-version'; import type { ExtractionResult, ResourceManagerData } from './types'; import { @@ -46,6 +47,14 @@ export function extractTerraformResource( return TerraformResourceTypes[key].includes(resourceType); }); + if (isKnownType && resourceType.startsWith('kubernetes_')) { + return extractTerraformKubernetesResource( + startingLine, + lines, + resourceType + ); + } + managerData.resourceType = isKnownType ? resourceType : TerraformResourceTypes.unknown[0]; From ffe8cfba7b2c14043b7df0d234ae9b57a52673e3 Mon Sep 17 00:00:00 2001 From: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Date: Thu, 16 Jun 2022 18:03:50 +0200 Subject: [PATCH 124/240] ci(jest): use built-in github action reporter (#16109) --- jest.config.ts | 2 +- package.json | 1 - yarn.lock | 9 +-------- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/jest.config.ts b/jest.config.ts index 60490b835e4a80..cc25f456ac5271 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -25,7 +25,7 @@ const config: InitialOptionsTsJest = { }, }, modulePathIgnorePatterns: ['/dist/', '/__fixtures__/'], - reporters: ci ? ['default', 'jest-github-actions-reporter'] : ['default'], + reporters: ci ? ['default', 'github-actions'] : ['default'], setupFilesAfterEnv: [ 'jest-extended/all', 'expect-more-jest', diff --git a/package.json b/package.json index bedf90aa169d45..37c420fbea2b2c 100644 --- a/package.json +++ b/package.json @@ -280,7 +280,6 @@ "husky": "8.0.1", "jest": "28.1.1", "jest-extended": "2.0.0", - "jest-github-actions-reporter": "1.0.3", "jest-junit": "13.2.0", "jest-mock-extended": "2.0.6", "jest-silent-reporter": "0.5.0", diff --git a/yarn.lock b/yarn.lock index d48a9cb79c8b72..2da788f34fe948 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,7 +2,7 @@ # yarn lockfile v1 -"@actions/core@1.8.2", "@actions/core@^1.2.0", "@actions/core@^1.2.6": +"@actions/core@1.8.2", "@actions/core@^1.2.6": version "1.8.2" resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.8.2.tgz#67539d669ae9b751430469e9ae4d83e0525973ac" integrity sha512-FXcBL7nyik8K5ODeCKlxi+vts7torOkoDAKfeh61EAkAy1HAvwn9uVzZBY0f15YcQTcZZ2/iSGBFHEuioZWfDA== @@ -5947,13 +5947,6 @@ jest-get-type@^28.0.2: resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-28.0.2.tgz#34622e628e4fdcd793d46db8a242227901fcf203" integrity sha512-ioj2w9/DxSYHfOm5lJKCdcAmPJzQXmbM/Url3rhlghrPvT3tt+7a/+oXc9azkKmLvoiXjtV83bEWqi+vs5nlPA== -jest-github-actions-reporter@1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/jest-github-actions-reporter/-/jest-github-actions-reporter-1.0.3.tgz#6aa2b3a6599352e1043bbe42628a7f73a1ce48c2" - integrity sha512-IwLAKLSWLN8ZVfcfEEv6rfeWb78wKDeOhvOmH9KKXayKsKLSCwceopBcB+KUtwxfB5wYnT8Y9s2eZ+WdhA5yng== - dependencies: - "@actions/core" "^1.2.0" - jest-haste-map@^28.1.1: version "28.1.1" resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-28.1.1.tgz#471685f1acd365a9394745bb97c8fc16289adca3" From abe821ac4dfcf4664c250560248cd7160dcc0eeb Mon Sep 17 00:00:00 2001 From: RahulGautamSingh Date: Thu, 16 Jun 2022 21:48:36 +0530 Subject: [PATCH 125/240] refactor: update WorkerExtractConfig type definition (#16020) * update WorkerExtractConfig types * update comment * move worker-extract * update CustomManager * move interface RegExManagerTemplates manager->config * fix import error * rename CustomManager -> RegExManager * fix lint error --- lib/config/types.ts | 27 +++++++++---------- lib/modules/manager/regex/index.ts | 2 +- lib/modules/manager/regex/utils.ts | 7 ++--- lib/modules/manager/types.ts | 9 +------ lib/workers/repository/extract/index.ts | 7 ++--- .../repository/extract/manager-files.ts | 2 +- lib/workers/types.ts | 17 ++++++++++++ 7 files changed, 37 insertions(+), 34 deletions(-) diff --git a/lib/config/types.ts b/lib/config/types.ts index 962e19bbef215f..9d8e742462cd3f 100644 --- a/lib/config/types.ts +++ b/lib/config/types.ts @@ -1,6 +1,5 @@ import type { LogLevel } from 'bunyan'; import type { Range } from 'semver'; -import type { ExtractConfig } from '../modules/manager/types'; import type { HostRule } from '../types'; import type { GitNoVerifyOption } from '../util/git/types'; @@ -161,15 +160,21 @@ export type RenovateRepository = repository: string; secrets?: Record; }; - -export interface CustomManager { - fileMatch: string[]; - matchStrings: string[]; - matchStringsStrategy?: string; +export interface RegexManagerTemplates { depNameTemplate?: string; - datasourceTemplate?: string; packageNameTemplate?: string; + datasourceTemplate?: string; versioningTemplate?: string; + depTypeTemplate?: string; + currentValueTemplate?: string; + currentDigestTemplate?: string; + extractVersionTemplate?: string; + registryUrlTemplate?: string; +} +export interface RegExManager extends RegexManagerTemplates { + fileMatch: string[]; + matchStrings: string[]; + matchStringsStrategy?: string; autoReplaceStringTemplate?: string; } @@ -228,7 +233,7 @@ export interface RenovateConfig warnings?: ValidationMessage[]; vulnerabilityAlerts?: RenovateSharedConfig; - regexManagers?: CustomManager[]; + regexManagers?: RegExManager[]; fetchReleaseNotes?: boolean; secrets?: Record; @@ -446,12 +451,6 @@ export interface ManagerConfig extends RenovateConfig { language?: string | null; } -export interface WorkerExtractConfig extends ExtractConfig { - manager: string; - enabled?: boolean; - fileList: string[]; -} - export interface ValidationResult { errors: ValidationMessage[]; warnings: ValidationMessage[]; diff --git a/lib/modules/manager/regex/index.ts b/lib/modules/manager/regex/index.ts index 3559e1e3e6420e..6a316d9b17fb93 100644 --- a/lib/modules/manager/regex/index.ts +++ b/lib/modules/manager/regex/index.ts @@ -1,9 +1,9 @@ import is from '@sindresorhus/is'; +import type { RegexManagerTemplates } from '../../../config/types'; import type { CustomExtractConfig, PackageDependency, PackageFile, - RegexManagerTemplates, Result, } from '../types'; import { handleAny, handleCombination, handleRecursive } from './strategies'; diff --git a/lib/modules/manager/regex/utils.ts b/lib/modules/manager/regex/utils.ts index 65bab48385dc7a..772c52ccb59654 100644 --- a/lib/modules/manager/regex/utils.ts +++ b/lib/modules/manager/regex/utils.ts @@ -1,11 +1,8 @@ import { URL } from 'url'; +import type { RegexManagerTemplates } from '../../../config/types'; import { logger } from '../../../logger'; import * as template from '../../../util/template'; -import type { - CustomExtractConfig, - PackageDependency, - RegexManagerTemplates, -} from '../types'; +import type { CustomExtractConfig, PackageDependency } from '../types'; import type { ExtractionTemplate } from './types'; export const validMatchFields = [ diff --git a/lib/modules/manager/types.ts b/lib/modules/manager/types.ts index 16204ecc6308db..0cfd1326450b06 100644 --- a/lib/modules/manager/types.ts +++ b/lib/modules/manager/types.ts @@ -1,6 +1,7 @@ import type { ReleaseType } from 'semver'; import type { MatchStringsStrategy, + RegexManagerTemplates, UpdateType, ValidationMessage, } from '../../config/types'; @@ -21,14 +22,6 @@ export interface ExtractConfig { skipInstalls?: boolean; } -export interface RegexManagerTemplates { - depNameTemplate?: string; - packageNameTemplate?: string; - datasourceTemplate?: string; - versioningTemplate?: string; - depTypeTemplate?: string; -} - export interface CustomExtractConfig extends ExtractConfig, RegexManagerTemplates { diff --git a/lib/workers/repository/extract/index.ts b/lib/workers/repository/extract/index.ts index 11e228e8466b9d..3aa2642ac1b8fd 100644 --- a/lib/workers/repository/extract/index.ts +++ b/lib/workers/repository/extract/index.ts @@ -1,14 +1,11 @@ import is from '@sindresorhus/is'; import { getManagerConfig, mergeChildConfig } from '../../../config'; -import type { - ManagerConfig, - RenovateConfig, - WorkerExtractConfig, -} from '../../../config/types'; +import type { ManagerConfig, RenovateConfig } from '../../../config/types'; import { logger } from '../../../logger'; import { getManagerList } from '../../../modules/manager'; import type { PackageFile } from '../../../modules/manager/types'; import { getFileList } from '../../../util/git'; +import type { WorkerExtractConfig } from '../../types'; import { getMatchingFiles } from './file-match'; import { getManagerPackageFiles } from './manager-files'; diff --git a/lib/workers/repository/extract/manager-files.ts b/lib/workers/repository/extract/manager-files.ts index 79a16b4543a348..d45d06de85f270 100644 --- a/lib/workers/repository/extract/manager-files.ts +++ b/lib/workers/repository/extract/manager-files.ts @@ -1,5 +1,4 @@ import is from '@sindresorhus/is'; -import type { WorkerExtractConfig } from '../../../config/types'; import { logger } from '../../../logger'; import { extractAllPackageFiles, @@ -8,6 +7,7 @@ import { } from '../../../modules/manager'; import type { PackageFile } from '../../../modules/manager/types'; import { readLocalFile } from '../../../util/fs'; +import type { WorkerExtractConfig } from '../../types'; export async function getManagerPackageFiles( config: WorkerExtractConfig diff --git a/lib/workers/types.ts b/lib/workers/types.ts index 9abae80d8831f8..8e94d85a80d7ec 100644 --- a/lib/workers/types.ts +++ b/lib/workers/types.ts @@ -2,6 +2,7 @@ import type { Merge } from 'type-fest'; import type { GroupConfig, LegacyAdminConfig, + RegExManager, RenovateConfig, RenovateSharedConfig, ValidationMessage, @@ -9,6 +10,8 @@ import type { import type { Release } from '../modules/datasource/types'; import type { ArtifactError, + CustomExtractConfig, + ExtractConfig, LookupUpdate, PackageDependency, PackageFile, @@ -123,3 +126,17 @@ export interface BranchConfig stopUpdating?: boolean; isConflicted?: boolean; } + +export interface WorkerExtractConfig + extends ExtractConfig, + Partial { + manager: string; + fileList: string[]; + fileMatch?: string[]; + updateInternalDeps?: boolean; + includePaths?: string[]; + ignorePaths?: string[]; + regexManagers?: RegExManager[]; + enabledManagers?: string[]; + enabled?: boolean; +} From c84199885dc99239a3e8fe912b5835596ff86d2f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 17 Jun 2022 06:12:08 +0200 Subject: [PATCH 126/240] chore(deps): update dependency aws-sdk-client-mock to v1 (#16102) --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 37c420fbea2b2c..982abb407cc730 100644 --- a/package.json +++ b/package.json @@ -259,7 +259,7 @@ "@types/xmldoc": "1.1.6", "@typescript-eslint/eslint-plugin": "5.27.1", "@typescript-eslint/parser": "5.27.1", - "aws-sdk-client-mock": "0.6.2", + "aws-sdk-client-mock": "1.0.0", "callsite": "1.0.0", "conventional-changelog-conventionalcommits": "5.0.0", "cross-env": "7.0.3", diff --git a/yarn.lock b/yarn.lock index 2da788f34fe948..5b327271ea54ab 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3221,10 +3221,10 @@ available-typed-arrays@^1.0.5: resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== -aws-sdk-client-mock@0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/aws-sdk-client-mock/-/aws-sdk-client-mock-0.6.2.tgz#2880d7a7a7e9fcaaf7abdfc01a0f6f22551bc654" - integrity sha512-0kH1cyfqGogp69vJitzVducx9q691vGOwg7wEG+DUegGlepjaeskp6YG4SJI0y5Vwh3vi+fP27YQTcWllv4GlQ== +aws-sdk-client-mock@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/aws-sdk-client-mock/-/aws-sdk-client-mock-1.0.0.tgz#d52c70562ae0ff44ac07a4ef4611ff420681abff" + integrity sha512-qd7TJXI1nplTXNh8NdIEwFyHTnNRdUcGDUAEmWW55j9dZg6AGB9zgkzgu9yWCEkAWnpxRIc48ajE8H5FFeioVw== dependencies: "@types/sinon" "10.0.10" sinon "^11.1.1" From 00527902e2228fd04cdc823c3b61292942e319a9 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Fri, 17 Jun 2022 08:37:25 +0200 Subject: [PATCH 127/240] chore: fix lint (#16120) --- test/to-migrate.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/to-migrate.ts b/test/to-migrate.ts index b94958e9223a25..06f43617ff4d69 100644 --- a/test/to-migrate.ts +++ b/test/to-migrate.ts @@ -24,7 +24,9 @@ expect.extend({ CustomMigration: MigrationConstructor, originalConfig: RenovateConfig, expectedConfig: RenovateConfig, - isMigrated = true + // not inferrable type https://github.com/typescript-eslint/typescript-eslint/issues/5199 + // eslint-disable-next-line @typescript-eslint/no-inferrable-types + isMigrated: boolean = true ) { class CustomMigrationsService extends MigrationsService { protected static override getMigrations( From 39f2b398b6f44fb3e96436537a161a08da5add7c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 17 Jun 2022 13:39:10 +0000 Subject: [PATCH 128/240] build(deps): update dependency find-packages to v9.0.3 (#16127) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 42 +++++++++++++++++++++--------------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/package.json b/package.json index 982abb407cc730..c7f3e621a79a74 100644 --- a/package.json +++ b/package.json @@ -165,7 +165,7 @@ "emojibase-regex": "6.0.1", "extract-zip": "2.0.1", "fast-safe-stringify": "2.1.1", - "find-packages": "9.0.2", + "find-packages": "9.0.3", "find-up": "5.0.0", "fs-extra": "10.1.0", "git-url-parse": "11.6.0", diff --git a/yarn.lock b/yarn.lock index 5b327271ea54ab..c62e9bc3b5713f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2048,15 +2048,15 @@ dependencies: graceful-fs "^4.2.6" -"@pnpm/read-project-manifest@3.0.2": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@pnpm/read-project-manifest/-/read-project-manifest-3.0.2.tgz#92611664b2caa93d385369e1df77fd0b33d01e21" - integrity sha512-v0gayZ6KbGsbhbWDC1j60HkEmsirdORKymRCvga1vPubE9Zo1vtYwzfHk20kJASvav5B4xEV7iDspn8uS34fOQ== +"@pnpm/read-project-manifest@3.0.3": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@pnpm/read-project-manifest/-/read-project-manifest-3.0.3.tgz#bd0b31c0974ca45f66a13fec8c31d332c7cbd959" + integrity sha512-gkiv/CrU/cM4iPrqRThAp3c/gBAe8qwNnK4pXYmeqTeKe+Wnzrjpg9x4l0L+jYPpV2I/OvmucMnU3a5anMRksQ== dependencies: "@pnpm/error" "3.0.1" "@pnpm/graceful-fs" "2.0.0" - "@pnpm/types" "8.0.1" - "@pnpm/write-project-manifest" "3.0.1" + "@pnpm/types" "8.1.0" + "@pnpm/write-project-manifest" "3.0.2" detect-indent "^6.0.0" fast-deep-equal "^3.1.3" is-windows "^1.0.2" @@ -2066,17 +2066,17 @@ sort-keys "^4.2.0" strip-bom "^4.0.0" -"@pnpm/types@8.0.1": - version "8.0.1" - resolved "https://registry.yarnpkg.com/@pnpm/types/-/types-8.0.1.tgz#695620221d4c75ac006d1033c87d05e2fd23759f" - integrity sha512-2CdIXHvUvTXo/R+rFthQhQw3MdppvXOVl2QXDDjRPgNR8i6HemYceYqgBZ24alXJqmLzTsnuLKBXPdwiLq6nlA== +"@pnpm/types@8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@pnpm/types/-/types-8.1.0.tgz#14488c184230aafae14886720bfc04871c95ad71" + integrity sha512-1AnX21D0vDE2yiNT85EWY9mEASgfPPNDun3bknLWULNjTfGCfiItZcTfmW4+hUgvFcoIW5PiTkpjxSMzHJ2BvA== -"@pnpm/write-project-manifest@3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@pnpm/write-project-manifest/-/write-project-manifest-3.0.1.tgz#c3943039f6ad45e2fb6d8be9f597f2ac34e707ea" - integrity sha512-zu6yNmiT6Ipmm/ULrjs+iVErj0R1+PnaYLwAElCdLNhsJ6YHvOy7RRdjyAj7nPmChNode7CZbdQg8Bt0cgyO0w== +"@pnpm/write-project-manifest@3.0.2": + version "3.0.2" + resolved "https://registry.yarnpkg.com/@pnpm/write-project-manifest/-/write-project-manifest-3.0.2.tgz#c7b52727c3bdbf91159ed021d7253c876c9923a4" + integrity sha512-+yJQaoSkM9Nfaj5Zf/whAWwYkVwn4XFMdIV9xklJiScSf3Qd9QpFBdi2NIlxxgZwC9eEQSwj6xO3Z+jnPpyl4w== dependencies: - "@pnpm/types" "8.0.1" + "@pnpm/types" "8.1.0" json5 "^2.1.3" write-file-atomic "^3.0.3" write-yaml-file "^4.2.0" @@ -4783,13 +4783,13 @@ filter-obj@^1.1.0: resolved "https://registry.yarnpkg.com/filter-obj/-/filter-obj-1.1.0.tgz#9b311112bc6c6127a16e016c6c5d7f19e0805c5b" integrity sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ== -find-packages@9.0.2: - version "9.0.2" - resolved "https://registry.yarnpkg.com/find-packages/-/find-packages-9.0.2.tgz#aef17f954069679dd471900c07f4fb6f77b66b13" - integrity sha512-C8CXm4ns4Vb03yHqRyr2dRMyF1/E7dyBPMvgF0kVpC2dS4pDoqzDQbxWgzTm1ySqhYTmo2i0iiaBojnzVop/VQ== +find-packages@9.0.3: + version "9.0.3" + resolved "https://registry.yarnpkg.com/find-packages/-/find-packages-9.0.3.tgz#bd2e18a056a83a3c6a4dea54b15964e6065d20a3" + integrity sha512-GkH9OzuxG4s4IkHKukmrKu7pAL2NGGI9TCCskRpUCiWjLfiSoezWJPmqMV8xafH9pxw73gkmWAG2pZqsVSWZ9Q== dependencies: - "@pnpm/read-project-manifest" "3.0.2" - "@pnpm/types" "8.0.1" + "@pnpm/read-project-manifest" "3.0.3" + "@pnpm/types" "8.1.0" fast-glob "^3.2.4" p-filter "^2.1.0" From 4ee68db4c04e763fc642fdbdd13994fb2e0ce5af Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 18 Jun 2022 02:09:18 +0000 Subject: [PATCH 129/240] chore(deps): update node.js to 5a9f04f (#16131) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .devcontainer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 62f5a96865a2c4..38ff4b752b4ab9 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM containerbase/node:14.19.3@sha256:955d6ad675a7d06aca889eab947917573285fc781ea843cec5e0bffd38c7fb11 +FROM containerbase/node:14.19.3@sha256:5a9f04fac80c82662be7bf2e28d22e1c5b1dbd6e3c17eca804ddef539d504f64 USER root From df70d37141826d27715cc573806dec788e14880b Mon Sep 17 00:00:00 2001 From: wwuck <301402+wwuck@users.noreply.github.com> Date: Sat, 18 Jun 2022 16:15:10 +1000 Subject: [PATCH 130/240] fix(pypi): package name with periods (#15867) --- .../pypi/__fixtures__/versions-html-with-periods.html | 4 ++-- lib/modules/datasource/pypi/index.ts | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/modules/datasource/pypi/__fixtures__/versions-html-with-periods.html b/lib/modules/datasource/pypi/__fixtures__/versions-html-with-periods.html index 846d72d71b430b..e91932715c4c10 100644 --- a/lib/modules/datasource/pypi/__fixtures__/versions-html-with-periods.html +++ b/lib/modules/datasource/pypi/__fixtures__/versions-html-with-periods.html @@ -7,6 +7,6 @@

Links for package.with.periods

package.with.periods-2.0.0.tar.gz
package.with.periods-2.0.1-py3-none-any.whl
- package.with.periods-2.0.2-py3-none-any.whl
+ package_with_periods-2.0.2-py3-none-any.whl
package.with.periods-2.0.2.tar.gz
- \ No newline at end of file + diff --git a/lib/modules/datasource/pypi/index.ts b/lib/modules/datasource/pypi/index.ts index 03511271f5f4e0..be28036a106522 100644 --- a/lib/modules/datasource/pypi/index.ts +++ b/lib/modules/datasource/pypi/index.ts @@ -181,11 +181,18 @@ export class PypiDatasource extends Datasource { // pep-0427 wheel packages // {distribution}-{version}(-{build tag})?-{python tag}-{abi tag}-{platform tag}.whl. + // Also match the current wheel spec + // https://packaging.python.org/en/latest/specifications/binary-distribution-format/#escaping-and-unicode + // where any of -_. characters in {distribution} are replaced with _ const wheelText = text.toLowerCase(); - const wheelPrefix = packageName.replace(regEx(/[^\w\d.]+/g), '_') + '-'; + const wheelPrefixWithPeriod = + packageName.replace(regEx(/[^\w\d.]+/g), '_') + '-'; + const wheelPrefixWithoutPeriod = + packageName.replace(regEx(/[^\w\d]+/g), '_') + '-'; const wheelSuffix = '.whl'; if ( - wheelText.startsWith(wheelPrefix) && + (wheelText.startsWith(wheelPrefixWithPeriod) || + wheelText.startsWith(wheelPrefixWithoutPeriod)) && wheelText.endsWith(wheelSuffix) && wheelText.split('-').length > 2 ) { From 7f51e58a06566d211b949aaa64f03fe20658d1a8 Mon Sep 17 00:00:00 2001 From: Gabriel-Ladzaretti <97394622+Gabriel-Ladzaretti@users.noreply.github.com> Date: Sat, 18 Jun 2022 14:35:43 +0300 Subject: [PATCH 131/240] fix(core/config): Log cached repo config filename and content (#16134) --- .../repository/onboarding/branch/check.ts | 4 +++ .../onboarding/branch/index.spec.ts | 29 +++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/lib/workers/repository/onboarding/branch/check.ts b/lib/workers/repository/onboarding/branch/check.ts index 7717a1ae85eb67..911092d953f6a5 100644 --- a/lib/workers/repository/onboarding/branch/check.ts +++ b/lib/workers/repository/onboarding/branch/check.ts @@ -76,6 +76,10 @@ export const isOnboarded = async (config: RenovateConfig): Promise => { configFileContent.renovate ) { logger.debug('Existing config file confirmed'); + logger.debug( + { fileName: cache.configFileName, config: configFileContent }, + 'Repository config' + ); return true; } } diff --git a/lib/workers/repository/onboarding/branch/index.spec.ts b/lib/workers/repository/onboarding/branch/index.spec.ts index 98a55a94d0ac29..ad8d1074a77e37 100644 --- a/lib/workers/repository/onboarding/branch/index.spec.ts +++ b/lib/workers/repository/onboarding/branch/index.spec.ts @@ -12,6 +12,7 @@ import { REPOSITORY_FORKED, REPOSITORY_NO_PACKAGE_FILES, } from '../../../../constants/error-messages'; +import { logger } from '../../../../logger'; import type { Pr } from '../../../../modules/platform'; import { PrState } from '../../../../types'; import * as _cache from '../../../../util/cache/repository'; @@ -165,6 +166,19 @@ describe('workers/repository/onboarding/branch/index', () => { cache.getCache.mockReturnValue({ configFileName: '.renovaterc' }); platform.getJsonFile.mockResolvedValueOnce({}); const res = await checkOnboardingBranch(config); + expect(logger.debug).toHaveBeenCalledWith( + 'Checking cached config file name' + ); + expect(logger.debug).toHaveBeenCalledWith( + 'Existing config file confirmed' + ); + expect(logger.debug).toHaveBeenCalledWith( + { + fileName: '.renovaterc', + config: {}, + }, + 'Repository config' + ); expect(res.repoIsOnboarded).toBeTrue(); }); @@ -173,6 +187,21 @@ describe('workers/repository/onboarding/branch/index', () => { platform.getJsonFile.mockResolvedValueOnce({ renovate: {} }); fs.readLocalFile.mockResolvedValueOnce('{}'); const res = await checkOnboardingBranch(config); + expect(logger.debug).toHaveBeenCalledWith( + 'Checking cached config file name' + ); + expect(logger.debug).toHaveBeenCalledWith( + 'Existing config file confirmed' + ); + expect(logger.debug).toHaveBeenCalledWith( + { + fileName: 'package.json', + config: { + renovate: {}, + }, + }, + 'Repository config' + ); expect(res.repoIsOnboarded).toBeTrue(); }); From dd3598c5b88a67032a40ad6a34f399274095ce3d Mon Sep 17 00:00:00 2001 From: Gabriel-Ladzaretti <97394622+Gabriel-Ladzaretti@users.noreply.github.com> Date: Sat, 18 Jun 2022 15:12:31 +0300 Subject: [PATCH 132/240] feat(config/migration): migrate config with a PR (#15122) Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Co-authored-by: Michael Kriese Co-authored-by: Rhys Arkins --- docs/usage/configuration-options.md | 25 ++ lib/config/options/index.ts | 7 + lib/config/types.ts | 5 + lib/util/template/index.ts | 3 + .../branch/__fixtures__/migrated-data.json | 4 + .../branch/__fixtures__/migrated-data.json5 | 4 + .../branch/__fixtures__/migrated.json | 20 ++ .../branch/__fixtures__/renovate.json | 19 ++ .../branch/__fixtures__/renovate.json5 | 19 ++ .../config-migration/branch/commit-message.ts | 46 ++++ .../config-migration/branch/create.spec.ts | 179 +++++++++++++ .../config-migration/branch/create.ts | 43 +++ .../config-migration/branch/index.spec.ts | 98 +++++++ .../config-migration/branch/index.ts | 46 ++++ .../branch/migrated-data.spec.ts | 113 ++++++++ .../config-migration/branch/migrated-data.ts | 76 ++++++ .../config-migration/branch/rebase.spec.ts | 76 ++++++ .../config-migration/branch/rebase.ts | 52 ++++ .../repository/config-migration/common.ts | 8 + .../pr/__fixtures__/migrated-data.json | 4 + .../pr/__snapshots__/index.spec.ts.snap | 92 +++++++ .../pr/errors-warnings.spec.ts | 57 ++++ .../config-migration/pr/errors-warnings.ts | 28 ++ .../config-migration/pr/index.spec.ts | 244 ++++++++++++++++++ .../repository/config-migration/pr/index.ts | 151 +++++++++++ lib/workers/repository/finalise/index.ts | 15 ++ tsconfig.strict.json | 1 + 27 files changed, 1435 insertions(+) create mode 100644 lib/workers/repository/config-migration/branch/__fixtures__/migrated-data.json create mode 100644 lib/workers/repository/config-migration/branch/__fixtures__/migrated-data.json5 create mode 100644 lib/workers/repository/config-migration/branch/__fixtures__/migrated.json create mode 100644 lib/workers/repository/config-migration/branch/__fixtures__/renovate.json create mode 100644 lib/workers/repository/config-migration/branch/__fixtures__/renovate.json5 create mode 100644 lib/workers/repository/config-migration/branch/commit-message.ts create mode 100644 lib/workers/repository/config-migration/branch/create.spec.ts create mode 100644 lib/workers/repository/config-migration/branch/create.ts create mode 100644 lib/workers/repository/config-migration/branch/index.spec.ts create mode 100644 lib/workers/repository/config-migration/branch/index.ts create mode 100644 lib/workers/repository/config-migration/branch/migrated-data.spec.ts create mode 100644 lib/workers/repository/config-migration/branch/migrated-data.ts create mode 100644 lib/workers/repository/config-migration/branch/rebase.spec.ts create mode 100644 lib/workers/repository/config-migration/branch/rebase.ts create mode 100644 lib/workers/repository/config-migration/common.ts create mode 100644 lib/workers/repository/config-migration/pr/__fixtures__/migrated-data.json create mode 100644 lib/workers/repository/config-migration/pr/__snapshots__/index.spec.ts.snap create mode 100644 lib/workers/repository/config-migration/pr/errors-warnings.spec.ts create mode 100644 lib/workers/repository/config-migration/pr/errors-warnings.ts create mode 100644 lib/workers/repository/config-migration/pr/index.spec.ts create mode 100644 lib/workers/repository/config-migration/pr/index.ts diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index 008fdbc6945275..c7857be4a46835 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -417,6 +417,31 @@ If enabled, all issues created by Renovate are set as confidential, even in a pu !!! note This option is applicable to GitLab only. +## configMigration + +If enabled, Renovate will raise a pull request if config file migration is needed. + +We're adding new features to Renovate bot often. +Most times you can keep using your Renovate config and benefit from the new features right away. +But sometimes you need to change your Renovate configuration. +To help you with this, Renovate will create config migration pull requests. + +Example: + +After we changed the [`baseBranches`](https://docs.renovatebot.com/configuration-options/#basebranches) feature, the Renovate configuration migration pull request would make this change: + +```diff +{ +- "baseBranch": "main" ++ "baseBranches": ["main"] +} +``` + + +!!! info + This feature writes plain JSON for `.json` files, and JSON5 for `.json5` files. + JSON5 content can potentially be down leveled (`.json` files) and all comments will be removed. + ## configWarningReuseIssue Renovate's default behavior is to reuse/reopen a single Config Warning issue in each repository so as to keep the "noise" down. diff --git a/lib/config/options/index.ts b/lib/config/options/index.ts index 9b1692ed1fde63..af5c1e2f3eaeaf 100644 --- a/lib/config/options/index.ts +++ b/lib/config/options/index.ts @@ -123,6 +123,13 @@ const options: RenovateOptions[] = [ globalOnly: true, cli: false, }, + { + name: 'configMigration', + description: 'Enable this to get config migration PRs when needed.', + stage: 'repository', + type: 'boolean', + default: false, + }, { name: 'productLinks', description: 'Links which are used in PRs, issues and comments.', diff --git a/lib/config/types.ts b/lib/config/types.ts index 9d8e742462cd3f..d21e6292a9469e 100644 --- a/lib/config/types.ts +++ b/lib/config/types.ts @@ -186,6 +186,7 @@ export interface RenovateConfig RenovateSharedConfig, UpdateConfig, AssigneesAndReviewersConfig, + ConfigMigration, Record { depName?: string; baseBranches?: string[]; @@ -431,6 +432,10 @@ export interface PackageRuleInputConfig extends Record { packageRules?: (PackageRule & PackageRuleInputConfig)[]; } +export interface ConfigMigration { + configMigration?: boolean; +} + export interface MigratedConfig { isMigrated: boolean; migratedConfig: RenovateConfig; diff --git a/lib/util/template/index.ts b/lib/util/template/index.ts index c4717f6fe3aa5f..6fedb3617249dd 100644 --- a/lib/util/template/index.ts +++ b/lib/util/template/index.ts @@ -143,6 +143,9 @@ const prBodyFields = [ 'table', 'notes', 'changelogs', + 'hasWarningsErrors', + 'errors', + 'warnings', 'configDescription', 'controls', 'footer', diff --git a/lib/workers/repository/config-migration/branch/__fixtures__/migrated-data.json b/lib/workers/repository/config-migration/branch/__fixtures__/migrated-data.json new file mode 100644 index 00000000000000..9febe12a31cb7f --- /dev/null +++ b/lib/workers/repository/config-migration/branch/__fixtures__/migrated-data.json @@ -0,0 +1,4 @@ +{ + "filename": "renovate.json", + "content": "{\n \"extends\": [\n \":separateMajorReleases\",\n \":prImmediately\",\n \":renovatePrefix\",\n \":semanticPrefixFixDepsChoreOthers\",\n \":updateNotScheduled\",\n \":automergeDisabled\",\n \":maintainLockFilesDisabled\",\n \":autodetectPinVersions\",\n \"group:monorepos\"\n ],\n \"onboarding\": false,\n \"rangeStrategy\": \"replace\",\n \"semanticCommits\": \"enabled\",\n \"timezone\": \"US/Central\",\n \"baseBranches\": [\n \"main\"\n ]\n}\n" +} diff --git a/lib/workers/repository/config-migration/branch/__fixtures__/migrated-data.json5 b/lib/workers/repository/config-migration/branch/__fixtures__/migrated-data.json5 new file mode 100644 index 00000000000000..0540d1f8ccb642 --- /dev/null +++ b/lib/workers/repository/config-migration/branch/__fixtures__/migrated-data.json5 @@ -0,0 +1,4 @@ +{ + "filename": "renovate.json5", + "content": "{\n extends: [\n ':separateMajorReleases',\n ':prImmediately',\n ':renovatePrefix',\n ':semanticPrefixFixDepsChoreOthers',\n ':updateNotScheduled',\n ':automergeDisabled',\n ':maintainLockFilesDisabled',\n ':autodetectPinVersions',\n 'group:monorepos',\n ],\n onboarding: false,\n rangeStrategy: 'replace',\n semanticCommits: 'enabled',\n timezone: 'US/Central',\n baseBranches: [\n 'main',\n ],\n}\n" +} diff --git a/lib/workers/repository/config-migration/branch/__fixtures__/migrated.json b/lib/workers/repository/config-migration/branch/__fixtures__/migrated.json new file mode 100644 index 00000000000000..2fd26a80d99e64 --- /dev/null +++ b/lib/workers/repository/config-migration/branch/__fixtures__/migrated.json @@ -0,0 +1,20 @@ +{ + "extends": [ + ":separateMajorReleases", + ":prImmediately", + ":renovatePrefix", + ":semanticPrefixFixDepsChoreOthers", + ":updateNotScheduled", + ":automergeDisabled", + ":maintainLockFilesDisabled", + ":autodetectPinVersions", + "group:monorepos" + ], + "onboarding": false, + "rangeStrategy": "replace", + "semanticCommits": "enabled", + "timezone": "US/Central", + "baseBranches": [ + "main" + ] +} diff --git a/lib/workers/repository/config-migration/branch/__fixtures__/renovate.json b/lib/workers/repository/config-migration/branch/__fixtures__/renovate.json new file mode 100644 index 00000000000000..c7a91ea389e3b2 --- /dev/null +++ b/lib/workers/repository/config-migration/branch/__fixtures__/renovate.json @@ -0,0 +1,19 @@ +{ + "extends": [ + ":separateMajorReleases", + ":prImmediately", + ":renovatePrefix", + ":semanticPrefixFixDepsChoreOthers", + ":updateNotScheduled", + ":automergeDisabled", + ":maintainLockFilesDisabled", + ":autodetectPinVersions", + "group:monorepos", + "helpers:oddIsUnstablePackages" + ], + "onboarding": false, + "pinVersions": false, + "semanticCommits": true, + "timezone": "US/Central", + "baseBranch": "main" +} diff --git a/lib/workers/repository/config-migration/branch/__fixtures__/renovate.json5 b/lib/workers/repository/config-migration/branch/__fixtures__/renovate.json5 new file mode 100644 index 00000000000000..4bcc234e4a0669 --- /dev/null +++ b/lib/workers/repository/config-migration/branch/__fixtures__/renovate.json5 @@ -0,0 +1,19 @@ +{ + extends: [ + ':separateMajorReleases', + ':prImmediately', + ':renovatePrefix', + ':semanticPrefixFixDepsChoreOthers', + ':updateNotScheduled', + ':automergeDisabled', + ':maintainLockFilesDisabled', + ':autodetectPinVersions', + 'group:monorepos', + 'helpers:oddIsUnstablePackages' + ], + onboarding: false, + pinVersions: false, + semanticCommits: true, + timezone: 'US/Central', + baseBranch: 'main' // thats a comment +} diff --git a/lib/workers/repository/config-migration/branch/commit-message.ts b/lib/workers/repository/config-migration/branch/commit-message.ts new file mode 100644 index 00000000000000..0046bac9a0a463 --- /dev/null +++ b/lib/workers/repository/config-migration/branch/commit-message.ts @@ -0,0 +1,46 @@ +import type { RenovateConfig } from '../../../../config/types'; +import * as template from '../../../../util/template'; +import type { CommitMessage } from '../../model/commit-message'; +import { CommitMessageFactory } from '../../model/commit-message-factory'; + +export class ConfigMigrationCommitMessageFactory { + private readonly config: RenovateConfig; + + private readonly configFile: string; + + constructor(config: RenovateConfig, configFile: string) { + this.config = config; + this.configFile = configFile; + } + + create(): CommitMessage { + const { commitMessage } = this.config; + + this.config.commitMessageAction = + this.config.commitMessageAction === 'Update' + ? '' + : this.config.commitMessageAction; + + this.config.commitMessageTopic = + this.config.commitMessageTopic === 'dependency {{depName}}' + ? `Migrate config ${this.configFile}` + : this.config.commitMessageTopic; + + this.config.commitMessageExtra = ''; + this.config.semanticCommitScope = 'config'; + + const commitMessageFactory = new CommitMessageFactory(this.config); + const commit = commitMessageFactory.create(); + + if (commitMessage) { + commit.subject = template.compile(commitMessage, { + ...this.config, + commitMessagePrefix: '', + }); + } else { + commit.subject = `Migrate config ${this.configFile}`; + } + + return commit; + } +} diff --git a/lib/workers/repository/config-migration/branch/create.spec.ts b/lib/workers/repository/config-migration/branch/create.spec.ts new file mode 100644 index 00000000000000..9b599b34d380d6 --- /dev/null +++ b/lib/workers/repository/config-migration/branch/create.spec.ts @@ -0,0 +1,179 @@ +import { Fixtures } from '../../../../../test/fixtures'; +import { RenovateConfig, getConfig, platform } from '../../../../../test/util'; +import { commitFiles } from '../../../../util/git'; +import { createConfigMigrationBranch } from './create'; +import type { MigratedData } from './migrated-data'; + +jest.mock('../../../../util/git'); + +describe('workers/repository/config-migration/branch/create', () => { + const raw = Fixtures.getJson('./renovate.json'); + const indent = ' '; + const renovateConfig = JSON.stringify(raw, undefined, indent) + '\n'; + const filename = 'renovate.json'; + + let config: RenovateConfig; + let migratedConfigData: MigratedData; + + beforeEach(() => { + jest.clearAllMocks(); + config = getConfig(); + migratedConfigData = { content: renovateConfig, filename }; + }); + + describe('createConfigMigrationBranch', () => { + it('applies the default commit message', async () => { + await createConfigMigrationBranch(config, migratedConfigData); + expect(commitFiles).toHaveBeenCalledWith({ + branchName: 'renovate/migrate-config', + files: [ + { + type: 'addition', + path: 'renovate.json', + contents: renovateConfig, + }, + ], + message: 'Migrate config renovate.json', + platformCommit: false, + }); + }); + + it('commits via platform', async () => { + config.platformCommit = true; + + await createConfigMigrationBranch(config, migratedConfigData); + + expect(platform.commitFiles).toHaveBeenCalledWith({ + branchName: 'renovate/migrate-config', + files: [ + { + type: 'addition', + path: 'renovate.json', + contents: renovateConfig, + }, + ], + message: 'Migrate config renovate.json', + platformCommit: true, + }); + }); + + it('applies supplied commit message', async () => { + const message = 'We can migrate config if we want to, or we can not'; + + config.commitMessage = message; + + await createConfigMigrationBranch(config, migratedConfigData); + + expect(commitFiles).toHaveBeenCalledWith({ + branchName: 'renovate/migrate-config', + files: [ + { + type: 'addition', + path: 'renovate.json', + contents: renovateConfig, + }, + ], + message: message, + platformCommit: false, + }); + }); + + describe('applies the commitMessagePrefix value', () => { + it('to the default commit message', async () => { + config.commitMessagePrefix = 'PREFIX:'; + config.commitMessage = ''; + + const message = `PREFIX: migrate config renovate.json`; + await createConfigMigrationBranch(config, migratedConfigData); + + expect(commitFiles).toHaveBeenCalledWith({ + branchName: 'renovate/migrate-config', + files: [ + { + type: 'addition', + path: 'renovate.json', + contents: renovateConfig, + }, + ], + message: message, + platformCommit: false, + }); + }); + + it('to the supplied commit message prefix, topic & action', async () => { + const prefix = 'PREFIX:'; + const topic = 'thats a topic'; + const action = 'action'; + + const message = `${prefix} ${action} ${topic}`; + + config.commitMessagePrefix = prefix; + config.commitMessageTopic = topic; + config.commitMessageAction = action; + + await createConfigMigrationBranch(config, migratedConfigData); + + expect(commitFiles).toHaveBeenCalledWith({ + branchName: 'renovate/migrate-config', + files: [ + { + type: 'addition', + path: 'renovate.json', + contents: renovateConfig, + }, + ], + message: message, + platformCommit: false, + }); + }); + }); + + describe('applies semanticCommit prefix', () => { + it('to the default commit message', async () => { + const prefix = 'chore(config)'; + const message = `${prefix}: migrate config renovate.json`; + + config.semanticCommits = 'enabled'; + + await createConfigMigrationBranch(config, migratedConfigData); + + expect(commitFiles).toHaveBeenCalledWith({ + branchName: 'renovate/migrate-config', + files: [ + { + type: 'addition', + path: 'renovate.json', + contents: renovateConfig, + }, + ], + message: message, + platformCommit: false, + }); + }); + + it('to the supplied commit message topic', async () => { + const prefix = 'chore(config)'; + const topic = 'supplied topic'; + const message = `${prefix}: ${topic}`; + + config.semanticCommits = 'enabled'; + config.commitMessageTopic = topic; + + await createConfigMigrationBranch(config, migratedConfigData); + + expect(commitFiles).toHaveBeenCalledWith({ + branchName: 'renovate/migrate-config', + files: [ + { + type: 'addition', + path: 'renovate.json', + contents: renovateConfig, + }, + ], + message: message, + platformCommit: false, + }); + }); + }); + }); +}); diff --git a/lib/workers/repository/config-migration/branch/create.ts b/lib/workers/repository/config-migration/branch/create.ts new file mode 100644 index 00000000000000..92d684a2f72c9c --- /dev/null +++ b/lib/workers/repository/config-migration/branch/create.ts @@ -0,0 +1,43 @@ +import { GlobalConfig } from '../../../../config/global'; +import type { RenovateConfig } from '../../../../config/types'; +import { logger } from '../../../../logger'; +import { commitAndPush } from '../../../../modules/platform/commit'; +import { getMigrationBranchName } from '../common'; +import { ConfigMigrationCommitMessageFactory } from './commit-message'; +import type { MigratedData } from './migrated-data'; + +export function createConfigMigrationBranch( + config: Partial, + migratedConfigData: MigratedData +): Promise { + logger.debug('createConfigMigrationBranch()'); + const contents = migratedConfigData.content; + const configFileName = migratedConfigData.filename; + logger.debug('Creating config migration branch'); + + const commitMessageFactory = new ConfigMigrationCommitMessageFactory( + config, + configFileName + ); + + const commitMessage = commitMessageFactory.create(); + + // istanbul ignore if + if (GlobalConfig.get('dryRun')) { + logger.info('DRY-RUN: Would commit files to config migration branch'); + return Promise.resolve(null); + } + + return commitAndPush({ + branchName: getMigrationBranchName(config), + files: [ + { + type: 'addition', + path: configFileName, + contents, + }, + ], + message: commitMessage.toString(), + platformCommit: !!config.platformCommit, + }); +} diff --git a/lib/workers/repository/config-migration/branch/index.spec.ts b/lib/workers/repository/config-migration/branch/index.spec.ts new file mode 100644 index 00000000000000..d7b21af6e20b8c --- /dev/null +++ b/lib/workers/repository/config-migration/branch/index.spec.ts @@ -0,0 +1,98 @@ +import { mock } from 'jest-mock-extended'; +import { Fixtures } from '../../../../../test/fixtures'; +import { + RenovateConfig, + getConfig, + git, + mockedFunction, + platform, +} from '../../../../../test/util'; +import { GlobalConfig } from '../../../../config/global'; +import { logger } from '../../../../logger'; +import type { Pr } from '../../../../modules/platform'; +import { createConfigMigrationBranch } from './create'; +import type { MigratedData } from './migrated-data'; +import { rebaseMigrationBranch } from './rebase'; +import { checkConfigMigrationBranch } from '.'; + +jest.mock('./migrated-data'); +jest.mock('./rebase'); +jest.mock('./create'); +jest.mock('../../../../util/git'); + +const migratedData: MigratedData = Fixtures.getJson('./migrated-data.json'); + +describe('workers/repository/config-migration/branch/index', () => { + describe('checkConfigMigrationBranch', () => { + let config: RenovateConfig; + + beforeEach(() => { + GlobalConfig.set({ + dryRun: null, + }); + jest.resetAllMocks(); + config = getConfig(); + config.branchPrefix = 'some/'; + }); + + it('Exits when Migration is not needed', async () => { + await expect( + checkConfigMigrationBranch(config, null) + ).resolves.toBeNull(); + expect(logger.debug).toHaveBeenCalledWith( + 'checkConfigMigrationBranch() Config does not need migration' + ); + }); + + it('Updates migration branch & refresh PR', async () => { + platform.getBranchPr.mockResolvedValue(mock()); + // platform.refreshPr is undefined as it is an optional function + // declared as: refreshPr?(number: number): Promise; + platform.refreshPr = jest.fn().mockResolvedValueOnce(null); + mockedFunction(rebaseMigrationBranch).mockResolvedValueOnce('committed'); + const res = await checkConfigMigrationBranch(config, migratedData); + expect(res).toBe(`${config.branchPrefix}migrate-config`); + expect(git.checkoutBranch).toHaveBeenCalledTimes(1); + expect(git.commitFiles).toHaveBeenCalledTimes(0); + expect(logger.debug).toHaveBeenCalledWith( + 'Config Migration PR already exists' + ); + }); + + it('Dry runs update migration branch', async () => { + GlobalConfig.set({ + dryRun: 'full', + }); + platform.getBranchPr.mockResolvedValueOnce(mock()); + mockedFunction(rebaseMigrationBranch).mockResolvedValueOnce('committed'); + const res = await checkConfigMigrationBranch(config, migratedData); + expect(res).toBe(`${config.branchPrefix}migrate-config`); + expect(git.checkoutBranch).toHaveBeenCalledTimes(0); + expect(git.commitFiles).toHaveBeenCalledTimes(0); + }); + + it('Creates migration PR', async () => { + mockedFunction(createConfigMigrationBranch).mockResolvedValueOnce( + 'committed' + ); + const res = await checkConfigMigrationBranch(config, migratedData); + expect(res).toBe(`${config.branchPrefix}migrate-config`); + expect(git.checkoutBranch).toHaveBeenCalledTimes(1); + expect(git.commitFiles).toHaveBeenCalledTimes(0); + expect(logger.debug).toHaveBeenCalledWith('Need to create migration PR'); + }); + + it('Dry runs create migration PR', async () => { + GlobalConfig.set({ + dryRun: 'full', + }); + mockedFunction(createConfigMigrationBranch).mockResolvedValueOnce( + 'committed' + ); + const res = await checkConfigMigrationBranch(config, migratedData); + expect(res).toBe(`${config.branchPrefix}migrate-config`); + expect(git.checkoutBranch).toHaveBeenCalledTimes(0); + expect(git.commitFiles).toHaveBeenCalledTimes(0); + }); + }); +}); diff --git a/lib/workers/repository/config-migration/branch/index.ts b/lib/workers/repository/config-migration/branch/index.ts new file mode 100644 index 00000000000000..8e66b83e361a84 --- /dev/null +++ b/lib/workers/repository/config-migration/branch/index.ts @@ -0,0 +1,46 @@ +import { GlobalConfig } from '../../../../config/global'; +import type { RenovateConfig } from '../../../../config/types'; +import { logger } from '../../../../logger'; +import { platform } from '../../../../modules/platform'; +import { checkoutBranch } from '../../../../util/git'; +import { getMigrationBranchName } from '../common'; +import { createConfigMigrationBranch } from './create'; +import type { MigratedData } from './migrated-data'; +import { rebaseMigrationBranch } from './rebase'; + +export async function checkConfigMigrationBranch( + config: RenovateConfig, + migratedConfigData: MigratedData +): Promise { + logger.debug('checkConfigMigrationBranch()'); + if (!migratedConfigData) { + logger.debug('checkConfigMigrationBranch() Config does not need migration'); + return null; + } + const configMigrationBranch = getMigrationBranchName(config); + if (await migrationPrExists(configMigrationBranch)) { + logger.debug('Config Migration PR already exists'); + await rebaseMigrationBranch(config, migratedConfigData); + + if (platform.refreshPr) { + const configMigrationPr = await platform.getBranchPr( + configMigrationBranch + ); + if (configMigrationPr) { + await platform.refreshPr(configMigrationPr.number); + } + } + } else { + logger.debug('Config Migration PR does not exist'); + logger.debug('Need to create migration PR'); + await createConfigMigrationBranch(config, migratedConfigData); + } + if (!GlobalConfig.get('dryRun')) { + await checkoutBranch(configMigrationBranch); + } + return configMigrationBranch; +} + +export async function migrationPrExists(branchName: string): Promise { + return !!(await platform.getBranchPr(branchName)); +} diff --git a/lib/workers/repository/config-migration/branch/migrated-data.spec.ts b/lib/workers/repository/config-migration/branch/migrated-data.spec.ts new file mode 100644 index 00000000000000..e0aee9ab318266 --- /dev/null +++ b/lib/workers/repository/config-migration/branch/migrated-data.spec.ts @@ -0,0 +1,113 @@ +import detectIndent from 'detect-indent'; +import { Fixtures } from '../../../../../test/fixtures'; +import { mockedFunction } from '../../../../../test/util'; + +import { migrateConfig } from '../../../../config/migration'; +import { readLocalFile } from '../../../../util/fs'; +import { detectRepoFileConfig } from '../../init/merge'; +import { MigratedDataFactory } from './migrated-data'; + +jest.mock('../../../../config/migration'); +jest.mock('../../../../util/fs'); +jest.mock('../../init/merge'); +jest.mock('detect-indent'); + +const rawNonMigrated = Fixtures.get('./renovate.json'); +const rawNonMigratedJson5 = Fixtures.get('./renovate.json5'); +const migratedData = Fixtures.getJson('./migrated-data.json'); +const migratedDataJson5 = Fixtures.getJson('./migrated-data.json5'); +const migratedConfigObj = Fixtures.getJson('./migrated.json'); + +describe('workers/repository/config-migration/branch/migrated-data', () => { + describe('MigratedDataFactory.getAsync', () => { + beforeEach(() => { + jest.resetAllMocks(); + mockedFunction(detectIndent).mockReturnValue({ + type: 'space', + amount: 2, + indent: ' ', + }); + mockedFunction(detectRepoFileConfig).mockResolvedValue({ + configFileName: 'renovate.json', + }); + mockedFunction(readLocalFile).mockResolvedValue(rawNonMigrated); + mockedFunction(migrateConfig).mockReturnValue({ + isMigrated: true, + migratedConfig: migratedConfigObj, + }); + }); + + it('Calls getAsync a first when migration not needed', async () => { + mockedFunction(migrateConfig).mockReturnValueOnce({ + isMigrated: false, + migratedConfig: null, + }); + await expect(MigratedDataFactory.getAsync()).resolves.toBeNull(); + }); + + it('Calls getAsync a first time to initialize the factory', async () => { + await expect(MigratedDataFactory.getAsync()).resolves.toEqual( + migratedData + ); + expect(detectRepoFileConfig).toHaveBeenCalledTimes(1); + }); + + it('Calls getAsync a second time to get the saved data from before', async () => { + await expect(MigratedDataFactory.getAsync()).resolves.toEqual( + migratedData + ); + expect(detectRepoFileConfig).toHaveBeenCalledTimes(0); + }); + + describe('MigratedData class', () => { + it('gets the filename from the class instance', async () => { + const data = await MigratedDataFactory.getAsync(); + expect(data.filename).toBe('renovate.json'); + }); + + it('gets the content from the class instance', async () => { + const data = await MigratedDataFactory.getAsync(); + expect(data.content).toBe(migratedData.content); + }); + }); + + it('Resets the factory and gets a new value', async () => { + MigratedDataFactory.reset(); + await expect(MigratedDataFactory.getAsync()).resolves.toEqual( + migratedData + ); + }); + + it('Resets the factory and gets a new value with default indentation', async () => { + mockedFunction(detectIndent).mockReturnValueOnce({ + type: null, + amount: 0, + indent: null, + }); + MigratedDataFactory.reset(); + await expect(MigratedDataFactory.getAsync()).resolves.toEqual( + migratedData + ); + }); + + it('Migrate a JSON5 config file', async () => { + mockedFunction(detectRepoFileConfig).mockResolvedValueOnce({ + configFileName: 'renovate.json5', + }); + mockedFunction(readLocalFile).mockResolvedValueOnce(rawNonMigratedJson5); + MigratedDataFactory.reset(); + await expect(MigratedDataFactory.getAsync()).resolves.toEqual( + migratedDataJson5 + ); + }); + + it('Returns nothing due to fs error', async () => { + mockedFunction(detectRepoFileConfig).mockResolvedValueOnce({ + configFileName: null, + }); + mockedFunction(readLocalFile).mockRejectedValueOnce(null); + MigratedDataFactory.reset(); + await expect(MigratedDataFactory.getAsync()).resolves.toBeNull(); + }); + }); +}); diff --git a/lib/workers/repository/config-migration/branch/migrated-data.ts b/lib/workers/repository/config-migration/branch/migrated-data.ts new file mode 100644 index 00000000000000..9739d940f586ed --- /dev/null +++ b/lib/workers/repository/config-migration/branch/migrated-data.ts @@ -0,0 +1,76 @@ +import detectIndent from 'detect-indent'; +import JSON5 from 'json5'; +import { migrateConfig } from '../../../../config/migration'; +import { logger } from '../../../../logger'; +import { readLocalFile } from '../../../../util/fs'; +import { detectRepoFileConfig } from '../../init/merge'; + +export interface MigratedData { + content: string; + filename: string; +} + +export class MigratedDataFactory { + // singleton + private static data: MigratedData | null; + + public static async getAsync(): Promise { + if (this.data) { + return this.data; + } + const migrated = await this.build(); + + if (!migrated) { + return null; + } + + this.data = migrated; + return this.data; + } + + public static reset(): void { + this.data = null; + } + + private static async build(): Promise { + let res: MigratedData | null = null; + try { + const rc = await detectRepoFileConfig(); + const configFileParsed = rc?.configFileParsed || {}; + + // get migrated config + const { isMigrated, migratedConfig } = migrateConfig(configFileParsed); + if (!isMigrated) { + return null; + } + + delete migratedConfig.errors; + delete migratedConfig.warnings; + + const filename = rc.configFileName ?? ''; + const raw = await readLocalFile(filename, 'utf8'); + + // indent defaults to 2 spaces + const indent = detectIndent(raw).indent ?? ' '; + let content: string; + + if (filename.endsWith('.json5')) { + content = JSON5.stringify(migratedConfig, undefined, indent); + } else { + content = JSON.stringify(migratedConfig, undefined, indent); + } + + if (!content.endsWith('\n')) { + content += '\n'; + } + + res = { content, filename }; + } catch (err) { + logger.debug( + err, + 'MigratedDataFactory.getAsync() Error initializing renovate MigratedData' + ); + } + return res; + } +} diff --git a/lib/workers/repository/config-migration/branch/rebase.spec.ts b/lib/workers/repository/config-migration/branch/rebase.spec.ts new file mode 100644 index 00000000000000..ccdbf3a5f9272d --- /dev/null +++ b/lib/workers/repository/config-migration/branch/rebase.spec.ts @@ -0,0 +1,76 @@ +import { Fixtures } from '../../../../../test/fixtures'; +import { + RenovateConfig, + defaultConfig, + git, + platform, +} from '../../../../../test/util'; +import { GlobalConfig } from '../../../../config/global'; +import type { MigratedData } from './migrated-data'; +import { rebaseMigrationBranch } from './rebase'; + +jest.mock('../../../../util/git'); + +describe('workers/repository/config-migration/branch/rebase', () => { + beforeAll(() => { + GlobalConfig.set({ + localDir: '', + }); + }); + + describe('rebaseMigrationBranch()', () => { + const raw = Fixtures.getJson('./renovate.json'); + const indent = ' '; + const renovateConfig = JSON.stringify(raw, undefined, indent) + '\n'; + const filename = 'renovate.json'; + + let config: RenovateConfig; + let migratedConfigData: MigratedData; + + beforeEach(() => { + jest.resetAllMocks(); + GlobalConfig.reset(); + migratedConfigData = { content: renovateConfig, filename }; + config = { + ...defaultConfig, + repository: 'some/repo', + }; + }); + + it('does not rebase modified branch', async () => { + git.isBranchModified.mockResolvedValueOnce(true); + await rebaseMigrationBranch(config, migratedConfigData); + expect(git.commitFiles).toHaveBeenCalledTimes(0); + }); + + it('does nothing if branch is up to date', async () => { + git.getFile + .mockResolvedValueOnce(renovateConfig) + .mockResolvedValueOnce(renovateConfig); + await rebaseMigrationBranch(config, migratedConfigData); + expect(git.commitFiles).toHaveBeenCalledTimes(0); + }); + + it('rebases migration branch', async () => { + git.isBranchStale.mockResolvedValueOnce(true); + await rebaseMigrationBranch(config, migratedConfigData); + expect(git.commitFiles).toHaveBeenCalledTimes(1); + }); + + it('does not rebases migration branch when in dryRun is on', async () => { + GlobalConfig.set({ + dryRun: 'full', + }); + git.isBranchStale.mockResolvedValueOnce(true); + await rebaseMigrationBranch(config, migratedConfigData); + expect(git.commitFiles).toHaveBeenCalledTimes(0); + }); + + it('rebases via platform', async () => { + config.platformCommit = true; + git.isBranchStale.mockResolvedValueOnce(true); + await rebaseMigrationBranch(config, migratedConfigData); + expect(platform.commitFiles).toHaveBeenCalledTimes(1); + }); + }); +}); diff --git a/lib/workers/repository/config-migration/branch/rebase.ts b/lib/workers/repository/config-migration/branch/rebase.ts new file mode 100644 index 00000000000000..b5a3a320f34d9d --- /dev/null +++ b/lib/workers/repository/config-migration/branch/rebase.ts @@ -0,0 +1,52 @@ +import { GlobalConfig } from '../../../../config/global'; +import type { RenovateConfig } from '../../../../config/types'; +import { logger } from '../../../../logger'; +import { commitAndPush } from '../../../../modules/platform/commit'; +import { getFile, isBranchModified, isBranchStale } from '../../../../util/git'; +import { getMigrationBranchName } from '../common'; +import { ConfigMigrationCommitMessageFactory } from './commit-message'; +import type { MigratedData } from './migrated-data'; + +export async function rebaseMigrationBranch( + config: RenovateConfig, + migratedConfigData: MigratedData +): Promise { + logger.debug('Checking if migration branch needs rebasing'); + const branchName = getMigrationBranchName(config); + if (await isBranchModified(branchName)) { + logger.debug('Migration branch has been edited and cannot be rebased'); + return null; + } + const configFileName = migratedConfigData.filename; + const contents = migratedConfigData.content; + const existingContents = await getFile(configFileName, branchName); + if (contents === existingContents && !(await isBranchStale(branchName))) { + logger.debug('Migration branch is up to date'); + return null; + } + logger.debug('Rebasing migration branch'); + + if (GlobalConfig.get('dryRun')) { + logger.info('DRY-RUN: Would rebase files in migration branch'); + return null; + } + + const commitMessageFactory = new ConfigMigrationCommitMessageFactory( + config, + configFileName + ); + const commitMessage = commitMessageFactory.create(); + + return commitAndPush({ + branchName, + files: [ + { + type: 'addition', + path: configFileName, + contents, + }, + ], + message: commitMessage.toString(), + platformCommit: !!config.platformCommit, + }); +} diff --git a/lib/workers/repository/config-migration/common.ts b/lib/workers/repository/config-migration/common.ts new file mode 100644 index 00000000000000..62704c3dbdb508 --- /dev/null +++ b/lib/workers/repository/config-migration/common.ts @@ -0,0 +1,8 @@ +import type { RenovateConfig } from '../../../config/types'; +import * as template from '../../../util/template'; + +const migrationBranchTemplate = '{{{branchPrefix}}}migrate-config'; + +export function getMigrationBranchName(config: RenovateConfig): string { + return template.compile(migrationBranchTemplate, config); +} diff --git a/lib/workers/repository/config-migration/pr/__fixtures__/migrated-data.json b/lib/workers/repository/config-migration/pr/__fixtures__/migrated-data.json new file mode 100644 index 00000000000000..a3b883a2f5ff97 --- /dev/null +++ b/lib/workers/repository/config-migration/pr/__fixtures__/migrated-data.json @@ -0,0 +1,4 @@ +{ + "configFileName": "renovate.json", + "migratedContent": "{\n \"extends\": [\n \":separateMajorReleases\",\n \":prImmediately\",\n \":renovatePrefix\",\n \":semanticPrefixFixDepsChoreOthers\",\n \":updateNotScheduled\",\n \":automergeDisabled\",\n \":maintainLockFilesDisabled\",\n \":autodetectPinVersions\",\n \"group:monorepos\"\n ],\n \"onboarding\": false,\n \"rangeStrategy\": \"replace\",\n \"semanticCommits\": \"enabled\",\n \"timezone\": \"US/Central\",\n \"baseBranches\": [\n \"main\"\n ]\n}\n" +} diff --git a/lib/workers/repository/config-migration/pr/__snapshots__/index.spec.ts.snap b/lib/workers/repository/config-migration/pr/__snapshots__/index.spec.ts.snap new file mode 100644 index 00000000000000..dcbcd3daed29ac --- /dev/null +++ b/lib/workers/repository/config-migration/pr/__snapshots__/index.spec.ts.snap @@ -0,0 +1,92 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`workers/repository/config-migration/pr/index ensureConfigMigrationPr() creates PR for JSON5 config file 1`] = ` +"Config migration needed, merge this PR to update your Renovate configuration file. + + + +#### [PLEASE NOTE](https://docs.renovatebot.com/configuration-options#configmigration): JSON5 config file migrated! All comments & trailing commas were removed. +--- +#### Migration completed successfully, No errors or warnings found. +--- + + +❓ Got questions? Check out Renovate's [Docs](https://docs.renovatebot.com/), particularly the Getting Started section. +If you need any further assistance then you can also [request help here](https://github.com/renovatebot/renovate/discussions). + +--- + +This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). +" +`; + +exports[`workers/repository/config-migration/pr/index ensureConfigMigrationPr() creates PR with empty footer and header 1`] = ` +" + +Config migration needed, merge this PR to update your Renovate configuration file. + + + + +--- +#### Migration completed successfully, No errors or warnings found. +--- + + +❓ Got questions? Check out Renovate's [Docs](https://docs.renovatebot.com/), particularly the Getting Started section. +If you need any further assistance then you can also [request help here](https://github.com/renovatebot/renovate/discussions). + +--- + + +" +`; + +exports[`workers/repository/config-migration/pr/index ensureConfigMigrationPr() creates PR with footer and header using templating 1`] = ` +"This is a header for platform:github + +Config migration needed, merge this PR to update your Renovate configuration file. + + + + +--- +#### Migration completed successfully, No errors or warnings found. +--- + + +❓ Got questions? Check out Renovate's [Docs](https://docs.renovatebot.com/), particularly the Getting Started section. +If you need any further assistance then you can also [request help here](https://github.com/renovatebot/renovate/discussions). + +--- + +And this is a footer for repository:test baseBranch:some-branch +" +`; + +exports[`workers/repository/config-migration/pr/index ensureConfigMigrationPr() creates PR with footer and header with trailing and leading newlines 1`] = ` +" + +This should not be the first line of the PR + +Config migration needed, merge this PR to update your Renovate configuration file. + + + + +--- +#### Migration completed successfully, No errors or warnings found. +--- + + +❓ Got questions? Check out Renovate's [Docs](https://docs.renovatebot.com/), particularly the Getting Started section. +If you need any further assistance then you can also [request help here](https://github.com/renovatebot/renovate/discussions). + +--- + +There should be several empty lines at the end of the PR + + + +" +`; diff --git a/lib/workers/repository/config-migration/pr/errors-warnings.spec.ts b/lib/workers/repository/config-migration/pr/errors-warnings.spec.ts new file mode 100644 index 00000000000000..3069e6461eb618 --- /dev/null +++ b/lib/workers/repository/config-migration/pr/errors-warnings.spec.ts @@ -0,0 +1,57 @@ +import { RenovateConfig, getConfig } from '../../../../../test/util'; +import { getErrors, getWarnings } from './errors-warnings'; + +describe('workers/repository/config-migration/pr/errors-warnings', () => { + let config: RenovateConfig; + + beforeEach(() => { + jest.resetAllMocks(); + config = getConfig(); + }); + + describe('getWarnings()', () => { + it('returns warning text', () => { + config.warnings = [ + { + topic: 'WARNING', + message: 'Something went wrong', + }, + ]; + const res = getWarnings(config); + expect(res).toMatchInlineSnapshot(` + " + # Warnings (1) + + Please correct - or verify that you can safely ignore - these warnings before you merge this PR. + + - \`WARNING\`: Something went wrong + + --- + " + `); + }); + }); + + describe('getErrors()', () => { + it('returns error text', () => { + config.errors = [ + { + topic: 'Error', + message: 'An error occurred', + }, + ]; + const res = getErrors(config); + expect(res).toMatchInlineSnapshot(` + " + # Errors (1) + + Renovate has found errors that you should fix (in this branch) before finishing this PR. + + - \`Error\`: An error occurred + + --- + " + `); + }); + }); +}); diff --git a/lib/workers/repository/config-migration/pr/errors-warnings.ts b/lib/workers/repository/config-migration/pr/errors-warnings.ts new file mode 100644 index 00000000000000..6506ec784de290 --- /dev/null +++ b/lib/workers/repository/config-migration/pr/errors-warnings.ts @@ -0,0 +1,28 @@ +import type { RenovateConfig } from '../../../../config/types'; + +export function getWarnings(config: RenovateConfig): string { + if (!config.warnings?.length) { + return ''; + } + let warningText = `\n# Warnings (${config?.warnings.length})\n\n`; + warningText += `Please correct - or verify that you can safely ignore - these warnings before you merge this PR.\n\n`; + config.warnings.forEach((w) => { + warningText += `- \`${w.topic}\`: ${w.message}\n`; + }); + warningText += '\n---\n'; + return warningText; +} + +export function getErrors(config: RenovateConfig): string { + let errorText = ''; + if (!config.errors?.length) { + return ''; + } + errorText = `\n# Errors (${config.errors.length})\n\n`; + errorText += `Renovate has found errors that you should fix (in this branch) before finishing this PR.\n\n`; + config.errors.forEach((e) => { + errorText += `- \`${e.topic}\`: ${e.message}\n`; + }); + errorText += '\n---\n'; + return errorText; +} diff --git a/lib/workers/repository/config-migration/pr/index.spec.ts b/lib/workers/repository/config-migration/pr/index.spec.ts new file mode 100644 index 00000000000000..18abc84bb32808 --- /dev/null +++ b/lib/workers/repository/config-migration/pr/index.spec.ts @@ -0,0 +1,244 @@ +import type { RequestError, Response } from 'got'; +import { mock } from 'jest-mock-extended'; +import { Fixtures } from '../../../../../test/fixtures'; +import { + RenovateConfig, + getConfig, + git, + partial, + platform, +} from '../../../../../test/util'; +import { GlobalConfig } from '../../../../config/global'; +import { logger } from '../../../../logger'; +import type { Pr } from '../../../../modules/platform'; +import { hashBody } from '../../../../modules/platform/pr-body'; +import type { MigratedData } from '../branch/migrated-data'; +import { ensureConfigMigrationPr } from '.'; + +jest.mock('../../../../util/git'); + +describe('workers/repository/config-migration/pr/index', () => { + const spy = jest.spyOn(platform, 'massageMarkdown'); + const { configFileName, migratedContent } = Fixtures.getJson( + './migrated-data.json' + ); + const migratedData: MigratedData = { + content: migratedContent, + filename: configFileName, + }; + let config: RenovateConfig; + + beforeEach(() => { + GlobalConfig.set({ + dryRun: null, + }); + jest.resetAllMocks(); + config = { + ...getConfig(), + configMigration: true, + defaultBranch: 'main', + errors: [], + warnings: [], + description: [], + }; + }); + + describe('ensureConfigMigrationPr()', () => { + beforeEach(() => { + spy.mockImplementation((input) => input); + platform.createPr.mockResolvedValueOnce(partial({})); + }); + + let createPrBody: string; + let hash: string; + + it('creates PR', async () => { + await ensureConfigMigrationPr(config, migratedData); + expect(platform.getBranchPr).toHaveBeenCalledTimes(1); + expect(platform.createPr).toHaveBeenCalledTimes(1); + createPrBody = platform.createPr.mock.calls[0][0].prBody; + }); + + it('creates PR with default PR title', async () => { + await ensureConfigMigrationPr( + { ...config, onboardingPrTitle: null }, + migratedData + ); + expect(platform.getBranchPr).toHaveBeenCalledTimes(1); + expect(platform.createPr).toHaveBeenCalledTimes(1); + createPrBody = platform.createPr.mock.calls[0][0].prBody; + }); + + it('Founds an open PR and as it is up to date and returns', async () => { + hash = hashBody(createPrBody); + platform.getBranchPr.mockResolvedValueOnce( + mock({ bodyStruct: { hash } }) + ); + await ensureConfigMigrationPr(config, migratedData); + expect(platform.updatePr).toHaveBeenCalledTimes(0); + expect(platform.createPr).toHaveBeenCalledTimes(0); + }); + + it('Founds an open PR and updates it', async () => { + platform.getBranchPr.mockResolvedValueOnce( + mock({ bodyStruct: { hash: '' } }) + ); + await ensureConfigMigrationPr(config, migratedData); + expect(platform.updatePr).toHaveBeenCalledTimes(1); + expect(platform.createPr).toHaveBeenCalledTimes(0); + }); + + it('Founds a closed PR and exit', async () => { + platform.getBranchPr.mockResolvedValueOnce(null); + platform.findPr.mockResolvedValueOnce( + mock({ + title: 'Config Migration', + }) + ); + await ensureConfigMigrationPr(config, migratedData); + expect(platform.updatePr).toHaveBeenCalledTimes(0); + expect(platform.createPr).toHaveBeenCalledTimes(0); + expect(logger.debug).toHaveBeenCalledWith( + 'Found closed migration PR, exiting...' + ); + }); + + it('Dry runs and does not update out of date PR', async () => { + GlobalConfig.set({ + dryRun: 'full', + }); + platform.getBranchPr.mockResolvedValueOnce( + mock({ bodyStruct: { hash: '' } }) + ); + await ensureConfigMigrationPr(config, migratedData); + expect(platform.updatePr).toHaveBeenCalledTimes(0); + expect(platform.createPr).toHaveBeenCalledTimes(0); + expect(logger.debug).toHaveBeenCalledWith('Found open migration PR'); + expect(logger.debug).not.toHaveBeenLastCalledWith( + `does not need updating` + ); + expect(logger.info).toHaveBeenLastCalledWith( + 'DRY-RUN: Would update migration PR' + ); + }); + + it('Creates PR in dry run mode', async () => { + GlobalConfig.set({ + dryRun: 'full', + }); + await ensureConfigMigrationPr(config, migratedData); + expect(platform.getBranchPr).toHaveBeenCalledTimes(1); + expect(platform.createPr).toHaveBeenCalledTimes(0); + expect(logger.info).toHaveBeenLastCalledWith( + 'DRY-RUN: Would create migration PR' + ); + }); + + it('creates PR with labels', async () => { + await ensureConfigMigrationPr( + { + ...config, + labels: ['label'], + addLabels: ['label', 'additional-label'], + }, + migratedData + ); + expect(platform.createPr).toHaveBeenCalledTimes(1); + expect(platform.createPr.mock.calls[0][0].labels).toEqual([ + 'label', + 'additional-label', + ]); + }); + + it('creates PR with empty footer and header', async () => { + await ensureConfigMigrationPr( + { + ...config, + prHeader: '', + prFooter: '', + }, + migratedData + ); + expect(platform.createPr).toHaveBeenCalledTimes(1); + expect(platform.createPr.mock.calls[0][0].prBody).toMatchSnapshot(); + }); + + it('creates PR for JSON5 config file', async () => { + await ensureConfigMigrationPr(config, { + content: migratedContent, + filename: 'renovate.json5', + }); + expect(platform.createPr).toHaveBeenCalledTimes(1); + expect(platform.createPr.mock.calls[0][0].prBody).toMatchSnapshot(); + }); + + it('creates PR with footer and header with trailing and leading newlines', async () => { + await ensureConfigMigrationPr( + { + ...config, + prHeader: '\r\r\nThis should not be the first line of the PR', + prFooter: + 'There should be several empty lines at the end of the PR\r\n\n\n', + }, + migratedData + ); + expect(platform.createPr).toHaveBeenCalledTimes(1); + expect(platform.createPr.mock.calls[0][0].prBody).toMatchSnapshot(); + }); + + it('creates PR with footer and header using templating', async () => { + config.baseBranch = 'some-branch'; + config.repository = 'test'; + await ensureConfigMigrationPr( + { + ...config, + prHeader: 'This is a header for platform:{{platform}}', + prFooter: + 'And this is a footer for repository:{{repository}} baseBranch:{{baseBranch}}', + }, + migratedData + ); + expect(platform.createPr).toHaveBeenCalledTimes(1); + expect(platform.createPr.mock.calls[0][0].prBody).toMatch( + /platform:github/ + ); + expect(platform.createPr.mock.calls[0][0].prBody).toMatch( + /repository:test/ + ); + expect(platform.createPr.mock.calls[0][0].prBody).toMatch( + /baseBranch:some-branch/ + ); + expect(platform.createPr.mock.calls[0][0].prBody).toMatchSnapshot(); + }); + }); + + describe('ensureConfigMigrationPr() throws', () => { + const response = partial({ statusCode: 422 }); + const err = partial({ response }); + + beforeEach(() => { + jest.resetAllMocks(); + GlobalConfig.reset(); + git.deleteBranch.mockResolvedValue(); + }); + + it('throws when trying to create a new PR', async () => { + platform.createPr.mockRejectedValueOnce(err); + await expect(ensureConfigMigrationPr(config, migratedData)).toReject(); + expect(git.deleteBranch).toHaveBeenCalledTimes(0); + }); + + it('deletes branch when PR already exists but cannot find it', async () => { + err.response.body = { + errors: [{ message: 'A pull request already exists' }], + }; + platform.createPr.mockRejectedValue(err); + await expect(ensureConfigMigrationPr(config, migratedData)).toResolve(); + expect(logger.warn).toHaveBeenCalledWith( + { err }, + 'Migration PR already exists but cannot find it. It was probably created by a different user.' + ); + expect(git.deleteBranch).toHaveBeenCalledTimes(1); + }); + }); +}); diff --git a/lib/workers/repository/config-migration/pr/index.ts b/lib/workers/repository/config-migration/pr/index.ts new file mode 100644 index 00000000000000..3c62ab5852cb37 --- /dev/null +++ b/lib/workers/repository/config-migration/pr/index.ts @@ -0,0 +1,151 @@ +import is from '@sindresorhus/is'; +import { GlobalConfig } from '../../../../config/global'; +import type { RenovateConfig } from '../../../../config/types'; +import { logger } from '../../../../logger'; +import { platform } from '../../../../modules/platform'; +import { hashBody } from '../../../../modules/platform/pr-body'; +import { PrState } from '../../../../types'; +import { emojify } from '../../../../util/emoji'; +import { deleteBranch } from '../../../../util/git'; +import * as template from '../../../../util/template'; +import { joinUrlParts } from '../../../../util/url'; +import { getPlatformPrOptions } from '../../update/pr'; +import { prepareLabels } from '../../update/pr/labels'; +import { addParticipants } from '../../update/pr/participants'; +import type { MigratedData } from '../branch/migrated-data'; +import { getMigrationBranchName } from '../common'; +import { getErrors, getWarnings } from './errors-warnings'; + +export async function ensureConfigMigrationPr( + config: RenovateConfig, + migratedConfigData: MigratedData +): Promise { + logger.debug('ensureConfigMigrationPr()'); + const docsLink = joinUrlParts( + config.productLinks?.documentation ?? '', + 'configuration-options/#configmigration' + ); + const branchName = getMigrationBranchName(config); + const prTitle = config.onboardingPrTitle ?? 'Config Migration'; + const existingPr = await platform.getBranchPr(branchName); + const closedPr = await platform.findPr({ + branchName, + prTitle, + state: PrState.Closed, + }); + const filename = migratedConfigData.filename; + logger.debug('Filling in config migration PR template'); + let prTemplate = `Config migration needed, merge this PR to update your Renovate configuration file.\n\n`; + prTemplate += emojify( + ` + +${ + filename.endsWith('.json5') + ? `#### [PLEASE NOTE](${docsLink}): ` + + `JSON5 config file migrated! All comments & trailing commas were removed.` + : '' +} +--- +{{#if hasWarningsErrors}} +{{{warnings}}} +{{{errors}}} +{{else}} +#### Migration completed successfully, No errors or warnings found. +{{/if}} +--- + + +:question: Got questions? Check out Renovate's [Docs](${ + config.productLinks?.documentation + }), particularly the Getting Started section. +If you need any further assistance then you can also [request help here](${ + config.productLinks?.help + }). +` + ); + const warnings = getWarnings(config); + const errors = getErrors(config); + const hasWarningsErrors = warnings || errors; + let prBody = prTemplate; + prBody = template.compile(prBody, { + warnings, + errors, + hasWarningsErrors, + }); + if (is.string(config.prHeader)) { + prBody = `${template.compile(config.prHeader, config)}\n\n${prBody}`; + } + if (is.string(config.prFooter)) { + prBody = `${prBody}\n---\n\n${template.compile(config.prFooter, config)}\n`; + } + logger.trace({ prBody }, 'prBody'); + + prBody = platform.massageMarkdown(prBody); + + if (existingPr) { + logger.debug('Found open migration PR'); + // Check if existing PR needs updating + const prBodyHash = hashBody(prBody); + if (existingPr.bodyStruct?.hash === prBodyHash) { + logger.debug({ pr: existingPr.number }, `Does not need updating`); + return; + } + // PR must need updating + if (GlobalConfig.get('dryRun')) { + logger.info('DRY-RUN: Would update migration PR'); + } else { + await platform.updatePr({ + number: existingPr.number, + prTitle: existingPr.title, + prBody, + }); + logger.info({ pr: existingPr.number }, 'Migration PR updated'); + } + return; + } + if ( + [config.onboardingPrTitle, 'Config Migration'].includes(closedPr?.title) + ) { + logger.debug('Found closed migration PR, exiting...'); + return; + } + logger.debug('Creating migration PR'); + const labels = prepareLabels(config); + try { + if (GlobalConfig.get('dryRun')) { + logger.info('DRY-RUN: Would create migration PR'); + } else { + const pr = await platform.createPr({ + sourceBranch: branchName, + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + targetBranch: config.defaultBranch!, + prTitle, + prBody, + labels, + platformOptions: getPlatformPrOptions({ + ...config, + automerge: false, + }), + }); + logger.info({ pr: pr?.number }, 'Migration PR created'); + if (pr) { + await addParticipants(config, pr); + } + } + } catch (err) { + if ( + err.response?.statusCode === 422 && + err.response?.body?.errors?.[0]?.message?.startsWith( + 'A pull request already exists' + ) + ) { + logger.warn( + { err }, + 'Migration PR already exists but cannot find it. It was probably created by a different user.' + ); + await deleteBranch(branchName); + return; + } + throw err; + } +} diff --git a/lib/workers/repository/finalise/index.ts b/lib/workers/repository/finalise/index.ts index 1f239204c183e2..bcc6f79e0fc7f0 100644 --- a/lib/workers/repository/finalise/index.ts +++ b/lib/workers/repository/finalise/index.ts @@ -3,6 +3,9 @@ import { logger } from '../../../logger'; import { platform } from '../../../modules/platform'; import * as repositoryCache from '../../../util/cache/repository'; import { clearRenovateRefs } from '../../../util/git'; +import { checkConfigMigrationBranch } from '../config-migration/branch'; +import { MigratedDataFactory } from '../config-migration/branch/migrated-data'; +import { ensureConfigMigrationPr } from '../config-migration/pr'; import { PackageFiles } from '../package-files'; import { pruneStaleBranches } from './prune'; import { runRenovateRepoStats } from './repository-statistics'; @@ -12,6 +15,18 @@ export async function finaliseRepo( config: RenovateConfig, branchList: string[] ): Promise { + if (config.configMigration) { + const migratedConfigData = await MigratedDataFactory.getAsync(); + const migrationBranch = await checkConfigMigrationBranch( + config, + migratedConfigData + ); // null if migration not needed + if (migrationBranch) { + branchList.push(migrationBranch); + await ensureConfigMigrationPr(config, migratedConfigData); + } + MigratedDataFactory.reset(); + } await repositoryCache.saveCache(); await pruneStaleBranches(config, branchList); await platform.ensureIssueClosing( diff --git a/tsconfig.strict.json b/tsconfig.strict.json index 2516c1b9392735..05ca0fd10bfe86 100644 --- a/tsconfig.strict.json +++ b/tsconfig.strict.json @@ -51,6 +51,7 @@ "lib/workers/repository/errors-warnings.ts", "lib/workers/repository/onboarding/pr/index.ts", "lib/workers/repository/onboarding/pr/pr-list.ts", + "lib/workers/repository/config-migration/pr/index.ts", "lib/workers/repository/process/deprecated.ts", "lib/workers/repository/process/extract-update.ts", "lib/workers/repository/process/fetch.ts", From 22d2681a6eca569b521daa44bfc16ed484a14a10 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 19 Jun 2022 04:25:13 +0000 Subject: [PATCH 133/240] chore(deps): update dependency re2 to v1.17.6 (#16137) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index c7f3e621a79a74..fae6eee7b80204 100644 --- a/package.json +++ b/package.json @@ -212,7 +212,7 @@ "xmldoc": "1.1.2" }, "optionalDependencies": { - "re2": "1.17.4" + "re2": "1.17.6" }, "devDependencies": { "@actions/core": "1.8.2", diff --git a/yarn.lock b/yarn.lock index c62e9bc3b5713f..9c1a5b38441785 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7166,7 +7166,7 @@ mv@~2: ncp "~2.0.0" rimraf "~2.4.0" -nan@^2.14.0, nan@^2.15.0: +nan@^2.14.0, nan@^2.16.0: version "2.16.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.16.0.tgz#664f43e45460fb98faf00edca0bb0d7b8dce7916" integrity sha512-UdAqHyFngu7TfQKsCBgAA6pWDkT8MAO7d0jyOecVhN5354xbLqdn8mV9Tat9gepAupm0bt2DbeaSC8vS52MuFA== @@ -8137,14 +8137,14 @@ rc@^1.2.8: minimist "^1.2.0" strip-json-comments "~2.0.1" -re2@1.17.4: - version "1.17.4" - resolved "https://registry.yarnpkg.com/re2/-/re2-1.17.4.tgz#7bf29290bdde963014e77bd2c2e799a6d788386e" - integrity sha512-xyZ4h5PqE8I9tAxTh3G0UttcK5ufrcUxReFjGzfX61vtanNbS1XZHjnwRSyPcLgChI4KLxVgOT/ioZXnUAdoTA== +re2@1.17.6: + version "1.17.6" + resolved "https://registry.yarnpkg.com/re2/-/re2-1.17.6.tgz#eaa855e8c03fb7dd30d9fcc107a958ae95722052" + integrity sha512-LXDy+0Uj0S5s2QJT4atIrL/cX88SRqEIUvIgUF8MiJiNq8lTobQmdwns4tM0684VLNlm+1EQ/kviiokZqJtpKA== dependencies: install-artifact-from-github "^1.3.0" - nan "^2.15.0" - node-gyp "^8.4.1" + nan "^2.16.0" + node-gyp "^9.0.0" react-is@^17.0.1: version "17.0.2" From 461cbc75518946fe6c7612122f9ccb2e8202e583 Mon Sep 17 00:00:00 2001 From: Jason Bedard Date: Sun, 19 Jun 2022 02:33:03 -0400 Subject: [PATCH 134/240] feat(bazelisk): add support for bazelisk bazelversion files (#16114) --- lib/modules/manager/api.ts | 2 + lib/modules/manager/bazelisk/extract.spec.ts | 53 ++++++++++++++++++++ lib/modules/manager/bazelisk/extract.ts | 12 +++++ lib/modules/manager/bazelisk/index.ts | 10 ++++ lib/modules/manager/bazelisk/readme.md | 1 + 5 files changed, 78 insertions(+) create mode 100644 lib/modules/manager/bazelisk/extract.spec.ts create mode 100644 lib/modules/manager/bazelisk/extract.ts create mode 100644 lib/modules/manager/bazelisk/index.ts create mode 100644 lib/modules/manager/bazelisk/readme.md diff --git a/lib/modules/manager/api.ts b/lib/modules/manager/api.ts index ebe04c9b60ce0f..59f8d9c223771e 100644 --- a/lib/modules/manager/api.ts +++ b/lib/modules/manager/api.ts @@ -5,6 +5,7 @@ import * as azurePipelines from './azure-pipelines'; import * as batect from './batect'; import * as batectWrapper from './batect-wrapper'; import * as bazel from './bazel'; +import * as bazelisk from './bazelisk'; import * as bitbucketPipelines from './bitbucket-pipelines'; import * as buildkite from './buildkite'; import * as bundler from './bundler'; @@ -79,6 +80,7 @@ api.set('azure-pipelines', azurePipelines); api.set('batect', batect); api.set('batect-wrapper', batectWrapper); api.set('bazel', bazel); +api.set('bazelisk', bazelisk); api.set('bitbucket-pipelines', bitbucketPipelines); api.set('buildkite', buildkite); api.set('bundler', bundler); diff --git a/lib/modules/manager/bazelisk/extract.spec.ts b/lib/modules/manager/bazelisk/extract.spec.ts new file mode 100644 index 00000000000000..dde5e2aa84f9c6 --- /dev/null +++ b/lib/modules/manager/bazelisk/extract.spec.ts @@ -0,0 +1,53 @@ +import { extractPackageFile } from '.'; + +describe('modules/manager/bazelisk/extract', () => { + describe('extractPackageFile()', () => { + it('returns a result', () => { + const res = extractPackageFile('5.2.0\n'); + expect(res.deps).toEqual([ + { + currentValue: '5.2.0', + datasource: 'github-releases', + depName: 'bazel', + packageName: 'bazelbuild/bazel', + }, + ]); + }); + + it('supports ranges', () => { + const res = extractPackageFile('5.2\n'); + expect(res.deps).toEqual([ + { + currentValue: '5.2', + datasource: 'github-releases', + depName: 'bazel', + packageName: 'bazelbuild/bazel', + }, + ]); + }); + + it('skips non ranges', () => { + const res = extractPackageFile('latestn'); + expect(res.deps).toEqual([ + { + currentValue: 'latestn', + datasource: 'github-releases', + depName: 'bazel', + packageName: 'bazelbuild/bazel', + }, + ]); + }); + + it('ignores comments past the first line', () => { + const res = extractPackageFile('5.2.0\n# comment1\n\n# comment2'); + expect(res.deps).toEqual([ + { + currentValue: '5.2.0', + datasource: 'github-releases', + depName: 'bazel', + packageName: 'bazelbuild/bazel', + }, + ]); + }); + }); +}); diff --git a/lib/modules/manager/bazelisk/extract.ts b/lib/modules/manager/bazelisk/extract.ts new file mode 100644 index 00000000000000..a4376a57694e86 --- /dev/null +++ b/lib/modules/manager/bazelisk/extract.ts @@ -0,0 +1,12 @@ +import { GithubReleasesDatasource } from '../../datasource/github-releases'; +import type { PackageDependency, PackageFile } from '../types'; + +export function extractPackageFile(content: string): PackageFile { + const dep: PackageDependency = { + depName: 'bazel', + currentValue: content.split('\n', 2)[0].trim(), + datasource: GithubReleasesDatasource.id, + packageName: 'bazelbuild/bazel', + }; + return { deps: [dep] }; +} diff --git a/lib/modules/manager/bazelisk/index.ts b/lib/modules/manager/bazelisk/index.ts new file mode 100644 index 00000000000000..345989e1b4c99a --- /dev/null +++ b/lib/modules/manager/bazelisk/index.ts @@ -0,0 +1,10 @@ +import { GithubReleasesDatasource } from '../../datasource/github-releases'; + +export { extractPackageFile } from './extract'; + +export const defaultConfig = { + fileMatch: ['(^|\\/)\\.bazelversion$'], + pinDigests: false, +}; + +export const supportedDatasources = [GithubReleasesDatasource.id]; diff --git a/lib/modules/manager/bazelisk/readme.md b/lib/modules/manager/bazelisk/readme.md new file mode 100644 index 00000000000000..cb720c0992d8ee --- /dev/null +++ b/lib/modules/manager/bazelisk/readme.md @@ -0,0 +1 @@ +Simply keeps the `.bazelversion` file updated. From 1bb6460664be7e4e141463be86651f5a1e16f172 Mon Sep 17 00:00:00 2001 From: RahulGautamSingh Date: Sun, 19 Jun 2022 19:44:55 +0530 Subject: [PATCH 135/240] refactor: add types for tmp (#16139) add @types/tmp --- package.json | 1 + yarn.lock | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/package.json b/package.json index fae6eee7b80204..61a591a3171b7b 100644 --- a/package.json +++ b/package.json @@ -142,6 +142,7 @@ "@renovatebot/pep440": "2.1.3", "@renovatebot/ruby-semver": "1.1.4", "@sindresorhus/is": "4.6.0", + "@types/tmp": "0.2.3", "@yarnpkg/core": "3.1.0", "@yarnpkg/parsers": "2.5.1", "auth-header": "1.0.0", diff --git a/yarn.lock b/yarn.lock index 9c1a5b38441785..89db9f8ddaaf0d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2745,6 +2745,11 @@ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== +"@types/tmp@0.2.3": + version "0.2.3" + resolved "https://registry.yarnpkg.com/@types/tmp/-/tmp-0.2.3.tgz#908bfb113419fd6a42273674c00994d40902c165" + integrity sha512-dDZH/tXzwjutnuk4UacGgFRwV+JSLaXL1ikvidfJprkb7L9Nx1njcRHHmi3Dsvt7pgqqTEeucQuOrWHPFgzVHA== + "@types/traverse@0.6.32": version "0.6.32" resolved "https://registry.yarnpkg.com/@types/traverse/-/traverse-0.6.32.tgz#f9fdfa40cd4898deaa975a14511aec731de8235e" From f0081ab276c2faf2b2fc6bc8261d3756b84d86dd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 19 Jun 2022 17:52:30 +0000 Subject: [PATCH 136/240] chore(deps): update dependency re2 to v1.17.7 (#16140) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 61a591a3171b7b..7d192eb282a7eb 100644 --- a/package.json +++ b/package.json @@ -213,7 +213,7 @@ "xmldoc": "1.1.2" }, "optionalDependencies": { - "re2": "1.17.6" + "re2": "1.17.7" }, "devDependencies": { "@actions/core": "1.8.2", diff --git a/yarn.lock b/yarn.lock index 89db9f8ddaaf0d..70ba8b7da5c546 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5444,7 +5444,7 @@ init-package-json@^3.0.2: validate-npm-package-license "^3.0.4" validate-npm-package-name "^4.0.0" -install-artifact-from-github@^1.3.0: +install-artifact-from-github@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/install-artifact-from-github/-/install-artifact-from-github-1.3.1.tgz#eefaad9af35d632e5d912ad1569c1de38c3c2462" integrity sha512-3l3Bymg2eKDsN5wQuMfgGEj2x6l5MCAv0zPL6rxHESufFVlEAKW/6oY9F1aGgvY/EgWm5+eWGRjINveL4X7Hgg== @@ -8142,12 +8142,12 @@ rc@^1.2.8: minimist "^1.2.0" strip-json-comments "~2.0.1" -re2@1.17.6: - version "1.17.6" - resolved "https://registry.yarnpkg.com/re2/-/re2-1.17.6.tgz#eaa855e8c03fb7dd30d9fcc107a958ae95722052" - integrity sha512-LXDy+0Uj0S5s2QJT4atIrL/cX88SRqEIUvIgUF8MiJiNq8lTobQmdwns4tM0684VLNlm+1EQ/kviiokZqJtpKA== +re2@1.17.7: + version "1.17.7" + resolved "https://registry.yarnpkg.com/re2/-/re2-1.17.7.tgz#e14cab85a177a5534c7215c322d1b043c55aa1e9" + integrity sha512-X8GSuiBoVWwcjuppqSjsIkRxNUKDdjhkO9SBekQbZ2ksqWUReCy7DQPWOVpoTnpdtdz5PIpTTxTFzvJv5UMfjA== dependencies: - install-artifact-from-github "^1.3.0" + install-artifact-from-github "^1.3.1" nan "^2.16.0" node-gyp "^9.0.0" From 3d31fa371d257741b5cfb423221f8ac4a25bfc07 Mon Sep 17 00:00:00 2001 From: RahulGautamSingh Date: Mon, 20 Jun 2022 02:47:46 +0530 Subject: [PATCH 137/240] refactor(lib/util): strict null check for test files (#15812) * add types for tmp * expand files in lib/util * update yarn lock * Update tsconfig.strict.json * util/exec * util/git * util/http * Revert "util/exec" This reverts commit 96cf479a1b396e0096fcdb35caa346861df7b8fe. * update strict.json * redo util/exec * revert util/git * util/merge-confidence * update util/git * util/package-rules * fix util/git * util/template * util/ * revert extras * rm newline * add tmp back * apply suggestion from review * util/cache * more changes * Update tsconfig.strict.json Co-authored-by: Michael Kriese --- lib/util/cache/package/decorator.spec.ts | 8 ++++++-- lib/util/exec/docker/index.spec.ts | 2 +- lib/util/exec/index.spec.ts | 2 +- lib/util/git/author.spec.ts | 4 ++-- lib/util/git/index.spec.ts | 17 ++++++++++------- lib/util/http/github.spec.ts | 23 +++++++++++++---------- lib/util/http/github.ts | 2 +- lib/util/index.spec.ts | 6 +++--- lib/util/merge-confidence/index.spec.ts | 4 ++-- lib/util/package-rules.spec.ts | 4 +++- lib/util/template/index.spec.ts | 4 ++-- tsconfig.strict.json | 2 -- 12 files changed, 44 insertions(+), 34 deletions(-) diff --git a/lib/util/cache/package/decorator.spec.ts b/lib/util/cache/package/decorator.spec.ts index 6962e4e4a10c2a..521f1e94404e83 100644 --- a/lib/util/cache/package/decorator.spec.ts +++ b/lib/util/cache/package/decorator.spec.ts @@ -116,8 +116,12 @@ describe('util/cache/package/decorator', () => { } } const decorator = cache({ namespace: 'namespace', key: 'key' }); - const getNumber = decorator(MyClass.prototype, 'getNumber', undefined); + const getNumber = decorator( + MyClass.prototype, + 'getNumber', + undefined as never + ); - expect(await getNumber.value()).toBeNumber(); + expect(await getNumber.value?.()).toBeNumber(); }); }); diff --git a/lib/util/exec/docker/index.spec.ts b/lib/util/exec/docker/index.spec.ts index d55501395c1d1c..90f3f58316880b 100644 --- a/lib/util/exec/docker/index.spec.ts +++ b/lib/util/exec/docker/index.spec.ts @@ -208,7 +208,7 @@ describe('util/exec/docker/index', () => { }); describe('generateDockerCommand', () => { - const preCommands = [null, 'foo', undefined]; + const preCommands = [null as never, 'foo', undefined as never]; const commands = ['bar']; const envVars = ['FOO', 'BAR']; const image = 'sample_image'; diff --git a/lib/util/exec/index.spec.ts b/lib/util/exec/index.spec.ts index d7c70b9dae6c96..61fe5ed66b9ae1 100644 --- a/lib/util/exec/index.spec.ts +++ b/lib/util/exec/index.spec.ts @@ -466,7 +466,7 @@ describe('util/exec/index', () => { docker: { image, }, - preCommands: ['preCommand1', 'preCommand2', null], + preCommands: ['preCommand1', 'preCommand2', null as never], }, outCmd: [ dockerPullCmd, diff --git a/lib/util/git/author.spec.ts b/lib/util/git/author.spec.ts index 6f6b80fe0028a6..3d7773c2b8c656 100644 --- a/lib/util/git/author.spec.ts +++ b/lib/util/git/author.spec.ts @@ -3,7 +3,7 @@ import { parseGitAuthor } from './author'; describe('util/git/author', () => { describe('parseGitAuthor', () => { it('returns null if empty email given', () => { - expect(parseGitAuthor(undefined)).toBeNull(); + expect(parseGitAuthor(undefined as never)).toBeNull(); }); it('handles a normal address', () => { @@ -27,7 +27,7 @@ describe('util/git/author', () => { }); it('escapes names', () => { - expect(parseGitAuthor('name [what] ').name).toBe( + expect(parseGitAuthor('name [what] ')?.name).toBe( `name [what]` ); }); diff --git a/lib/util/git/index.spec.ts b/lib/util/git/index.spec.ts index e7af8dd2e6e859..d045a2c2e90356 100644 --- a/lib/util/git/index.spec.ts +++ b/lib/util/git/index.spec.ts @@ -293,7 +293,10 @@ describe('util/git/index', () => { }; await git.commitFiles({ branchName: 'renovate/branch_with_changes', - files: [file, { type: 'addition', path: 'dummy', contents: null }], + files: [ + file, + { type: 'addition', path: 'dummy', contents: null as never }, + ], message: 'Create something', }); const branchFiles = await git.getBranchFiles( @@ -873,7 +876,7 @@ describe('util/git/index', () => { .filter(Boolean); it('creates renovate ref in default section', async () => { - const commit = git.getBranchCommit('develop'); + const commit = git.getBranchCommit('develop')!; await git.pushCommitToRenovateRef(commit, 'foo/bar'); @@ -882,7 +885,7 @@ describe('util/git/index', () => { }); it('creates custom section for renovate ref', async () => { - const commit = git.getBranchCommit('develop'); + const commit = git.getBranchCommit('develop')!; await git.pushCommitToRenovateRef(commit, 'bar/baz', 'foo'); @@ -891,7 +894,7 @@ describe('util/git/index', () => { }); it('clears pushed Renovate refs', async () => { - const commit = git.getBranchCommit('develop'); + const commit = git.getBranchCommit('develop')!; await git.pushCommitToRenovateRef(commit, 'foo'); await git.pushCommitToRenovateRef(commit, 'bar'); await git.pushCommitToRenovateRef(commit, 'baz'); @@ -902,7 +905,7 @@ describe('util/git/index', () => { }); it('clears remote Renovate refs', async () => { - const commit = git.getBranchCommit('develop'); + const commit = git.getBranchCommit('develop')!; const tmpGit = Git(tmpDir.path); await tmpGit.raw(['update-ref', 'refs/renovate/aaa', commit]); await tmpGit.raw(['push', '--force', 'origin', 'refs/renovate/aaa']); @@ -914,7 +917,7 @@ describe('util/git/index', () => { }); it('preserves unknown sections by default', async () => { - const commit = git.getBranchCommit('develop'); + const commit = git.getBranchCommit('develop')!; const tmpGit = Git(tmpDir.path); await tmpGit.raw(['update-ref', 'refs/renovate/foo/bar', commit]); await tmpGit.raw(['push', '--force', 'origin', 'refs/renovate/foo/bar']); @@ -925,7 +928,7 @@ describe('util/git/index', () => { describe('listCommitTree', () => { it('creates non-branch ref', async () => { - const commit = git.getBranchCommit('develop'); + const commit = git.getBranchCommit('develop')!; const res = await git.listCommitTree(commit); expect(res).toEqual([ { diff --git a/lib/util/http/github.spec.ts b/lib/util/http/github.spec.ts index 5c62d867ac1502..eaf78c2f445479 100644 --- a/lib/util/http/github.spec.ts +++ b/lib/util/http/github.spec.ts @@ -13,6 +13,7 @@ import * as _repositoryCache from '../cache/repository'; import type { RepoCacheData } from '../cache/repository/types'; import * as hostRules from '../host-rules'; import { GithubHttp, setBaseUrl } from './github'; +import type { GraphqlPageCache } from './github'; jest.mock('../cache/repository'); const repositoryCache = mocked(_repositoryCache); @@ -527,9 +528,10 @@ describe('util/http/github', () => { const items = await githubApi.queryRepoField(graphqlQuery, 'testItem'); expect(items).toHaveLength(3); - expect( - repoCache?.platform?.github?.graphqlPageCache?.['testItem']?.pageSize - ).toBe(25); + const graphqlPageCache = repoCache?.platform?.github?.[ + 'graphqlPageCache' + ] as GraphqlPageCache; + expect(graphqlPageCache?.['testItem']?.pageSize).toBe(25); }); it('expands items count on timeout', async () => { @@ -555,9 +557,10 @@ describe('util/http/github', () => { const items = await githubApi.queryRepoField(graphqlQuery, 'testItem'); expect(items).toHaveLength(3); - expect( - repoCache?.platform?.github?.graphqlPageCache?.['testItem']?.pageSize - ).toBe(84); + const graphqlPageCache = repoCache?.platform?.github?.[ + 'graphqlPageCache' + ] as GraphqlPageCache; + expect(graphqlPageCache?.['testItem']?.pageSize).toBe(84); }); it('continues to iterate with a lower page size on error 502', async () => { @@ -599,10 +602,10 @@ describe('util/http/github', () => { const items = await githubApi.queryRepoField(graphqlQuery, 'testItem'); expect(items).toHaveLength(3); - - expect( - repoCache?.platform?.github?.graphqlPageCache?.['testItem'] - ).toBeUndefined(); + const graphqlPageCache = repoCache?.platform?.github?.[ + 'graphqlPageCache' + ] as GraphqlPageCache; + expect(graphqlPageCache?.['testItem']).toBeUndefined(); }); it('throws on 50x if count < 10', async () => { diff --git a/lib/util/http/github.ts b/lib/util/http/github.ts index dfb697e9d4c439..b69d0ebaf31762 100644 --- a/lib/util/http/github.ts +++ b/lib/util/http/github.ts @@ -185,7 +185,7 @@ interface GraphqlPageCacheItem { pageSize: number; } -type GraphqlPageCache = Record; +export type GraphqlPageCache = Record; function getGraphqlPageSize( fieldName: string, diff --git a/lib/util/index.spec.ts b/lib/util/index.spec.ts index 5501cdea42f405..dd3c7c4208f2d5 100644 --- a/lib/util/index.spec.ts +++ b/lib/util/index.spec.ts @@ -13,7 +13,7 @@ describe('util/index', () => { }); it('returns full array for null number', () => { - expect(sampleSize(array, null)).toBeEmptyArray(); + expect(sampleSize(array, null as never)).toBeEmptyArray(); }); it('returns full array for 0 number', () => { @@ -21,11 +21,11 @@ describe('util/index', () => { }); it('returns empty array for null array', () => { - expect(sampleSize(null, 1)).toBeEmptyArray(); + expect(sampleSize(null as never, 1)).toBeEmptyArray(); }); it('returns empty array for undefined array', () => { - expect(sampleSize(undefined, 1)).toBeEmptyArray(); + expect(sampleSize(undefined as never, 1)).toBeEmptyArray(); }); it('returns empty array for empty array', () => { diff --git a/lib/util/merge-confidence/index.spec.ts b/lib/util/merge-confidence/index.spec.ts index 4179d65a689263..142a1f540fcf94 100644 --- a/lib/util/merge-confidence/index.spec.ts +++ b/lib/util/merge-confidence/index.spec.ts @@ -10,7 +10,7 @@ import { describe('util/merge-confidence/index', () => { describe('isActiveConfidenceLevel()', () => { it('returns false if null', () => { - expect(isActiveConfidenceLevel(null)).toBeFalse(); + expect(isActiveConfidenceLevel(null as never)).toBeFalse(); }); it('returns false if low', () => { @@ -53,7 +53,7 @@ describe('util/merge-confidence/index', () => { 'renovate', '25.0.0', '25.0.0', - undefined + undefined as never ) ).toBe('neutral'); }); diff --git a/lib/util/package-rules.spec.ts b/lib/util/package-rules.spec.ts index 602977880b79f2..df219440ce00dd 100644 --- a/lib/util/package-rules.spec.ts +++ b/lib/util/package-rules.spec.ts @@ -866,7 +866,9 @@ describe('util/package-rules', () => { }); it('empty rules', () => { - expect(applyPackageRules({ ...config1, packageRules: null })).toEqual({ + expect( + applyPackageRules({ ...config1, packageRules: null as never }) + ).toEqual({ foo: 'bar', packageRules: null, }); diff --git a/lib/util/template/index.spec.ts b/lib/util/template/index.spec.ts index e0d7f67304ec3b..cac4629ba0c8fe 100644 --- a/lib/util/template/index.spec.ts +++ b/lib/util/template/index.spec.ts @@ -71,13 +71,13 @@ describe('util/template/index', () => { it('string to pretty JSON ', () => { const userTemplate = '{{{ stringToPrettyJSON \'{"some":{"fancy":"json"}}\'}}}'; - const output = template.compile(userTemplate, undefined); + const output = template.compile(userTemplate, undefined as never); expect(output).toMatchSnapshot(); }); it('lowercase', () => { const userTemplate = "{{{ lowercase 'FOO'}}}"; - const output = template.compile(userTemplate, undefined); + const output = template.compile(userTemplate, undefined as never); expect(output).toBe('foo'); }); }); diff --git a/tsconfig.strict.json b/tsconfig.strict.json index 05ca0fd10bfe86..2499723f6bcc10 100644 --- a/tsconfig.strict.json +++ b/tsconfig.strict.json @@ -13,9 +13,7 @@ "coverage", "config.js", "tmp", - // TODO: fixme - "lib/util/**/*.spec.ts", "lib/workers/**/*.spec.ts", "lib/modules/datasource/**/*.spec.ts", "lib/modules/manager/**/*.spec.ts", From 47ebf9b8cfde2c3a8a6e1945e2f6cb81297591c7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 20 Jun 2022 01:34:09 +0000 Subject: [PATCH 138/240] docs: update references to renovate/renovate to v32.90.0 (#16143) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- docs/usage/docker.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/docker.md b/docs/usage/docker.md index ef345f1fe1843d..d4950cb00c506b 100644 --- a/docs/usage/docker.md +++ b/docs/usage/docker.md @@ -267,7 +267,7 @@ To get access to the token a custom Renovate Docker image is needed that include The Dockerfile to create such an image can look like this: ```Dockerfile -FROM renovate/renovate:32.85.0 +FROM renovate/renovate:32.90.0 # Include the "Docker tip" which you can find here https://cloud.google.com/sdk/docs/install # under "Installation" for "Debian/Ubuntu" RUN ... From fe20cfce69d4b1d9e2d3acc2a07fa90941e97d22 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 20 Jun 2022 01:47:06 +0000 Subject: [PATCH 139/240] chore(deps): lock file maintenance (#16144) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 270 +++++++++++++++++++++++++++++------------------------- 1 file changed, 147 insertions(+), 123 deletions(-) diff --git a/yarn.lock b/yarn.lock index 70ba8b7da5c546..8c877d26ff09bf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,13 +2,20 @@ # yarn lockfile v1 -"@actions/core@1.8.2", "@actions/core@^1.2.6": +"@actions/core@1.8.2": version "1.8.2" resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.8.2.tgz#67539d669ae9b751430469e9ae4d83e0525973ac" integrity sha512-FXcBL7nyik8K5ODeCKlxi+vts7torOkoDAKfeh61EAkAy1HAvwn9uVzZBY0f15YcQTcZZ2/iSGBFHEuioZWfDA== dependencies: "@actions/http-client" "^2.0.1" +"@actions/core@^1.2.6": + version "1.9.0" + resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.9.0.tgz#20c1baac5d4bd2508ba1fc3e5f3fc4b8a80d4082" + integrity sha512-5pbM693Ih59ZdUhgk+fts+bUWTnIdHV3kwOSr+QIoFHMLg7Gzhwm0cifDY/AG68ekEJAkHnQVpcy4f6GjmzBCA== + dependencies: + "@actions/http-client" "^2.0.1" + "@actions/http-client@^2.0.1": version "2.0.1" resolved "https://registry.yarnpkg.com/@actions/http-client/-/http-client-2.0.1.tgz#873f4ca98fe32f6839462a6f046332677322f99c" @@ -828,9 +835,9 @@ integrity sha512-wrDZjuy1CVAYxDCbm3bWQIKMGfNs7XXmG0eG4858Ixgqmq2avsIn5TORy8ynBxcXn9aekV/+tGEQ7BBSYzIVNQ== "@aws-sdk/types@^3.1.0": - version "3.78.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/types/-/types-3.78.0.tgz#51dc80b2142ee20821fb9f476bdca6e541021443" - integrity sha512-I9PTlVNSbwhIgMfmDM5as1tqRIkVZunjVmfogb2WVVPp4CaX0Ll01S0FSMSLL9k6tcQLXqh45pFRjrxCl9WKdQ== + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/types/-/types-3.110.0.tgz#09404533b507925eadf9acf9c4356667048e45bd" + integrity sha512-dLVoqODU3laaqNFPyN1QLtlQnwX4gNPMXptEBIt/iJpuZf66IYJe6WCzVZGt4Zfa1CnUmrlA428AzdcA/KCr2A== "@aws-sdk/url-parser@3.55.0": version "3.55.0" @@ -985,13 +992,20 @@ "@aws-sdk/types" "3.55.0" tslib "^2.3.1" -"@aws-sdk/util-utf8-browser@3.55.0", "@aws-sdk/util-utf8-browser@^3.0.0": +"@aws-sdk/util-utf8-browser@3.55.0": version "3.55.0" resolved "https://registry.yarnpkg.com/@aws-sdk/util-utf8-browser/-/util-utf8-browser-3.55.0.tgz#a045bf1a93f6e0ff9c846631b168ea55bbb37668" integrity sha512-ljzqJcyjfJpEVSIAxwtIS8xMRUly84BdjlBXyp6cu4G8TUufgjNS31LWdhyGhgmW5vYBNr+LTz0Kwf6J+ou7Ug== dependencies: tslib "^2.3.1" +"@aws-sdk/util-utf8-browser@^3.0.0": + version "3.109.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/util-utf8-browser/-/util-utf8-browser-3.109.0.tgz#d013272e1981b23a4c84ac06f154db686c0cf84e" + integrity sha512-FmcGSz0v7Bqpl1SE8G1Gc0CtDpug+rvqNCG/szn86JApD/f5x8oByjbEiAyTU2ZH2VevUntx6EW68ulHyH+x+w== + dependencies: + tslib "^2.3.1" + "@aws-sdk/util-utf8-node@3.55.0": version "3.55.0" resolved "https://registry.yarnpkg.com/@aws-sdk/util-utf8-node/-/util-utf8-node-3.55.0.tgz#44cf9f9c8624d144afd65ab8a1786e33134add15" @@ -1024,11 +1038,11 @@ "@babel/highlight" "^7.16.7" "@babel/compat-data@^7.17.10": - version "7.17.10" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.17.10.tgz#711dc726a492dfc8be8220028b1b92482362baab" - integrity sha512-GZt/TCsG70Ms19gfZO1tM4CVnXsPgEPBCpJu+Qz3L0LUDsY5nZqFZglIoPC1kIYOtNBZlrnFT+klg12vFGZXrw== + version "7.18.5" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.18.5.tgz#acac0c839e317038c73137fbb6ef71a1d6238471" + integrity sha512-BxhE40PVCBxVEJsSBhB6UWyAuqJRxGsAw8BdHMJ3AKGydcwuWW4kOO3HmqBQAdcq/OP+/DlTVxLvsCzRTnZuGg== -"@babel/core@^7.11.6": +"@babel/core@^7.11.6", "@babel/core@^7.12.3": version "7.18.5" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.18.5.tgz#c597fa680e58d571c28dda9827669c78cdd7f000" integrity sha512-MGY8vg3DxMnctw0LdvSEojOsumc70g0t18gNyUdAZqB1Rpd1Bqo/svHGvt+UJ6JcGX+DIekGFDxxIWofBxLCnQ== @@ -1049,27 +1063,6 @@ json5 "^2.2.1" semver "^6.3.0" -"@babel/core@^7.12.3": - version "7.18.2" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.18.2.tgz#87b2fcd7cce9becaa7f5acebdc4f09f3dd19d876" - integrity sha512-A8pri1YJiC5UnkdrWcmfZTJTV85b4UXTAfImGmCfYmax4TR9Cw8sDS0MOk++Gp2mE/BefVJ5nwy5yzqNJbP/DQ== - dependencies: - "@ampproject/remapping" "^2.1.0" - "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.18.2" - "@babel/helper-compilation-targets" "^7.18.2" - "@babel/helper-module-transforms" "^7.18.0" - "@babel/helpers" "^7.18.2" - "@babel/parser" "^7.18.0" - "@babel/template" "^7.16.7" - "@babel/traverse" "^7.18.2" - "@babel/types" "^7.18.2" - convert-source-map "^1.7.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.2.1" - semver "^6.3.0" - "@babel/generator@^7.18.2", "@babel/generator@^7.7.2": version "7.18.2" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.18.2.tgz#33873d6f89b21efe2da63fe554460f3df1c5880d" @@ -1177,12 +1170,7 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.7", "@babel/parser@^7.18.0": - version "7.18.4" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.18.4.tgz#6774231779dd700e0af29f6ad8d479582d7ce5ef" - integrity sha512-FDge0dFazETFcxGw/EXzOkN8uJp0PC7Qbm+Pe9T+av2zlBpOgunFHkQPPn+eRuClU73JF+98D531UgayY89tow== - -"@babel/parser@^7.18.5": +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.7", "@babel/parser@^7.18.5": version "7.18.5" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.18.5.tgz#337062363436a893a2d22faa60be5bb37091c83c" integrity sha512-YZWVaglMiplo7v8f1oMQ5ZPQr0vn7HPeZXxXWsxXJRjGVrzUFn9OxFQl1sb5wzfootjA/yChhW84BV+383FSOw== @@ -1287,23 +1275,7 @@ "@babel/parser" "^7.16.7" "@babel/types" "^7.16.7" -"@babel/traverse@^7.18.0", "@babel/traverse@^7.18.2", "@babel/traverse@^7.7.2": - version "7.18.2" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.18.2.tgz#b77a52604b5cc836a9e1e08dca01cba67a12d2e8" - integrity sha512-9eNwoeovJ6KH9zcCNnENY7DMFwTU9JdGCFtqNLfUAqtUHRCOsTOqWoffosP8vKmNYeSBUv3yVJXjfd8ucwOjUA== - dependencies: - "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.18.2" - "@babel/helper-environment-visitor" "^7.18.2" - "@babel/helper-function-name" "^7.17.9" - "@babel/helper-hoist-variables" "^7.16.7" - "@babel/helper-split-export-declaration" "^7.16.7" - "@babel/parser" "^7.18.0" - "@babel/types" "^7.18.2" - debug "^4.1.0" - globals "^11.1.0" - -"@babel/traverse@^7.18.5": +"@babel/traverse@^7.18.0", "@babel/traverse@^7.18.2", "@babel/traverse@^7.18.5", "@babel/traverse@^7.7.2": version "7.18.5" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.18.5.tgz#94a8195ad9642801837988ab77f36e992d9a20cd" integrity sha512-aKXj1KT66sBj0vVzk6rEeAO6Z9aiiQ68wfDgge3nHhA/my6xMM/7HGQUNumKZaoa2qUPQ5whJG9aAifsxUKfLA== @@ -1958,17 +1930,17 @@ "@octokit/types" "^6.0.3" universal-user-agent "^6.0.0" -"@octokit/openapi-types@^11.2.0": - version "11.2.0" - resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-11.2.0.tgz#b38d7fc3736d52a1e96b230c1ccd4a58a2f400a6" - integrity sha512-PBsVO+15KSlGmiI8QAzaqvsNlZlrDlyAJYcrXBCvVUxCp7VnXjkwPoFHgjEJXx3WF9BAwkA6nfCUA7i9sODzKA== +"@octokit/openapi-types@^12.1.0": + version "12.1.0" + resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-12.1.0.tgz#a68b60e969f26dee0eb7d127c65a84967f2d3a6e" + integrity sha512-kQzJh3ZUv3lDpi6M+uekMRHULvf9DlWoI1XgKN6nPeGDzkSgtkhVq1MMz3bFKQ6H6GbdC3ZqG/a6VzKhIx0VeA== "@octokit/plugin-paginate-rest@^2.16.8": - version "2.17.0" - resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.17.0.tgz#32e9c7cab2a374421d3d0de239102287d791bce7" - integrity sha512-tzMbrbnam2Mt4AhuyCHvpRkS0oZ5MvwwcQPYGtMv4tUa5kkzG58SVB0fcsLulOZQeRnOgdkZWkRUiyBlh0Bkyw== + version "2.18.0" + resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.18.0.tgz#e412977782690a4134b0a4aa2f536cca7a2ca125" + integrity sha512-n5/AzIoy5Wzp85gqzSbR+dWQDHlyHZrGijnDfLh452547Ynu0hCvszH7EfRE0eqM5ZjfkplO0k+q+P8AAIIJEA== dependencies: - "@octokit/types" "^6.34.0" + "@octokit/types" "^6.35.0" "@octokit/plugin-request-log@^1.0.4": version "1.0.4" @@ -1976,11 +1948,11 @@ integrity sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA== "@octokit/plugin-rest-endpoint-methods@^5.12.0": - version "5.13.0" - resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.13.0.tgz#8c46109021a3412233f6f50d28786f8e552427ba" - integrity sha512-uJjMTkN1KaOIgNtUPMtIXDOjx6dGYysdIFhgA52x4xSadQCz3b/zJexvITDVpANnfKPW/+E0xkOvLntqMYpviA== + version "5.14.0" + resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.14.0.tgz#758e01ac40998e607feaea7f80220c69990814ae" + integrity sha512-MRnMs4Dcm1OSaz/g/RLr4YY9otgysS7vN5SUkHGd7t+R8323cHsHFoEWHYPSmgUC0BieHRhvnCRWb4i3Pl+Lgg== dependencies: - "@octokit/types" "^6.34.0" + "@octokit/types" "^6.35.0" deprecation "^2.3.1" "@octokit/request-error@^2.0.5", "@octokit/request-error@^2.1.0": @@ -2014,12 +1986,12 @@ "@octokit/plugin-request-log" "^1.0.4" "@octokit/plugin-rest-endpoint-methods" "^5.12.0" -"@octokit/types@^6.0.3", "@octokit/types@^6.16.1", "@octokit/types@^6.34.0": - version "6.34.0" - resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.34.0.tgz#c6021333334d1ecfb5d370a8798162ddf1ae8218" - integrity sha512-s1zLBjWhdEI2zwaoSgyOFoKSl109CUcVBCc7biPJ3aAf6LGLU6szDvi31JPU7bxfla2lqfhjbbg/5DdFNxOwHw== +"@octokit/types@^6.0.3", "@octokit/types@^6.16.1", "@octokit/types@^6.35.0": + version "6.35.0" + resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.35.0.tgz#11cd9a679c32b4a6c36459ae2ec3ac4de0104f71" + integrity sha512-DhLfdUuv3H37u6jBDfkwamypx3HflHg29b26nbA6iVFYkAlZ5cMEtu/9pQoihGnQE5M7jJFnNo25Rr1UwQNF8Q== dependencies: - "@octokit/openapi-types" "^11.2.0" + "@octokit/openapi-types" "^12.1.0" "@openpgp/web-stream-tools@0.0.10": version "0.0.10" @@ -2117,6 +2089,7 @@ "@renovate/eslint-plugin@https://github.com/renovatebot/eslint-plugin#v0.0.4": version "0.0.4" + uid "0c444386e79d6145901212507521b8a0a48af000" resolved "https://github.com/renovatebot/eslint-plugin#0c444386e79d6145901212507521b8a0a48af000" "@renovatebot/pep440@2.1.3": @@ -2369,14 +2342,14 @@ integrity sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA== "@tsconfig/node12@^1.0.7": - version "1.0.10" - resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.10.tgz#10fecee4a3be17357ce99b370bd81874044d8dbd" - integrity sha512-N+srakvPaYMGkwjNDx3ASx65Zl3QG8dJgVtIB+YMOkucU+zctlv/hdP5250VKdDHSDoW9PFZoCqbqNcAPjCjXA== + version "1.0.11" + resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" + integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== "@tsconfig/node14@^1.0.0": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.2.tgz#b09c08de2eb319ca2acab17a1b8028af110b24b3" - integrity sha512-YwrUA5ysDXHFYfL0Xed9x3sNS4P+aKlCOnnbqUa2E5HdQshHFleCJVrj1PlGTb4GgFUCDyte1v3JWLy2sz8Oqg== + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" + integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== "@tsconfig/node16@^1.0.2": version "1.0.3" @@ -2664,9 +2637,9 @@ "@types/node" "*" "@types/node@*": - version "17.0.42" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.42.tgz#d7e8f22700efc94d125103075c074396b5f41f9b" - integrity sha512-Q5BPGyGKcvQgAMbsr7qEGN/kIPN6zZecYYABeTDBizOsau+2NMdSVTar9UQw21A2+JyA2KRNDYaYrPB0Rpk2oQ== + version "18.0.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.0.0.tgz#67c7b724e1bcdd7a8821ce0d5ee184d3b4dd525a" + integrity sha512-cHlGmko4gWLVI27cGJntjs/Sj8th9aYwplmZFwmmgYQQvL5NUsgVJG7OddLvNfLqYS31KFN0s3qlaD9qCaxACA== "@types/node@16.11.39": version "16.11.39" @@ -2720,11 +2693,16 @@ resolved "https://registry.yarnpkg.com/@types/semver-utils/-/semver-utils-1.1.1.tgz#4260b9ce13344725069a1ff86bd2f4d6c70a443e" integrity sha512-WLZZQdwo5P+H6R+bDDCFqFSlP5Jtk6gyXpE0R0KAVQbcMGmxpVsNX8dah640hY4+PpRG2+Ph3dcwDHzrOAOZ7A== -"@types/semver@7.3.9", "@types/semver@^7.1.0": +"@types/semver@7.3.9": version "7.3.9" resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.9.tgz#152c6c20a7688c30b967ec1841d31ace569863fc" integrity sha512-L/TMpyURfBkf+o/526Zb6kd/tchUP3iBDEPjqjb+U2MAJhVRxxrmr2fwpe08E7QsV7YLcpq0tUaQ9O9x97ZIxQ== +"@types/semver@^7.1.0": + version "7.3.10" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.10.tgz#5f19ee40cbeff87d916eedc8c2bfe2305d957f73" + integrity sha512-zsv3fsC7S84NN6nPK06u79oWgrPVd0NvOyqgghV1haPaFcVxIrP4DLomRwGAXk0ui4HZA7mOcSFL98sMVW9viw== + "@types/shelljs@0.8.11": version "0.8.11" resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.8.11.tgz#17a5696c825974e96828e96e89585d685646fcb8" @@ -2822,11 +2800,11 @@ tsutils "^3.21.0" "@typescript-eslint/experimental-utils@^5.3.0": - version "5.27.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.27.1.tgz#c5c5121a75cf875bfae8083c50f5ae7bfde6145a" - integrity sha512-Vd8uewIixGP93sEnmTRIH6jHZYRQRkGPDPpapACMvitJKX8335VHNyqKTE+mZ+m3E2c5VznTZfSsSsS5IF7vUA== + version "5.28.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.28.0.tgz#bdd4ad11c6f5803a193ed0b2220a7749de98e080" + integrity sha512-pPQ1Ng4qezQijXBBfYlogcOPnMs1q14l8C4fWJJ4PnFla4MA2b2oBfdkf02r1lNak2tpBVNJxvey9oWlPQWc4w== dependencies: - "@typescript-eslint/utils" "5.27.1" + "@typescript-eslint/utils" "5.28.0" "@typescript-eslint/parser@5.27.1": version "5.27.1" @@ -2846,6 +2824,14 @@ "@typescript-eslint/types" "5.27.1" "@typescript-eslint/visitor-keys" "5.27.1" +"@typescript-eslint/scope-manager@5.28.0": + version "5.28.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.28.0.tgz#ef9a5c68fecde72fd2ff8a84b9c120324826c1b9" + integrity sha512-LeBLTqF/he1Z+boRhSqnso6YrzcKMTQ8bO/YKEe+6+O/JGof9M0g3IJlIsqfrK/6K03MlFIlycbf1uQR1IjE+w== + dependencies: + "@typescript-eslint/types" "5.28.0" + "@typescript-eslint/visitor-keys" "5.28.0" + "@typescript-eslint/type-utils@5.27.1": version "5.27.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.27.1.tgz#369f695199f74c1876e395ebea202582eb1d4166" @@ -2860,6 +2846,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.27.1.tgz#34e3e629501349d38be6ae97841298c03a6ffbf1" integrity sha512-LgogNVkBhCTZU/m8XgEYIWICD6m4dmEDbKXESCbqOXfKZxRKeqpiJXQIErv66sdopRKZPo5l32ymNqibYEH/xg== +"@typescript-eslint/types@5.28.0": + version "5.28.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.28.0.tgz#cffd9bcdce28db6daaa146e48a0be4387a6f4e9d" + integrity sha512-2OOm8ZTOQxqkPbf+DAo8oc16sDlVR5owgJfKheBkxBKg1vAfw2JsSofH9+16VPlN9PWtv8Wzhklkqw3k/zCVxA== + "@typescript-eslint/typescript-estree@5.27.1": version "5.27.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.27.1.tgz#7621ee78607331821c16fffc21fc7a452d7bc808" @@ -2873,7 +2864,20 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.27.1", "@typescript-eslint/utils@^5.10.0": +"@typescript-eslint/typescript-estree@5.28.0": + version "5.28.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.28.0.tgz#3487d158d091ca2772b285e67412ff6d9797d863" + integrity sha512-9GX+GfpV+F4hdTtYc6OV9ZkyYilGXPmQpm6AThInpBmKJEyRSIjORJd1G9+bknb7OTFYL+Vd4FBJAO6T78OVqA== + dependencies: + "@typescript-eslint/types" "5.28.0" + "@typescript-eslint/visitor-keys" "5.28.0" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + semver "^7.3.7" + tsutils "^3.21.0" + +"@typescript-eslint/utils@5.27.1": version "5.27.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.27.1.tgz#b4678b68a94bc3b85bf08f243812a6868ac5128f" integrity sha512-mZ9WEn1ZLDaVrhRaYgzbkXBkTPghPFsup8zDbbsYTxC5OmqrFE7skkKS/sraVsLP3TcT3Ki5CSyEFBRkLH/H/w== @@ -2885,6 +2889,18 @@ eslint-scope "^5.1.1" eslint-utils "^3.0.0" +"@typescript-eslint/utils@5.28.0", "@typescript-eslint/utils@^5.10.0": + version "5.28.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.28.0.tgz#b27a136eac300a48160b36d2aad0da44a1341b99" + integrity sha512-E60N5L0fjv7iPJV3UGc4EC+A3Lcj4jle9zzR0gW7vXhflO7/J29kwiTGITA2RlrmPokKiZbBy2DgaclCaEUs6g== + dependencies: + "@types/json-schema" "^7.0.9" + "@typescript-eslint/scope-manager" "5.28.0" + "@typescript-eslint/types" "5.28.0" + "@typescript-eslint/typescript-estree" "5.28.0" + eslint-scope "^5.1.1" + eslint-utils "^3.0.0" + "@typescript-eslint/visitor-keys@5.27.1": version "5.27.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.27.1.tgz#05a62666f2a89769dac2e6baa48f74e8472983af" @@ -2893,6 +2909,14 @@ "@typescript-eslint/types" "5.27.1" eslint-visitor-keys "^3.3.0" +"@typescript-eslint/visitor-keys@5.28.0": + version "5.28.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.28.0.tgz#982bb226b763c48fc1859a60de33fbf939d40a0f" + integrity sha512-BtfP1vCor8cWacovzzPFOoeW4kBQxzmhxGoOpt0v1SFvG+nJ0cWaVdJk7cky1ArTcFHHKNIxyo2LLr3oNkSuXA== + dependencies: + "@typescript-eslint/types" "5.28.0" + eslint-visitor-keys "^3.3.0" + "@yarnpkg/core@3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@yarnpkg/core/-/core-3.1.0.tgz#6bfc9b906df0d128e4627efe9c2d830c30610d48" @@ -3439,7 +3463,7 @@ bunyan@1.8.15: mv "~2" safe-json-stringify "~1" -cacache@16.1.1, cacache@^16.0.0, cacache@^16.0.6, cacache@^16.1.0: +cacache@16.1.1, cacache@^16.0.0, cacache@^16.0.6, cacache@^16.1.0, cacache@^16.1.1: version "16.1.1" resolved "https://registry.yarnpkg.com/cacache/-/cacache-16.1.1.tgz#4e79fb91d3efffe0630d5ad32db55cc1b870669c" integrity sha512-VDKN+LHyCQXaaYZ7rA/qtkURU+/yYhviUdvqEv2LT6QPZU8jpyzEkEVAcKlKLt5dJ5BRp11ym8lo3NKLluEPLg== @@ -3543,9 +3567,9 @@ camelcase@^6.2.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001349: - version "1.0.30001352" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001352.tgz#cc6f5da3f983979ad1e2cdbae0505dccaa7c6a12" - integrity sha512-GUgH8w6YergqPQDGWhJGt8GDRnY0L/iJVQcU3eJ46GYf52R8tk0Wxp0PymuFVZboJYXGiCqwozAYZNRjVj6IcA== + version "1.0.30001356" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001356.tgz#cbf5fe7b33f90962bfbca532212ea478d4ec9de8" + integrity sha512-/30854bktMLhxtjieIxsrJBfs2gTM1pel6MXKF3K+RdIVJZcsn2A2QdhsuR4/p9+R204fZw0zCBBhktX8xWuyQ== cardinal@^2.1.1: version "2.1.1" @@ -3630,9 +3654,9 @@ ci-info@^2.0.0: integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== ci-info@^3.2.0: - version "3.3.1" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.3.1.tgz#58331f6f472a25fe3a50a351ae3052936c2c7f32" - integrity sha512-SXgeMX9VwDe7iFFaEWkA5AstuER9YKqy4EhHqr4DVqkwmD9rpVimkMKWHdjn30Ja45txyjhSn63lVX69eVCckg== + version "3.3.2" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.3.2.tgz#6d2967ffa407466481c6c90b6e16b3098f080128" + integrity sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg== cidr-regex@^3.1.1: version "3.1.1" @@ -4226,9 +4250,9 @@ editorconfig@0.15.3: sigmund "^1.0.1" electron-to-chromium@^1.4.147: - version "1.4.152" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.152.tgz#7dedbe8f3dc1c597088982a203f392e60f7ee90a" - integrity sha512-jk4Ju5SGZAQQJ1iI4Rgru7dDlvkQPLpNPWH9gIZmwCD4YteA5Bbk1xPcPDUf5jUYs3e1e80RXdi8XgKQZaigeg== + version "1.4.161" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.161.tgz#49cb5b35385bfee6cc439d0a04fbba7a7a7f08a1" + integrity sha512-sTjBRhqh6wFodzZtc5Iu8/R95OkwaPNn7tj/TaDU5nu/5EFiQDtADGAXdR4tJcTEHlYfJpHqigzJqHvPgehP8A== email-addresses@5.0.0: version "5.0.0" @@ -5546,7 +5570,7 @@ is-cidr@^4.0.2: dependencies: cidr-regex "^3.1.1" -is-core-module@^2.5.0, is-core-module@^2.8.1: +is-core-module@^2.5.0, is-core-module@^2.8.1, is-core-module@^2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.9.0.tgz#e1c34429cd51c6dd9e09e0799e396e27b19a9c69" integrity sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A== @@ -6671,7 +6695,7 @@ make-error@1.x, make-error@^1.1.1: resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== -make-fetch-happen@^10.0.3, make-fetch-happen@^10.0.6, make-fetch-happen@^10.1.6: +make-fetch-happen@^10.0.3, make-fetch-happen@^10.0.6, make-fetch-happen@^10.1.7: version "10.1.7" resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-10.1.7.tgz#b1402cb3c9fad92b380ff3a863cdae5414a42f76" integrity sha512-J/2xa2+7zlIUKqfyXDCXFpH3ypxO4k3rgkZHPSZkyUYcBT/hM80M3oyKLM/9dVriZFiGeGGS2Ei+0v2zfhqj3Q== @@ -6804,9 +6828,9 @@ marked-terminal@^5.0.0: supports-hyperlinks "^2.2.0" marked@^4.0.10: - version "4.0.16" - resolved "https://registry.yarnpkg.com/marked/-/marked-4.0.16.tgz#9ec18fc1a723032eb28666100344d9428cf7a264" - integrity sha512-wahonIQ5Jnyatt2fn8KqF/nIqZM8mh3oRu2+l5EANGMhu6RFjiSG52QNE2eWzFMI94HqYSgN184NurgNG6CztA== + version "4.0.17" + resolved "https://registry.yarnpkg.com/marked/-/marked-4.0.17.tgz#1186193d85bb7882159cdcfc57d1dfccaffb3fe9" + integrity sha512-Wfk0ATOK5iPxM4ptrORkFemqroz0ZDxp5MWfYA7H/F+wO17NRWV5Ypxi6p3g2Xmw2bKeiYOl6oVnLHKxBA0VhA== marshal@0.5.4: version "0.5.4" @@ -7407,9 +7431,9 @@ npm-pick-manifest@^7.0.0, npm-pick-manifest@^7.0.1: semver "^7.3.5" npm-profile@^6.0.3: - version "6.0.3" - resolved "https://registry.yarnpkg.com/npm-profile/-/npm-profile-6.0.3.tgz#f4a11ce09467f00fa0832db7f27992e55fdfc94b" - integrity sha512-TVeHhnol2Iemud+Sr70/uqax5LnLJ9y361w+m5+Z7WYV2B1t6FhRDxDu72+yYYTvsgshkhnXEqbPjuD87kYXfA== + version "6.1.0" + resolved "https://registry.yarnpkg.com/npm-profile/-/npm-profile-6.1.0.tgz#2f32431c487cb21ef5882c9511f8be8a0b602d35" + integrity sha512-JHnBzSqS9xPa0M3g90zhaGElSVdxoAipGkraBaM6Jph2XiSiwFN1HmfRTqndYhDkXia2hWRWl8O5RbDvae++GA== dependencies: npm-registry-fetch "^13.0.1" proc-log "^2.0.0" @@ -7455,9 +7479,9 @@ npm-user-validate@^1.0.1: integrity sha512-uQwcd/tY+h1jnEaze6cdX/LrhWhoBxfSknxentoqmIuStxUExxjWd3ULMLFPiFUrZKbOVMowH6Jq2FRWfmhcEw== npm@^8.3.0: - version "8.12.1" - resolved "https://registry.yarnpkg.com/npm/-/npm-8.12.1.tgz#624064fa7a8e0730223f6b2effe087e7127d567b" - integrity sha512-0yOlhfgu1UzP6UijnaFuIS2bES2H9D90EA5OVsf2iOZw7VBrjntXKEwKfCaFA6vMVWkCP8qnPwCxxPdnDVwlNw== + version "8.12.2" + resolved "https://registry.yarnpkg.com/npm/-/npm-8.12.2.tgz#d9be9d6368b0bd9d0e963b25a662c79909ca8bbf" + integrity sha512-TArexqro9wpl/6wz6t6YdYhOoiy/UArqiSsSsqI7fieEhQEswDQSJcgt/LuCDjl6mfCDi0So7S2UZ979qLYRPg== dependencies: "@isaacs/string-locale-compare" "^1.1.0" "@npmcli/arborist" "^5.0.4" @@ -7469,7 +7493,7 @@ npm@^8.3.0: "@npmcli/run-script" "^3.0.1" abbrev "~1.1.1" archy "~1.0.0" - cacache "^16.1.0" + cacache "^16.1.1" chalk "^4.1.2" chownr "^2.0.0" cli-columns "^4.0.0" @@ -7494,7 +7518,7 @@ npm@^8.3.0: libnpmsearch "^5.0.2" libnpmteam "^4.0.2" libnpmversion "^3.0.1" - make-fetch-happen "^10.1.6" + make-fetch-happen "^10.1.7" minipass "^3.1.6" minipass-pipeline "^1.2.4" mkdirp "^1.0.4" @@ -8132,7 +8156,7 @@ quick-lru@^5.1.1: resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932" integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA== -rc@^1.2.8: +rc@1.2.8, rc@^1.2.8: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== @@ -8157,9 +8181,9 @@ react-is@^17.0.1: integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== react-is@^18.0.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.1.0.tgz#61aaed3096d30eacf2a2127118b5b41387d32a67" - integrity sha512-Fl7FuabXsJnV5Q1qIOQwx/sagGF18kogb4gpfcG4gjLBWO0WDiiz1ko/ExayuxE7InyQkBLkxRFG5oxY6Uu3Kg== + version "18.2.0" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" + integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== read-cmd-shim@^3.0.0: version "3.0.0" @@ -8313,11 +8337,11 @@ regexpp@^3.2.0: integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== registry-auth-token@^4.0.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-4.2.1.tgz#6d7b4006441918972ccd5fedcd41dc322c79b250" - integrity sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw== + version "4.2.2" + resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-4.2.2.tgz#f02d49c3668884612ca031419491a13539e21fac" + integrity sha512-PC5ZysNb42zpFME6D/XlIgtNGdTl8bBOCw90xQLVMpzuuubJKYDWFAEuUNc+Cn8Z8724tg2SDhDRrkVEsqfDMg== dependencies: - rc "^1.2.8" + rc "1.2.8" remark-github@10.1.0: version "10.1.0" @@ -8389,11 +8413,11 @@ resolve.exports@^1.1.0: integrity sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ== resolve@^1.1.6, resolve@^1.10.0, resolve@^1.20.0, resolve@^1.22.0: - version "1.22.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.0.tgz#5e0b8c67c15df57a89bdbabe603a002f21731198" - integrity sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw== + version "1.22.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" + integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== dependencies: - is-core-module "^2.8.1" + is-core-module "^2.9.0" path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" @@ -9309,9 +9333,9 @@ uc.micro@^1.0.1, uc.micro@^1.0.5: integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA== uglify-js@^3.1.4: - version "3.16.0" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.16.0.tgz#b778ba0831ca102c1d8ecbdec2d2bdfcc7353190" - integrity sha512-FEikl6bR30n0T3amyBh3LoiBdqHRy/f4H80+My34HOesOKyHfOsxAPAxOoqC0JUnC1amnO0IwkYC3sko51caSw== + version "3.16.1" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.16.1.tgz#0e7ec928b3d0b1e1d952bce634c384fd56377317" + integrity sha512-X5BGTIDH8U6IQ1TIRP62YC36k+ULAa1d59BxlWvPUJ1NkW5L3FwcGfEzuVvGmhJFBu0YJ5Ge25tmRISqCmLiRQ== unbox-primitive@^1.0.2: version "1.0.2" From c42957a804d501e10eed19a1bf96069eaa9c1fdf Mon Sep 17 00:00:00 2001 From: RahulGautamSingh Date: Mon, 20 Jun 2022 12:10:57 +0530 Subject: [PATCH 140/240] refactor(modules/versioning): fix null check issues in tests (#16145) * fix null-check issues * Update lib/modules/versioning/versioning-metadata.spec.ts Co-authored-by: Michael Kriese --- lib/modules/versioning/composer/index.spec.ts | 2 +- lib/modules/versioning/docker/index.spec.ts | 4 ++-- lib/modules/versioning/hashicorp/index.spec.ts | 2 +- lib/modules/versioning/index.spec.ts | 8 ++++---- lib/modules/versioning/poetry/index.spec.ts | 2 +- lib/modules/versioning/regex/index.spec.ts | 8 ++++---- lib/modules/versioning/versioning-metadata.spec.ts | 2 +- tsconfig.strict.json | 1 - 8 files changed, 14 insertions(+), 15 deletions(-) diff --git a/lib/modules/versioning/composer/index.spec.ts b/lib/modules/versioning/composer/index.spec.ts index 3c4543f740a8ff..56820f37fa2518 100644 --- a/lib/modules/versioning/composer/index.spec.ts +++ b/lib/modules/versioning/composer/index.spec.ts @@ -71,7 +71,7 @@ describe('modules/versioning/composer/index', () => { ${'0.3.1'} | ${'~0.4'} | ${true} ${'0.5.1'} | ${'~0.4'} | ${false} `('isLessThanRange("$a", "$b") === $expected', ({ a, b, expected }) => { - expect(semver.isLessThanRange(a, b)).toBe(expected); + expect(semver.isLessThanRange?.(a, b)).toBe(expected); }); test.each` diff --git a/lib/modules/versioning/docker/index.spec.ts b/lib/modules/versioning/docker/index.spec.ts index 4238599b26532f..8f420eb63dfb80 100644 --- a/lib/modules/versioning/docker/index.spec.ts +++ b/lib/modules/versioning/docker/index.spec.ts @@ -60,7 +60,7 @@ describe('modules/versioning/docker/index', () => { `( 'isLessThanRange($version, $range) === $expected', ({ version, range, expected }) => { - expect(docker.isLessThanRange(version, range)).toBe(expected); + expect(docker.isLessThanRange?.(version, range)).toBe(expected); } ); @@ -205,7 +205,7 @@ describe('modules/versioning/docker/index', () => { ${'3.8.2'} | ${'3.8.2'} ${undefined} | ${undefined} `('valueToVersion("$value") === $expected', ({ value, expected }) => { - const res = docker.valueToVersion(value); + const res = docker.valueToVersion?.(value); expect(res).toBe(expected); }); }); diff --git a/lib/modules/versioning/hashicorp/index.spec.ts b/lib/modules/versioning/hashicorp/index.spec.ts index fc4d18bb2c3994..ef3904d9f88de2 100644 --- a/lib/modules/versioning/hashicorp/index.spec.ts +++ b/lib/modules/versioning/hashicorp/index.spec.ts @@ -38,7 +38,7 @@ describe('modules/versioning/hashicorp/index', () => { `( 'isLessThanRange($version, $range) === $expected', ({ version, range, expected }) => { - expect(semver.isLessThanRange(version, range)).toBe(expected); + expect(semver.isLessThanRange?.(version, range)).toBe(expected); } ); diff --git a/lib/modules/versioning/index.spec.ts b/lib/modules/versioning/index.spec.ts index 7a0aa24eb1be89..b7c8d3e28afa59 100644 --- a/lib/modules/versioning/index.spec.ts +++ b/lib/modules/versioning/index.spec.ts @@ -8,7 +8,7 @@ import * as allVersioning from '.'; const supportedSchemes = getOptions().find( (option) => option.name === 'versioning' -).allowedValues; +)?.allowedValues; describe('modules/versioning/index', () => { it('has api', () => { @@ -52,7 +52,7 @@ describe('modules/versioning/index', () => { expect(Array.from(vers.keys())).toEqual(Object.keys(loadedVers)); for (const name of vers.keys()) { - const ver = vers.get(name); + const ver = vers.get(name)!; expect(validate(ver, name)).toBeTrue(); } }); @@ -88,7 +88,7 @@ describe('modules/versioning/index', () => { .sort(); function getAllPropertyNames(obj: any): string[] { - const props = []; + const props: string[] = []; let o = obj; do { @@ -102,7 +102,7 @@ describe('modules/versioning/index', () => { return props; } - for (const supportedScheme of supportedSchemes) { + for (const supportedScheme of supportedSchemes ?? []) { it(supportedScheme, () => { const schemeKeys = getAllPropertyNames( allVersioning.get(supportedScheme) diff --git a/lib/modules/versioning/poetry/index.spec.ts b/lib/modules/versioning/poetry/index.spec.ts index bfd2af34d03871..40b28beefa0adb 100644 --- a/lib/modules/versioning/poetry/index.spec.ts +++ b/lib/modules/versioning/poetry/index.spec.ts @@ -145,7 +145,7 @@ describe('modules/versioning/poetry/index', () => { `( 'isLessThanRange("$version", "$range") === "$expected"', ({ version, range, expected }) => { - expect(versioning.isLessThanRange(version, range)).toBe(expected); + expect(versioning.isLessThanRange?.(version, range)).toBe(expected); } ); diff --git a/lib/modules/versioning/regex/index.spec.ts b/lib/modules/versioning/regex/index.spec.ts index b7e3f4b6fef4fb..e8dd5e3dfab6c9 100644 --- a/lib/modules/versioning/regex/index.spec.ts +++ b/lib/modules/versioning/regex/index.spec.ts @@ -237,7 +237,7 @@ describe('modules/versioning/regex/index', () => { `( 'isLessThanRange($version, $range) === $expected', ({ version, range, expected }) => { - expect(regex.isLessThanRange(version, range)).toBe(expected); + expect(regex.isLessThanRange?.(version, range)).toBe(expected); } ); @@ -273,9 +273,9 @@ describe('modules/versioning/regex/index', () => { it('returns newVersion', () => { expect( regex.getNewValue({ - currentValue: null, - rangeStrategy: null, - currentVersion: null, + currentValue: null as never, + rangeStrategy: null as never, + currentVersion: null as never, newVersion: '1.2.3', }) ).toBe('1.2.3'); diff --git a/lib/modules/versioning/versioning-metadata.spec.ts b/lib/modules/versioning/versioning-metadata.spec.ts index 01064e053827bd..ae5c1722df2b78 100644 --- a/lib/modules/versioning/versioning-metadata.spec.ts +++ b/lib/modules/versioning/versioning-metadata.spec.ts @@ -6,7 +6,7 @@ describe('modules/versioning/versioning-metadata', () => { (item) => !item.includes('.') ); for (const versioning of allVersioning) { - let readme: string; + let readme: string | undefined; try { readme = await readFile( 'lib/modules/versioning/' + versioning + '/readme.md', diff --git a/tsconfig.strict.json b/tsconfig.strict.json index 2499723f6bcc10..6d4dc16e5ed380 100644 --- a/tsconfig.strict.json +++ b/tsconfig.strict.json @@ -17,7 +17,6 @@ "lib/workers/**/*.spec.ts", "lib/modules/datasource/**/*.spec.ts", "lib/modules/manager/**/*.spec.ts", - "lib/modules/versioning/**/*.spec.ts", "lib/renovate.ts", "lib/renovate.spec.ts", "lib/workers/global/autodiscover.ts", From 61f2d813e22136028ba5d9637038e0a09eed2661 Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Mon, 20 Jun 2022 11:10:31 +0300 Subject: [PATCH 141/240] feat(github): Datasource cache busting (#16014) --- .../github-releases/cache/cache-base.spec.ts | 79 +++++++++++++++++++ .../github-releases/cache/cache-base.ts | 41 +++++++++- .../datasource/github-releases/cache/types.ts | 5 ++ .../update/pr/changelog/github/index.ts | 13 +-- 4 files changed, 131 insertions(+), 7 deletions(-) diff --git a/lib/modules/datasource/github-releases/cache/cache-base.spec.ts b/lib/modules/datasource/github-releases/cache/cache-base.spec.ts index fcb2831567952b..bfb558cdc12926 100644 --- a/lib/modules/datasource/github-releases/cache/cache-base.spec.ts +++ b/lib/modules/datasource/github-releases/cache/cache-base.spec.ts @@ -354,4 +354,83 @@ describe('modules/datasource/github-releases/cache/cache-base', () => { }); expect(ts).toEqual(t3); }); + + describe('Changelog-based cache busting', () => { + describe('newChangelogReleaseDetected', () => { + const cache = new TestCache(http, { resetDeltaMinutes: 0 }); + + it('returns false for undefined release argument', () => { + expect( + cache.newChangelogReleaseDetected(undefined, now, {}, {}) + ).toBeFalse(); + }); + + it('returns false if version is present in cache', () => { + expect( + cache.newChangelogReleaseDetected( + { date: now.minus({ minutes: 10 }).toISO(), version: '1.2.3' }, + now, + { minutes: 20 }, + { + '1.2.3': { + bar: '1', + version: '1.2.3', + releaseTimestamp: now.toISO(), + }, + } + ) + ).toBeFalse(); + }); + + it('returns false if changelog release is not fresh', () => { + expect( + cache.newChangelogReleaseDetected( + { date: now.minus({ minutes: 20 }).toISO(), version: '1.2.3' }, + now, + { minutes: 10 }, + {} + ) + ).toBeFalse(); + }); + + it('returns true for fresh changelog release', () => { + expect( + cache.newChangelogReleaseDetected( + { date: now.minus({ minutes: 10 }).toISO(), version: '1.2.3' }, + now, + { minutes: 20 }, + {} + ) + ).toBeTrue(); + }); + }); + + it('forces cache update', async () => { + const lastUpdateTime = now.minus({ minutes: 15 }).toISO(); + const githubTime = now.minus({ minutes: 10 }).toISO(); + const changelogTime = now.minus({ minutes: 5 }).toISO(); + packageCache.get.mockResolvedValueOnce({ + items: {}, + createdAt: lastUpdateTime, + updatedAt: lastUpdateTime, + }); + responses = [ + resp([{ name: '1.0.0', createdAt: githubTime, foo: 'aaa' }]), + ]; + const cache = new TestCache(http, { resetDeltaMinutes: 0 }); + + const res = await cache.getItems({ packageName: 'foo/bar' }, { + version: '1.0.0', + date: changelogTime, + } as never); + + expect(sortItems(res)).toEqual([ + { + bar: 'aaa', + releaseTimestamp: githubTime, + version: '1.0.0', + }, + ]); + }); + }); }); diff --git a/lib/modules/datasource/github-releases/cache/cache-base.ts b/lib/modules/datasource/github-releases/cache/cache-base.ts index 90c80a18ea3ac7..c4167b670db66e 100644 --- a/lib/modules/datasource/github-releases/cache/cache-base.ts +++ b/lib/modules/datasource/github-releases/cache/cache-base.ts @@ -8,6 +8,7 @@ import type { GetReleasesConfig } from '../../types'; import { getApiBaseUrl } from '../common'; import type { CacheOptions, + ChangelogRelease, GithubDatasourceCache, GithubQueryParams, QueryResponse, @@ -163,7 +164,10 @@ export abstract class AbstractGithubDatasourceCache< /** * Pre-fetch, update, or just return the package cache items. */ - async getItems(releasesConfig: GetReleasesConfig): Promise { + async getItems( + releasesConfig: GetReleasesConfig, + changelogRelease?: ChangelogRelease + ): Promise { const { packageName, registryUrl } = releasesConfig; // The time meant to be used across the function @@ -213,7 +217,15 @@ export abstract class AbstractGithubDatasourceCache< } } - if (isExpired(now, cacheUpdatedAt, updateDuration)) { + if ( + isExpired(now, cacheUpdatedAt, updateDuration) || + this.newChangelogReleaseDetected( + changelogRelease, + now, + updateDuration, + cacheItems + ) + ) { const variables: GithubQueryParams = { owner, name, @@ -365,4 +377,29 @@ export abstract class AbstractGithubDatasourceCache< return result; } + + newChangelogReleaseDetected( + changelogRelease: ChangelogRelease | undefined, + now: DateTime, + updateDuration: DurationLikeObject, + cacheItems: Record + ): boolean { + if (!changelogRelease) { + return false; + } + + const releaseTime = changelogRelease.date.toString(); + const isVersionPresentInCache = !!cacheItems[changelogRelease.version]; + const isChangelogReleaseFresh = !isExpired( + now, + releaseTime, + updateDuration + ); + + if (isVersionPresentInCache || !isChangelogReleaseFresh) { + return false; + } + + return true; + } } diff --git a/lib/modules/datasource/github-releases/cache/types.ts b/lib/modules/datasource/github-releases/cache/types.ts index 047aa14daf4bdd..0c6b2321ff85e3 100644 --- a/lib/modules/datasource/github-releases/cache/types.ts +++ b/lib/modules/datasource/github-releases/cache/types.ts @@ -120,3 +120,8 @@ export interface CacheOptions { */ maxUpdatePages?: number; } + +export interface ChangelogRelease { + date: string | Date; + version: string; +} diff --git a/lib/workers/repository/update/pr/changelog/github/index.ts b/lib/workers/repository/update/pr/changelog/github/index.ts index 92c92d6656fbe5..f98a2aeefd5866 100644 --- a/lib/workers/repository/update/pr/changelog/github/index.ts +++ b/lib/workers/repository/update/pr/changelog/github/index.ts @@ -113,7 +113,7 @@ export async function getReleaseNotesMd( export async function getReleaseList( project: ChangeLogProject, - _release: ChangeLogRelease + release: ChangeLogRelease ): Promise { logger.trace('github.getReleaseList()'); // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion @@ -123,10 +123,13 @@ export async function getReleaseList( const notesSourceUrl = `${ensureTrailingSlash( apiBaseUrl )}repos/${repository}/releases`; - const items = await releasesCache.getItems({ - registryUrl: apiBaseUrl, - packageName: repository, - }); + const items = await releasesCache.getItems( + { + registryUrl: apiBaseUrl, + packageName: repository, + }, + release + ); return items.map(({ url, id, version: tag, name, description: body }) => ({ url, notesSourceUrl, From f363b3aef28c046ae5cdfaef74e932b055e3e25f Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Mon, 20 Jun 2022 10:21:44 +0200 Subject: [PATCH 142/240] build: force re2 reinstall (#16146) --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 7d192eb282a7eb..c57f89b0dbe563 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "prepare": "run-s prepare:*", "prepare:husky": "husky install", "prepare:generate": "run-s generate:*", + "prepare:install-re2": "npm explore re2 -- npm run install", "prepare:re2": "node tools/check-re2.mjs", "prestart": "run-s generate:* ", "pretest": "run-s generate:* ", From 73fdf0483e5e06cd977adc874af70718ac08d3b6 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Mon, 20 Jun 2022 10:22:12 +0200 Subject: [PATCH 143/240] ci: use node v16 for windows and macos tests (#16147) --- .github/workflows/build.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c04941cbf2933c..36a12865108123 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,16 +42,15 @@ jobs: include: >- ${{ fromJSON((github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'ci:fulltest')) && '[{ "os": "macos-latest", - "node-version": 14 + "node-version": 16 }, { "os": "windows-latest", - "node-version": 14 + "node-version": 16 }]' || '[]') }} env: coverage: ${{ matrix.os == 'ubuntu-latest' && (matrix.node-version == 14 || matrix.node-version == 16) }} NODE_VERSION: ${{ matrix.node-version }} - JAVA_VERSION: ${{ matrix.java-version }} steps: - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2 From 0cf4f48842183cf0a4ad95485009775c9a7afff9 Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Mon, 20 Jun 2022 12:47:07 +0300 Subject: [PATCH 144/240] refactor: Strict null checks for all files except tests (#16071) Co-authored-by: Michael Kriese --- lib/config/types.ts | 4 +- lib/modules/manager/types.ts | 2 +- lib/util/git/index.ts | 6 +- .../config/parse/host-rules-from-env.ts | 15 +++-- lib/workers/global/config/parse/index.ts | 2 +- lib/workers/global/index.ts | 9 +-- lib/workers/global/initialize.ts | 2 +- lib/workers/repository/error-config.ts | 7 +- lib/workers/repository/errors-warnings.ts | 19 +++--- lib/workers/repository/finalise/index.ts | 5 +- lib/workers/repository/finalise/prune.ts | 3 +- lib/workers/repository/index.ts | 9 +-- lib/workers/repository/init/apis.ts | 5 +- lib/workers/repository/init/vulnerability.ts | 29 ++++---- .../repository/onboarding/branch/check.ts | 7 +- .../repository/onboarding/branch/config.ts | 5 +- .../repository/onboarding/branch/create.ts | 11 ++-- .../repository/onboarding/branch/index.ts | 9 +-- .../repository/onboarding/branch/rebase.ts | 11 ++-- .../onboarding/pr/config-description.ts | 3 +- lib/workers/repository/onboarding/pr/index.ts | 41 +++++++----- .../repository/onboarding/pr/pr-list.ts | 16 +++-- lib/workers/repository/process/deprecated.ts | 17 +++-- .../repository/process/extract-update.ts | 31 ++++++--- lib/workers/repository/process/fetch.ts | 7 +- lib/workers/repository/process/index.ts | 7 +- lib/workers/repository/process/limits.ts | 5 +- lib/workers/repository/process/sort.ts | 7 +- .../repository/process/vulnerabilities.ts | 13 ++-- .../repository/update/branch/auto-replace.ts | 32 +++++---- .../repository/update/branch/automerge.ts | 7 +- .../update/branch/check-existing.ts | 7 +- .../repository/update/branch/commit.ts | 13 ++-- .../branch/execute-post-upgrade-commands.ts | 21 +++--- .../repository/update/branch/get-updated.ts | 42 ++++++------ .../update/branch/handle-existing.ts | 12 ++-- lib/workers/repository/update/branch/index.ts | 55 ++++++++-------- lib/workers/repository/update/branch/reuse.ts | 23 ++++--- lib/workers/repository/update/pr/automerge.ts | 7 +- .../update/pr/changelog/release-notes.ts | 28 ++++---- .../update/pr/changelog/releases.ts | 10 ++- .../update/pr/changelog/source-github.ts | 23 ++++--- .../update/pr/changelog/source-gitlab.ts | 27 ++++---- lib/workers/repository/updates/branch-name.ts | 9 +-- lib/workers/repository/updates/branchify.ts | 13 ++-- lib/workers/repository/updates/flatten.ts | 8 ++- lib/workers/repository/updates/generate.ts | 63 ++++++++++-------- lib/workers/types.ts | 2 +- tsconfig.strict.json | 66 +------------------ 49 files changed, 404 insertions(+), 371 deletions(-) diff --git a/lib/config/types.ts b/lib/config/types.ts index d21e6292a9469e..9fde0ac3300c7a 100644 --- a/lib/config/types.ts +++ b/lib/config/types.ts @@ -419,9 +419,9 @@ export interface PackageRuleInputConfig extends Record { depType?: string; depTypes?: string[]; depName?: string; - currentValue?: string; + currentValue?: string | null; currentVersion?: string; - lockedVersion?: string; + lockedVersion?: string | null; updateType?: UpdateType; isBump?: boolean; sourceUrl?: string | null; diff --git a/lib/modules/manager/types.ts b/lib/modules/manager/types.ts index 0cfd1326450b06..6ee514be284b9d 100644 --- a/lib/modules/manager/types.ts +++ b/lib/modules/manager/types.ts @@ -108,7 +108,7 @@ export interface Package extends ManagerData { npmPackageAlias?: boolean; packageFileVersion?: string; gitRef?: boolean; - sourceUrl?: string; + sourceUrl?: string | null; githubRepo?: string; pinDigests?: boolean; currentRawValue?: string; diff --git a/lib/util/git/index.ts b/lib/util/git/index.ts index 014c0efb17b712..303b53d8a01707 100644 --- a/lib/util/git/index.ts +++ b/lib/util/git/index.ts @@ -251,7 +251,7 @@ async function cleanLocalBranches(): Promise { export function setGitAuthor(gitAuthor: string | undefined): void { const gitAuthorParsed = parseGitAuthor( - gitAuthor || 'Renovate Bot ' + gitAuthor ?? 'Renovate Bot ' ); if (!gitAuthorParsed) { const error = new Error(CONFIG_VALIDATION); @@ -769,7 +769,7 @@ export async function getFile( await syncGit(); try { const content = await git.show([ - 'origin/' + (branchName || config.currentBranch) + ':' + filePath, + 'origin/' + (branchName ?? config.currentBranch) + ':' + filePath, ]); return content; } catch (err) { @@ -1022,7 +1022,7 @@ export function getUrl({ return `git@${hostname}:${repository}.git`; } return URL.format({ - protocol: protocol || 'https', + protocol: protocol ?? 'https', auth, hostname, host, diff --git a/lib/workers/global/config/parse/host-rules-from-env.ts b/lib/workers/global/config/parse/host-rules-from-env.ts index 9a43ddd1b70dd6..f4b85dab3fa0e7 100644 --- a/lib/workers/global/config/parse/host-rules-from-env.ts +++ b/lib/workers/global/config/parse/host-rules-from-env.ts @@ -2,9 +2,14 @@ import { logger } from '../../../../logger'; import { getDatasourceList } from '../../../../modules/datasource'; import type { HostRule } from '../../../../types'; +type AuthField = 'token' | 'username' | 'password'; + +function isAuthField(x: unknown): x is AuthField { + return x === 'token' || x === 'username' || x === 'password'; +} + export function hostRulesFromEnv(env: NodeJS.ProcessEnv): HostRule[] { const datasources = new Set(getDatasourceList()); - const fields = ['token', 'username', 'password']; const hostRules: HostRule[] = []; @@ -17,11 +22,11 @@ export function hostRulesFromEnv(env: NodeJS.ProcessEnv): HostRule[] { } // Double underscore __ is used in place of hyphen - const splitEnv = envName.toLowerCase().replace(/__/g, '-').split('_'); - const hostType = splitEnv.shift(); + const hostType = splitEnv.shift()!; if (datasources.has(hostType)) { - const suffix = splitEnv.pop(); - if (fields.includes(suffix)) { - let matchHost: string; + const suffix = splitEnv.pop()!; + if (isAuthField(suffix)) { + let matchHost: string | undefined = undefined; const rule: HostRule = {}; rule[suffix] = env[envName]; if (splitEnv.length === 0) { diff --git a/lib/workers/global/config/parse/index.ts b/lib/workers/global/config/parse/index.ts index 9f15970620ddb4..3b2947d4c6b845 100644 --- a/lib/workers/global/config/parse/index.ts +++ b/lib/workers/global/config/parse/index.ts @@ -84,7 +84,7 @@ export async function parseConfigs( if (config.detectHostRulesFromEnv) { const hostRules = hostRulesFromEnv(env); - config.hostRules = [...config.hostRules, ...hostRules]; + config.hostRules = [...(config.hostRules ?? []), ...hostRules]; } // Get global config logger.trace({ config }, 'Full config'); diff --git a/lib/workers/global/index.ts b/lib/workers/global/index.ts index f88d724791eee3..f41b40ad017456 100644 --- a/lib/workers/global/index.ts +++ b/lib/workers/global/index.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import is from '@sindresorhus/is'; import { ERROR } from 'bunyan'; import fs from 'fs-extra'; @@ -56,7 +57,7 @@ function haveReachedLimits(): boolean { /* istanbul ignore next */ function checkEnv(): void { - const range = pkg.engines.node; + const range = pkg.engines!.node; const rangeNext = pkg['engines-next']?.node; if (process.release?.name !== 'node' || !process.versions?.node) { logger.warn( @@ -141,7 +142,7 @@ export async function start(): Promise { } // Iterate through repositories sequentially - for (const repository of config.repositories) { + for (const repository of config.repositories!) { if (haveReachedLimits()) { break; } @@ -161,13 +162,13 @@ export async function start(): Promise { } else { logger.fatal({ err }, `Fatal error: ${String(err.message)}`); } - if (!config) { + if (!config!) { // return early if we can't parse config options logger.debug(`Missing config`); return 2; } } finally { - await globalFinalize(config); + await globalFinalize(config!); logger.debug(`Renovate exiting`); } const loggerErrors = getProblems().filter((p) => p.level >= ERROR); diff --git a/lib/workers/global/initialize.ts b/lib/workers/global/initialize.ts index 0859eab1a94353..45558a690bd88e 100644 --- a/lib/workers/global/initialize.ts +++ b/lib/workers/global/initialize.ts @@ -12,7 +12,7 @@ import { Limit, setMaxLimit } from './limits'; async function setDirectories(input: AllConfig): Promise { const config: AllConfig = { ...input }; - process.env.TMPDIR = process.env.RENOVATE_TMPDIR || os.tmpdir(); + process.env.TMPDIR = process.env.RENOVATE_TMPDIR ?? os.tmpdir(); if (config.baseDir) { logger.debug('Using configured baseDir: ' + config.baseDir); } else { diff --git a/lib/workers/repository/error-config.ts b/lib/workers/repository/error-config.ts index 598ba15272f98f..dc42b9a442440c 100644 --- a/lib/workers/repository/error-config.ts +++ b/lib/workers/repository/error-config.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { GlobalConfig } from '../../config/global'; import type { RenovateConfig } from '../../config/types'; import { logger } from '../../logger'; @@ -14,14 +15,14 @@ export async function raiseConfigWarningIssue( if (error.validationSource) { body += `Location: \`${error.validationSource}\`\n`; } - body += `Error type: ${error.validationError}\n`; + body += `Error type: ${error.validationError!}\n`; if (error.validationMessage) { body += `Message: \`${error.validationMessage.replace( regEx(/`/g), "'" )}\`\n`; } - const pr = await platform.getBranchPr(config.onboardingBranch); + const pr = await platform.getBranchPr(config.onboardingBranch!); if (pr?.state === PrState.Open) { logger.debug('Updating onboarding PR with config error notice'); body = `## Action Required: Fix Renovate Configuration\n\n${body}`; @@ -32,7 +33,7 @@ export async function raiseConfigWarningIssue( try { await platform.updatePr({ number: pr.number, - prTitle: config.onboardingPrTitle, + prTitle: config.onboardingPrTitle!, prBody: body, }); } catch (err) /* istanbul ignore next */ { diff --git a/lib/workers/repository/errors-warnings.ts b/lib/workers/repository/errors-warnings.ts index 056a50b624c816..4c3d0d3ab18b7f 100644 --- a/lib/workers/repository/errors-warnings.ts +++ b/lib/workers/repository/errors-warnings.ts @@ -1,15 +1,17 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import type { RenovateConfig } from '../../config/types'; import { logger } from '../../logger'; import type { PackageFile } from '../../modules/manager/types'; import { emojify } from '../../util/emoji'; export function getWarnings(config: RenovateConfig): string { - if (!config.warnings.length) { + const warnings = config.warnings!; + if (!warnings.length) { return ''; } - let warningText = `\n# Warnings (${config.warnings.length})\n\n`; + let warningText = `\n# Warnings (${warnings.length})\n\n`; warningText += `Please correct - or verify that you can safely ignore - these warnings before you merge this PR.\n\n`; - config.warnings.forEach((w) => { + warnings.forEach((w) => { warningText += `- \`${w.topic}\`: ${w.message}\n`; }); warningText += '\n---\n'; @@ -18,12 +20,13 @@ export function getWarnings(config: RenovateConfig): string { export function getErrors(config: RenovateConfig): string { let errorText = ''; - if (!config.errors.length) { + const errors = config.errors!; + if (!errors.length) { return ''; } - errorText = `\n# Errors (${config.errors.length})\n\n`; + errorText = `\n# Errors (${errors.length})\n\n`; errorText += `Renovate has found errors that you should fix (in this branch) before finishing this PR.\n\n`; - config.errors.forEach((e) => { + errors.forEach((e) => { errorText += `- \`${e.topic}\`: ${e.message}\n`; }); errorText += '\n---\n'; @@ -46,8 +49,8 @@ export function getDepWarnings( if (!warnings.includes(message)) { warnings.push(message); } - if (!warningFiles.includes(file.packageFile)) { - warningFiles.push(file.packageFile); + if (!warningFiles.includes(file.packageFile!)) { + warningFiles.push(file.packageFile!); } } } diff --git a/lib/workers/repository/finalise/index.ts b/lib/workers/repository/finalise/index.ts index bcc6f79e0fc7f0..5a588bda292e52 100644 --- a/lib/workers/repository/finalise/index.ts +++ b/lib/workers/repository/finalise/index.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import type { RenovateConfig } from '../../../config/types'; import { logger } from '../../../logger'; import { platform } from '../../../modules/platform'; @@ -19,11 +20,11 @@ export async function finaliseRepo( const migratedConfigData = await MigratedDataFactory.getAsync(); const migrationBranch = await checkConfigMigrationBranch( config, - migratedConfigData + migratedConfigData! ); // null if migration not needed if (migrationBranch) { branchList.push(migrationBranch); - await ensureConfigMigrationPr(config, migratedConfigData); + await ensureConfigMigrationPr(config, migratedConfigData!); } MigratedDataFactory.reset(); } diff --git a/lib/workers/repository/finalise/prune.ts b/lib/workers/repository/finalise/prune.ts index dde02f6f5ca234..edf6b39725c5b6 100644 --- a/lib/workers/repository/finalise/prune.ts +++ b/lib/workers/repository/finalise/prune.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { GlobalConfig } from '../../../config/global'; import type { RenovateConfig } from '../../../config/types'; import { REPOSITORY_CHANGED } from '../../../constants/error-messages'; @@ -100,7 +101,7 @@ export async function pruneStaleBranches( return; } let renovateBranches = getBranchList().filter((branchName) => - branchName.startsWith(config.branchPrefix) + branchName.startsWith(config.branchPrefix!) ); if (!renovateBranches?.length) { logger.debug('No renovate branches found'); diff --git a/lib/workers/repository/index.ts b/lib/workers/repository/index.ts index 2e5c9095df5ea8..6605c5233e5a7f 100644 --- a/lib/workers/repository/index.ts +++ b/lib/workers/repository/index.ts @@ -22,7 +22,7 @@ import { printRequestStats } from './stats'; export async function renovateRepository( repoConfig: RenovateConfig, canRetry = true -): Promise { +): Promise { splitInit(); let config = GlobalConfig.set( applySecretsToConfig(repoConfig, undefined, false) @@ -31,9 +31,9 @@ export async function renovateRepository( setMeta({ repository: config.repository }); logger.info({ renovateVersion: pkg.version }, 'Repository started'); logger.trace({ config }); - let repoResult: ProcessResult; + let repoResult: ProcessResult | undefined; queue.clear(); - const { localDir } = GlobalConfig.get(); + const localDir = GlobalConfig.get('localDir')!; try { await fs.ensureDir(localDir); logger.debug('Using localDir: ' + localDir); @@ -62,7 +62,8 @@ export async function renovateRepository( await ensureDependencyDashboard(config, branches); } await finaliseRepo(config, branchList); - repoResult = processResult(config, res); + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + repoResult = processResult(config, res!); } } catch (err) /* istanbul ignore next */ { setMeta({ repository: config.repository }); diff --git a/lib/workers/repository/init/apis.ts b/lib/workers/repository/init/apis.ts index 35743546c03ab0..fe21c16925b69b 100644 --- a/lib/workers/repository/init/apis.ts +++ b/lib/workers/repository/init/apis.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { configFileNames } from '../../../config/app-strings'; import type { RenovateConfig } from '../../../config/types'; import { @@ -12,8 +13,8 @@ export type WorkerPlatformConfig = RepoResult & Record; const defaultConfigFile = (config: RenovateConfig): string => - configFileNames.includes(config.onboardingConfigFileName) - ? config.onboardingConfigFileName + configFileNames.includes(config.onboardingConfigFileName!) + ? config.onboardingConfigFileName! : configFileNames[0]; async function getJsonFile(file: string): Promise { diff --git a/lib/workers/repository/init/vulnerability.ts b/lib/workers/repository/init/vulnerability.ts index 5c7fd8d29671c9..ad02bf6c38605d 100644 --- a/lib/workers/repository/init/vulnerability.ts +++ b/lib/workers/repository/init/vulnerability.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import type { PackageRule, RenovateConfig } from '../../../config/types'; import { NO_VULNERABILITY_ALERTS } from '../../../constants/error-messages'; import { logger } from '../../../logger'; @@ -107,7 +108,7 @@ export async function detectVulnerabilityAlerts( const firstPatchedVersion = alert.securityVulnerability.firstPatchedVersion.identifier; const advisory = alert.securityAdvisory; - let { vulnerableRequirements } = alert; + let vulnerableRequirements = alert.vulnerableRequirements!; // istanbul ignore if if (!vulnerableRequirements.length) { if (datasource === MavenDatasource.id) { @@ -163,17 +164,17 @@ export async function detectVulnerabilityAlerts( try { prBodyNotes = ['### GitHub Vulnerability Alerts'].concat( val.advisories.map((advisory) => { + const identifiers = advisory.identifiers!; + const description = advisory.description!; let content = '#### '; let heading: string; - if (advisory.identifiers.some((id) => id.type === 'CVE')) { - heading = advisory.identifiers + if (identifiers.some((id) => id.type === 'CVE')) { + heading = identifiers .filter((id) => id.type === 'CVE') .map((id) => id.value) .join(' / '); } else { - heading = advisory.identifiers - .map((id) => id.value) - .join(' / '); + heading = identifiers.map((id) => id.value).join(' / '); } if (advisory.references.length) { heading = `[${heading}](${advisory.references[0].url})`; @@ -181,7 +182,7 @@ export async function detectVulnerabilityAlerts( content += heading; content += '\n\n'; - content += sanitizeMarkdown(advisory.description); + content += sanitizeMarkdown(description); return content; }) ); @@ -201,9 +202,13 @@ export async function detectVulnerabilityAlerts( const supportedRemediationFileTypes = ['package-lock.json']; if ( config.transitiveRemediation && - supportedRemediationFileTypes.includes(val.fileType) + supportedRemediationFileTypes.includes(val.fileType!) ) { - config.remediations[fileName] ||= []; + const remediations = config.remediations as Record< + string, + unknown[] + >; + remediations[fileName] ??= []; const currentVersion = matchCurrentVersion.replace('=', '').trim(); const newVersion = allowedVersions; const remediation = { @@ -213,7 +218,7 @@ export async function detectVulnerabilityAlerts( newVersion, prBodyNotes, }; - config.remediations[fileName].push(remediation); + remediations[fileName].push(remediation); } else { // Remediate only direct dependencies matchRule = { @@ -230,7 +235,7 @@ export async function detectVulnerabilityAlerts( config.transitiveRemediation && matchRule.matchFiles?.[0] === 'package.json' ) { - matchRule.force.rangeStrategy = 'replace'; + matchRule.force!.rangeStrategy = 'replace'; } } alertPackageRules.push(matchRule); @@ -239,6 +244,6 @@ export async function detectVulnerabilityAlerts( } } logger.debug({ alertPackageRules }, 'alert package rules'); - config.packageRules = (config.packageRules || []).concat(alertPackageRules); + config.packageRules = (config.packageRules ?? []).concat(alertPackageRules); return config; } diff --git a/lib/workers/repository/onboarding/branch/check.ts b/lib/workers/repository/onboarding/branch/check.ts index 911092d953f6a5..e61a234ccd181f 100644 --- a/lib/workers/repository/onboarding/branch/check.ts +++ b/lib/workers/repository/onboarding/branch/check.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { configFileNames } from '../../../../config/app-strings'; import type { RenovateConfig } from '../../../../config/types'; import { @@ -45,7 +46,7 @@ export type Pr = any; const closedPrExists = (config: RenovateConfig): Promise => platform.findPr({ - branchName: config.onboardingBranch, + branchName: config.onboardingBranch!, prTitle: config.onboardingPrTitle, state: PrState.NotOpen, }); @@ -117,7 +118,7 @@ export const isOnboarded = async (config: RenovateConfig): Promise => { return true; } logger.debug('Repo is not onboarded and no merged PRs exist'); - if (!config.suppressNotifications.includes('onboardingClose')) { + if (!config.suppressNotifications!.includes('onboardingClose')) { // ensure PR comment await ensureComment({ number: pr.number, @@ -130,4 +131,4 @@ export const isOnboarded = async (config: RenovateConfig): Promise => { export const onboardingPrExists = async ( config: RenovateConfig -): Promise => !!(await platform.getBranchPr(config.onboardingBranch)); +): Promise => !!(await platform.getBranchPr(config.onboardingBranch!)); diff --git a/lib/workers/repository/onboarding/branch/config.ts b/lib/workers/repository/onboarding/branch/config.ts index bdce49e22b5588..6236169342a159 100644 --- a/lib/workers/repository/onboarding/branch/config.ts +++ b/lib/workers/repository/onboarding/branch/config.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { GlobalConfig } from '../../../../config/global'; import { getPreset } from '../../../../config/presets/local'; import { PRESET_DEP_NOT_FOUND } from '../../../../config/presets/util'; @@ -14,13 +15,13 @@ async function getOnboardingConfig( ): Promise { let onboardingConfig = clone(config.onboardingConfig); - let orgPreset: string; + let orgPreset: string | undefined; logger.debug( 'Checking if this org/owner has a default Renovate preset which can be used.' ); - const orgName = config.repository.split('/')[0]; + const orgName = config.repository!.split('/')[0]; // Check for org/renovate-config try { diff --git a/lib/workers/repository/onboarding/branch/create.ts b/lib/workers/repository/onboarding/branch/create.ts index 1547ffcd0d308a..98870a40b6a2ee 100644 --- a/lib/workers/repository/onboarding/branch/create.ts +++ b/lib/workers/repository/onboarding/branch/create.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { configFileNames } from '../../../../config/app-strings'; import { GlobalConfig } from '../../../../config/global'; import type { RenovateConfig } from '../../../../config/types'; @@ -11,17 +12,17 @@ const defaultConfigFile = configFileNames[0]; export async function createOnboardingBranch( config: Partial ): Promise { - const configFile = configFileNames.includes(config.onboardingConfigFileName) + const configFile = configFileNames.includes(config.onboardingConfigFileName!) ? config.onboardingConfigFileName : defaultConfigFile; logger.debug('createOnboardingBranch()'); - const contents = await getOnboardingConfigContents(config, configFile); + const contents = await getOnboardingConfigContents(config, configFile!); logger.debug('Creating onboarding branch'); const commitMessageFactory = new OnboardingCommitMessageFactory( config, - configFile + configFile! ); const commitMessage = commitMessageFactory.create(); @@ -32,11 +33,11 @@ export async function createOnboardingBranch( } return commitAndPush({ - branchName: config.onboardingBranch, + branchName: config.onboardingBranch!, files: [ { type: 'addition', - path: configFile, + path: configFile!, contents, }, ], diff --git a/lib/workers/repository/onboarding/branch/index.ts b/lib/workers/repository/onboarding/branch/index.ts index 09bff1bcb72781..030998f9d1fb6f 100644 --- a/lib/workers/repository/onboarding/branch/index.ts +++ b/lib/workers/repository/onboarding/branch/index.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { mergeChildConfig } from '../../../../config'; import { GlobalConfig } from '../../../../config/global'; import type { RenovateConfig } from '../../../../config/types'; @@ -43,8 +44,8 @@ export async function checkOnboardingBranch( } // istanbul ignore if if (platform.refreshPr) { - const onboardingPr = await platform.getBranchPr(config.onboardingBranch); - await platform.refreshPr(onboardingPr.number); + const onboardingPr = await platform.getBranchPr(config.onboardingBranch!); + await platform.refreshPr(onboardingPr!.number); } } else { logger.debug('Onboarding PR does not exist'); @@ -71,8 +72,8 @@ export async function checkOnboardingBranch( } } if (!GlobalConfig.get('dryRun')) { - await checkoutBranch(onboardingBranch); + await checkoutBranch(onboardingBranch!); } - const branchList = [onboardingBranch]; + const branchList = [onboardingBranch!]; return { ...config, repoIsOnboarded, onboardingBranch, branchList }; } diff --git a/lib/workers/repository/onboarding/branch/rebase.ts b/lib/workers/repository/onboarding/branch/rebase.ts index 82a872ee5feb60..1aadf206ef3132 100644 --- a/lib/workers/repository/onboarding/branch/rebase.ts +++ b/lib/workers/repository/onboarding/branch/rebase.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { configFileNames } from '../../../../config/app-strings'; import { GlobalConfig } from '../../../../config/global'; import type { RenovateConfig } from '../../../../config/types'; @@ -8,15 +9,15 @@ import { OnboardingCommitMessageFactory } from './commit-message'; import { getOnboardingConfigContents } from './config'; const defaultConfigFile = (config: RenovateConfig): string => - configFileNames.includes(config.onboardingConfigFileName) - ? config.onboardingConfigFileName + configFileNames.includes(config.onboardingConfigFileName!) + ? config.onboardingConfigFileName! : configFileNames[0]; export async function rebaseOnboardingBranch( config: RenovateConfig ): Promise { logger.debug('Checking if onboarding branch needs rebasing'); - if (await isBranchModified(config.onboardingBranch)) { + if (await isBranchModified(config.onboardingBranch!)) { logger.debug('Onboarding branch has been edited and cannot be rebased'); return null; } @@ -25,7 +26,7 @@ export async function rebaseOnboardingBranch( const contents = await getOnboardingConfigContents(config, configFile); if ( contents === existingContents && - !(await isBranchStale(config.onboardingBranch)) + !(await isBranchStale(config.onboardingBranch!)) ) { logger.debug('Onboarding branch is up to date'); return null; @@ -45,7 +46,7 @@ export async function rebaseOnboardingBranch( } return commitAndPush({ - branchName: config.onboardingBranch, + branchName: config.onboardingBranch!, files: [ { type: 'addition', diff --git a/lib/workers/repository/onboarding/pr/config-description.ts b/lib/workers/repository/onboarding/pr/config-description.ts index 53c6055f613523..c09ae1096ff59b 100644 --- a/lib/workers/repository/onboarding/pr/config-description.ts +++ b/lib/workers/repository/onboarding/pr/config-description.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import is from '@sindresorhus/is'; import { configFileNames } from '../../../../config/app-strings'; import type { RenovateConfig } from '../../../../config/types'; @@ -33,7 +34,7 @@ export function getConfigDesc( config: RenovateConfig, packageFiles?: Record ): string { - const configFile = configFileNames.includes(config.onboardingConfigFileName) + const configFile = configFileNames.includes(config.onboardingConfigFileName!) ? config.onboardingConfigFileName : defaultConfigFile; logger.debug('getConfigDesc()'); diff --git a/lib/workers/repository/onboarding/pr/index.ts b/lib/workers/repository/onboarding/pr/index.ts index dc3c6a5302c66f..409c2c0886defe 100644 --- a/lib/workers/repository/onboarding/pr/index.ts +++ b/lib/workers/repository/onboarding/pr/index.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import is from '@sindresorhus/is'; import { GlobalConfig } from '../../../../config/global'; import type { RenovateConfig } from '../../../../config/types'; @@ -31,9 +32,11 @@ export async function ensureOnboardingPr( } logger.debug('ensureOnboardingPr()'); logger.trace({ config }); - const existingPr = await platform.getBranchPr(config.onboardingBranch); + const existingPr = await platform.getBranchPr(config.onboardingBranch!); logger.debug('Filling in onboarding PR template'); - let prTemplate = `Welcome to [Renovate](${config.productLinks.homepage})! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.\n\n`; + let prTemplate = `Welcome to [Renovate](${ + config.productLinks!.homepage + })! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.\n\n`; prTemplate += config.requireConfig === 'required' ? emojify( @@ -55,8 +58,12 @@ export async function ensureOnboardingPr( --- -:question: Got questions? Check out Renovate's [Docs](${config.productLinks.documentation}), particularly the Getting Started section. -If you need any further assistance then you can also [request help here](${config.productLinks.help}). +:question: Got questions? Check out Renovate's [Docs](${ + config.productLinks!.documentation + }), particularly the Getting Started section. +If you need any further assistance then you can also [request help here](${ + config.productLinks!.help + }). ` ); let prBody = prTemplate; @@ -78,13 +85,15 @@ If you need any further assistance then you can also [request help here](${confi let configDesc = ''; if (GlobalConfig.get('dryRun')) { logger.info(`DRY-RUN: Would check branch ${config.onboardingBranch}`); - } else if (await isBranchModified(config.onboardingBranch)) { + } else if (await isBranchModified(config.onboardingBranch!)) { configDesc = emojify( - `### Configuration\n\n:abcd: Renovate has detected a custom config for this PR. Feel free to ask for [help](${config.productLinks.help}) if you have any doubts and would like it reviewed.\n\n` + `### Configuration\n\n:abcd: Renovate has detected a custom config for this PR. Feel free to ask for [help](${ + config.productLinks!.help + }) if you have any doubts and would like it reviewed.\n\n` ); const isConflicted = await isBranchConflicted( - config.baseBranch, - config.onboardingBranch + config.baseBranch!, + config.onboardingBranch! ); if (isConflicted) { configDesc += emojify( @@ -94,12 +103,12 @@ If you need any further assistance then you can also [request help here](${confi configDesc += `Important: Now that this branch is edited, Renovate can't rebase it from the base branch any more. If you make changes to the base branch that could impact this onboarding PR, please merge them manually.\n\n`; } } else { - configDesc = getConfigDesc(config, packageFiles); + configDesc = getConfigDesc(config, packageFiles!); } prBody = prBody.replace('{{CONFIG}}\n', configDesc); prBody = prBody.replace( '{{WARNINGS}}\n', - getWarnings(config) + getDepWarnings(packageFiles) + getWarnings(config) + getDepWarnings(packageFiles!) ); prBody = prBody.replace('{{ERRORS}}\n', getErrors(config)); prBody = prBody.replace('{{BASEBRANCH}}\n', getBaseBranchDesc(config)); @@ -142,15 +151,15 @@ If you need any further assistance then you can also [request help here](${confi logger.info('DRY-RUN: Would create onboarding PR'); } else { const pr = await platform.createPr({ - sourceBranch: config.onboardingBranch, - targetBranch: config.defaultBranch, - prTitle: config.onboardingPrTitle, + sourceBranch: config.onboardingBranch!, + targetBranch: config.defaultBranch!, + prTitle: config.onboardingPrTitle!, prBody, labels, platformOptions: getPlatformPrOptions({ ...config, automerge: false }), }); - logger.info({ pr: pr.displayNumber }, 'Onboarding PR created'); - await addParticipants(config, pr); + logger.info({ pr: pr!.displayNumber }, 'Onboarding PR created'); + await addParticipants(config, pr!); } } catch (err) { if ( @@ -162,7 +171,7 @@ If you need any further assistance then you can also [request help here](${confi logger.warn( 'Onboarding PR already exists but cannot find it. It was probably created by a different user.' ); - await deleteBranch(config.onboardingBranch); + await deleteBranch(config.onboardingBranch!); return; } throw err; diff --git a/lib/workers/repository/onboarding/pr/pr-list.ts b/lib/workers/repository/onboarding/pr/pr-list.ts index 519b4f7ec5c6a0..6c4af79aa5dca8 100644 --- a/lib/workers/repository/onboarding/pr/pr-list.ts +++ b/lib/workers/repository/onboarding/pr/pr-list.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import type { RenovateConfig } from '../../../../config/types'; import { logger } from '../../../../logger'; import { emojify } from '../../../../util/emoji'; @@ -19,7 +20,7 @@ export function getPrList( for (const branch of branches) { const prTitleRe = regEx(/@([a-z]+\/[a-z]+)/); - prDesc += `
\n${branch.prTitle.replace( + prDesc += `
\n${branch.prTitle!.replace( prTitleRe, '@​$1' )}\n\n`; @@ -44,11 +45,11 @@ export function getPrList( if (upgrade.sourceUrl) { text += `[${upgrade.depName}](${upgrade.sourceUrl})`; } else { - text += upgrade.depName.replace(prTitleRe, '@​$1'); + text += upgrade.depName!.replace(prTitleRe, '@​$1'); } text += upgrade.isLockfileUpdate ? ` to \`${upgrade.newVersion}\`` - : ` to \`${upgrade.newDigest || upgrade.newValue}\``; + : ` to \`${upgrade.newDigest ?? upgrade.newValue}\``; text += '\n'; } if (!seen.includes(text)) { @@ -59,13 +60,14 @@ export function getPrList( prDesc += '\n\n'; prDesc += '
\n\n'; } + const prHourlyLimit = config.prHourlyLimit!; if ( - config.prHourlyLimit > 0 && - config.prHourlyLimit < 5 && - config.prHourlyLimit < branches.length + prHourlyLimit > 0 && + prHourlyLimit < 5 && + prHourlyLimit < branches.length ) { prDesc += emojify( - `
\n\n:children_crossing: Branch creation will be limited to maximum ${config.prHourlyLimit} per hour, so it doesn't swamp any CI resources or spam the project. See docs for \`prhourlylimit\` for details.\n\n` + `
\n\n:children_crossing: Branch creation will be limited to maximum ${prHourlyLimit} per hour, so it doesn't swamp any CI resources or spam the project. See docs for \`prhourlylimit\` for details.\n\n` ); } return prDesc; diff --git a/lib/workers/repository/process/deprecated.ts b/lib/workers/repository/process/deprecated.ts index d1b6066db5ab0e..46469213bd36df 100644 --- a/lib/workers/repository/process/deprecated.ts +++ b/lib/workers/repository/process/deprecated.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { GlobalConfig } from '../../../config/global'; import type { RenovateConfig } from '../../../config/types'; import { logger } from '../../../logger'; @@ -23,12 +24,14 @@ export async function raiseDeprecationWarnings( for (const dep of packageFile.deps) { const { deprecationMessage } = dep; if (deprecationMessage) { - deprecatedPackages[dep.depName] = deprecatedPackages[dep.depName] || { + deprecatedPackages[dep.depName!] = deprecatedPackages[ + dep.depName! + ] || { deprecationMessage, depPackageFiles: [], }; - deprecatedPackages[dep.depName].depPackageFiles.push( - packageFile.packageFile + deprecatedPackages[dep.depName!].depPackageFiles.push( + packageFile.packageFile! ); } } @@ -61,7 +64,7 @@ export async function raiseDeprecationWarnings( const ensureOnce = true; await platform.ensureIssue({ title: issueTitle, - body: issueBody, + body: issueBody!, once: ensureOnce, confidential: config.confidential, }); @@ -73,11 +76,11 @@ export async function raiseDeprecationWarnings( const issueList = await platform.getIssueList(); if (issueList?.length) { const deprecatedIssues = issueList.filter( - (i) => i.title.startsWith(issueTitlePrefix) && i.state === 'open' + (i) => i.title!.startsWith(issueTitlePrefix) && i.state === 'open' ); for (const i of deprecatedIssues) { - if (!issueTitleList.includes(i.title)) { - await platform.ensureIssueClosing(i.title); + if (!issueTitleList.includes(i.title!)) { + await platform.ensureIssueClosing(i.title!); } } } diff --git a/lib/workers/repository/process/extract-update.ts b/lib/workers/repository/process/extract-update.ts index fb12b3d1c3c403..eab3f61620d1e3 100644 --- a/lib/workers/repository/process/extract-update.ts +++ b/lib/workers/repository/process/extract-update.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import is from '@sindresorhus/is'; import hasha from 'hasha'; import type { RenovateConfig } from '../../../config/types'; @@ -19,12 +20,24 @@ export type ExtractResult = { packageFiles: Record; }; +export interface StatsResult { + fileCount: number; + depCount: number; +} + +export interface Stats { + managers: Record; + total: StatsResult; +} + // istanbul ignore next -function extractStats(packageFiles: Record): any { +function extractStats( + packageFiles: Record +): Stats | null { if (!packageFiles) { - return {}; + return null; } - const stats = { + const stats: Stats = { managers: {}, total: { fileCount: 0, @@ -52,11 +65,11 @@ export async function extract( ): Promise> { logger.debug('extract()'); const { baseBranch } = config; - const baseBranchSha = getBranchCommit(baseBranch); + const baseBranchSha = getBranchCommit(baseBranch!); let packageFiles: Record; const cache = getCache(); cache.scan ||= {}; - const cachedExtract = cache.scan[baseBranch]; + const cachedExtract = cache.scan[baseBranch!]; const configHash = hasha(JSON.stringify(config)); // istanbul ignore if if ( @@ -78,10 +91,10 @@ export async function extract( logger.info({ err }, 'Error deleting cached dep updates'); } } else { - await checkoutBranch(baseBranch); + await checkoutBranch(baseBranch!); packageFiles = await extractAllDependencies(config); - cache.scan[baseBranch] = { - sha: baseBranchSha, + cache.scan[baseBranch!] = { + sha: baseBranchSha!, configHash, packageFiles, }; @@ -91,7 +104,7 @@ export async function extract( : [baseBranch]; Object.keys(cache.scan).forEach((branchName) => { if (!baseBranches.includes(branchName)) { - delete cache.scan[branchName]; + delete cache.scan![branchName]; } }); } diff --git a/lib/workers/repository/process/fetch.ts b/lib/workers/repository/process/fetch.ts index 2c5fc00604432a..e022f19da324ad 100644 --- a/lib/workers/repository/process/fetch.ts +++ b/lib/workers/repository/process/fetch.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import is from '@sindresorhus/is'; import pAll from 'p-all'; import { getManagerConfig, mergeChildConfig } from '../../../config'; @@ -35,10 +36,10 @@ async function fetchDepUpdates( const { depName } = dep; // TODO: fix types let depConfig = mergeChildConfig(packageFileConfig, dep); - const datasourceDefaultConfig = await getDefaultConfig(depConfig.datasource); + const datasourceDefaultConfig = await getDefaultConfig(depConfig.datasource!); depConfig = mergeChildConfig(depConfig, datasourceDefaultConfig); depConfig = applyPackageRules(depConfig); - if (depConfig.ignoreDeps.includes(depName)) { + if (depConfig.ignoreDeps!.includes(depName!)) { logger.debug({ dependency: depName }, 'Dependency is ignored'); dep.skipReason = 'ignored'; } else if (depConfig.enabled === false) { @@ -104,7 +105,7 @@ export async function fetchUpdates( fetchManagerUpdates(config, packageFiles, manager) ); await Promise.all(allManagerJobs); - PackageFiles.add(config.baseBranch, { ...packageFiles }); + PackageFiles.add(config.baseBranch!, { ...packageFiles }); logger.debug( { baseBranch: config.baseBranch }, 'Package releases lookups complete' diff --git a/lib/workers/repository/process/index.ts b/lib/workers/repository/process/index.ts index 1c93822bad364a..4eb1b36921adbd 100644 --- a/lib/workers/repository/process/index.ts +++ b/lib/workers/repository/process/index.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { mergeChildConfig } from '../../../config'; import { GlobalConfig } from '../../../config/global'; import type { RenovateConfig } from '../../../config/types'; @@ -37,7 +38,7 @@ async function getBaseBranchConfig( try { baseBranchConfig = await platform.getJsonFile( - configFileName, + configFileName!, config.repository, baseBranch ); @@ -59,7 +60,7 @@ async function getBaseBranchConfig( baseBranchConfig.baseBranches = config.baseBranches; } - if (config.baseBranches.length > 1) { + if (config.baseBranches!.length > 1) { baseBranchConfig.branchPrefix += `${baseBranch}-`; baseBranchConfig.hasBaseBranches = true; } @@ -76,7 +77,7 @@ export async function extractDependencies( let res: ExtractResult = { branches: [], branchList: [], - packageFiles: null, + packageFiles: null!, }; if (config.baseBranches?.length) { logger.debug({ baseBranches: config.baseBranches }, 'baseBranches'); diff --git a/lib/workers/repository/process/limits.ts b/lib/workers/repository/process/limits.ts index 5619fa5bc7df3f..3557c05cf49485 100644 --- a/lib/workers/repository/process/limits.ts +++ b/lib/workers/repository/process/limits.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { DateTime } from 'luxon'; import type { RenovateConfig } from '../../../config/types'; import { logger } from '../../../logger'; @@ -19,8 +20,8 @@ export async function getPrHourlyRemaining( const soFarThisHour = prList.filter( (pr) => pr.sourceBranch !== config.onboardingBranch && - pr.sourceBranch.startsWith(config.branchPrefix) && - DateTime.fromISO(pr.createdAt) > currentHourStart + pr.sourceBranch.startsWith(config.branchPrefix!) && + DateTime.fromISO(pr.createdAt!) > currentHourStart ); const prsRemaining = Math.max( 0, diff --git a/lib/workers/repository/process/sort.ts b/lib/workers/repository/process/sort.ts index 396a1aa97cda73..ceaabb51646cbb 100644 --- a/lib/workers/repository/process/sort.ts +++ b/lib/workers/repository/process/sort.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { logger } from '../../../logger'; import type { BranchConfig } from '../../types'; @@ -17,14 +18,14 @@ export function sortBranches(branches: Partial[]): void { return -1; } if (a.prPriority !== b.prPriority) { - return b.prPriority - a.prPriority; + return b.prPriority! - a.prPriority!; } const sortDiff = - sortOrder.indexOf(a.updateType) - sortOrder.indexOf(b.updateType); + sortOrder.indexOf(a.updateType!) - sortOrder.indexOf(b.updateType!); if (sortDiff !== 0) { return sortDiff; } // Sort by prTitle if updateType is the same - return a.prTitle < b.prTitle ? -1 : 1; + return a.prTitle! < b.prTitle! ? -1 : 1; }); } diff --git a/lib/workers/repository/process/vulnerabilities.ts b/lib/workers/repository/process/vulnerabilities.ts index f61447cfcc2146..f540b44cc64abf 100644 --- a/lib/workers/repository/process/vulnerabilities.ts +++ b/lib/workers/repository/process/vulnerabilities.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { Ecosystem, Osv, OsvOffline } from '@jamiemagee/osv-offline'; import pAll from 'p-all'; import { getManagerConfig, mergeChildConfig } from '../../../config'; @@ -104,16 +105,16 @@ export class Vulnerabilities { packageDependency: PackageDependency ): Promise { const ecosystem = - Vulnerabilities.managerEcosystemMap[packageFileConfig.manager]; + Vulnerabilities.managerEcosystemMap[packageFileConfig.manager!]; const vulnerabilities = await this.osvOffline?.getVulnerabilities( - ecosystem, - packageDependency.depName + ecosystem!, + packageDependency.depName! ); return this.convertToPackageRule( vulnerabilities ?? [], - packageDependency.depName, - ecosystem + packageDependency.depName!, + ecosystem! ); } @@ -134,7 +135,7 @@ export class Vulnerabilities { matchPackageNames: [dependencyName], allowedVersions: affected?.ranges?.[0].events.find( (event) => event.fixed !== undefined - ).fixed, + )!.fixed, isVulnerabilityAlert: true, }) ); diff --git a/lib/workers/repository/update/branch/auto-replace.ts b/lib/workers/repository/update/branch/auto-replace.ts index 60c30a4bf0379f..2395f4dc331144 100644 --- a/lib/workers/repository/update/branch/auto-replace.ts +++ b/lib/workers/repository/update/branch/auto-replace.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { WORKER_FILE_UPDATE_FAILED } from '../../../../constants/error-messages'; import { logger } from '../../../../logger'; import { get } from '../../../../modules/manager'; @@ -24,7 +25,7 @@ export async function confirmIfDepUpdated( const extractPackageFile = get(manager, 'extractPackageFile'); let newUpgrade: PackageDependency; try { - const newExtract = await extractPackageFile( + const newExtract = await extractPackageFile!( newContent, packageFile, upgrade @@ -34,11 +35,11 @@ export async function confirmIfDepUpdated( logger.debug({ manager, packageFile }, 'Could not extract package file'); return false; } - newUpgrade = newExtract.deps[depIndex]; + newUpgrade = newExtract.deps[depIndex!]; } catch (err) /* istanbul ignore next */ { logger.debug({ manager, packageFile, err }, 'Failed to parse newContent'); } - if (!newUpgrade) { + if (!newUpgrade!) { logger.debug({ manager, packageFile }, 'No newUpgrade'); return false; } @@ -91,12 +92,9 @@ export async function checkBranchDepsMatchBaseDeps( const { baseDeps, manager, packageFile } = upgrade; const extractPackageFile = get(manager, 'extractPackageFile'); try { - const { deps: branchDeps } = await extractPackageFile( - branchContent, - packageFile, - upgrade - ); - return getDepsSignature(baseDeps) === getDepsSignature(branchDeps); + const res = await extractPackageFile!(branchContent, packageFile, upgrade)!; + const branchDeps = res!.deps; + return getDepsSignature(baseDeps!) === getDepsSignature(branchDeps); } catch (err) /* istanbul ignore next */ { logger.info( { manager, packageFile }, @@ -138,9 +136,9 @@ export async function doAutoReplace( logger.debug({ packageFile, depName }, 'Branch dep is already updated'); return existingContent; } - const replaceString = upgrade.replaceString || currentValue; + const replaceString = upgrade.replaceString ?? currentValue; logger.trace({ depName, replaceString }, 'autoReplace replaceString'); - let searchIndex = existingContent.indexOf(replaceString); + let searchIndex = existingContent.indexOf(replaceString!); if (searchIndex === -1) { logger.info( { packageFile, depName, existingContent, replaceString }, @@ -153,11 +151,11 @@ export async function doAutoReplace( if (autoReplaceStringTemplate) { newString = compile(autoReplaceStringTemplate, upgrade, false); } else { - newString = replaceString; + newString = replaceString!; if (currentValue) { newString = newString.replace( regEx(escapeRegExp(currentValue), 'g'), - newValue + newValue! ); } if (currentDigest && newDigest) { @@ -174,7 +172,7 @@ export async function doAutoReplace( // Iterate through the rest of the file for (; searchIndex < existingContent.length; searchIndex += 1) { // First check if we have a hit for the old version - if (matchAt(existingContent, searchIndex, replaceString)) { + if (matchAt(existingContent, searchIndex, replaceString!)) { logger.debug( { packageFile, depName }, `Found match at index ${searchIndex}` @@ -183,16 +181,16 @@ export async function doAutoReplace( const testContent = replaceAt( existingContent, searchIndex, - replaceString, + replaceString!, newString ); - await writeLocalFile(upgrade.packageFile, testContent); + await writeLocalFile(upgrade.packageFile!, testContent); if (await confirmIfDepUpdated(upgrade, testContent)) { return testContent; } // istanbul ignore next - await writeLocalFile(upgrade.packageFile, existingContent); + await writeLocalFile(upgrade.packageFile!, existingContent); } } } catch (err) /* istanbul ignore next */ { diff --git a/lib/workers/repository/update/branch/automerge.ts b/lib/workers/repository/update/branch/automerge.ts index 58770efd63be2a..e634f8d7f5f75e 100644 --- a/lib/workers/repository/update/branch/automerge.ts +++ b/lib/workers/repository/update/branch/automerge.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { GlobalConfig } from '../../../../config/global'; import type { RenovateConfig } from '../../../../config/types'; import { logger } from '../../../../logger'; @@ -27,12 +28,12 @@ export async function tryBranchAutomerge( if (!isScheduledNow(config, 'automergeSchedule')) { return 'off schedule'; } - const existingPr = await platform.getBranchPr(config.branchName); + const existingPr = await platform.getBranchPr(config.branchName!); if (existingPr) { return 'automerge aborted - PR exists'; } const branchStatus = await resolveBranchStatus( - config.branchName, + config.branchName!, config.ignoreTests ); if (branchStatus === BranchStatus.green) { @@ -41,7 +42,7 @@ export async function tryBranchAutomerge( if (GlobalConfig.get('dryRun')) { logger.info(`DRY-RUN: Would automerge branch ${config.branchName}`); } else { - await mergeBranch(config.branchName); + await mergeBranch(config.branchName!); } logger.info({ branch: config.branchName }, 'Branch automerged'); return 'automerged'; // Branch no longer exists diff --git a/lib/workers/repository/update/branch/check-existing.ts b/lib/workers/repository/update/branch/check-existing.ts index a16a56a778c4e4..fcd39fc1efa8f4 100644 --- a/lib/workers/repository/update/branch/check-existing.ts +++ b/lib/workers/repository/update/branch/check-existing.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { REPOSITORY_CHANGED } from '../../../../constants/error-messages'; import { logger } from '../../../../logger'; import { Pr, platform } from '../../../../modules/platform'; @@ -23,8 +24,8 @@ export async function prAlreadyExisted( if (!pr && config.branchPrefix !== config.branchPrefixOld) { pr = await platform.findPr({ branchName: config.branchName.replace( - config.branchPrefix, - config.branchPrefixOld + config.branchPrefix!, + config.branchPrefixOld! ), prTitle: config.prTitle, state: PrState.NotOpen, @@ -38,7 +39,7 @@ export async function prAlreadyExisted( logger.debug('Found closed PR with current title'); const prDetails = await platform.getPr(pr.number); // istanbul ignore if - if (prDetails.state === PrState.Open) { + if (prDetails!.state === PrState.Open) { logger.debug('PR reopened - aborting run'); throw new Error(REPOSITORY_CHANGED); } diff --git a/lib/workers/repository/update/branch/commit.ts b/lib/workers/repository/update/branch/commit.ts index 28f4347e8a6957..e15ced2c2e3334 100644 --- a/lib/workers/repository/update/branch/commit.ts +++ b/lib/workers/repository/update/branch/commit.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import is from '@sindresorhus/is'; import minimatch from 'minimatch'; import { GlobalConfig } from '../../../../config/global'; @@ -10,11 +11,13 @@ import type { BranchConfig } from '../../../types'; export function commitFilesToBranch( config: BranchConfig ): Promise { - let updatedFiles = config.updatedPackageFiles.concat(config.updatedArtifacts); + let updatedFiles = config.updatedPackageFiles!.concat( + config.updatedArtifacts! + ); // istanbul ignore if if (is.nonEmptyArray(config.excludeCommitPaths)) { updatedFiles = updatedFiles.filter(({ path: filePath }) => { - const matchesExcludePaths = config.excludeCommitPaths.some( + const matchesExcludePaths = config.excludeCommitPaths!.some( (excludedPath) => minimatch(filePath, excludedPath, { dot: true }) ); if (matchesExcludePaths) { @@ -26,14 +29,14 @@ export function commitFilesToBranch( } if (!is.nonEmptyArray(updatedFiles)) { logger.debug(`No files to commit`); - return null; + return Promise.resolve(null); } const fileLength = [...new Set(updatedFiles.map((file) => file.path))].length; logger.debug(`${fileLength} file(s) to commit`); // istanbul ignore if if (GlobalConfig.get('dryRun')) { logger.info('DRY-RUN: Would commit files to branch ' + config.branchName); - return null; + return Promise.resolve(null); } // istanbul ignore if if ( @@ -51,7 +54,7 @@ export function commitFilesToBranch( return commitAndPush({ branchName: config.branchName, files: updatedFiles, - message: config.commitMessage, + message: config.commitMessage!, force: !!config.forceCommit, platformCommit: !!config.platformCommit, }); diff --git a/lib/workers/repository/update/branch/execute-post-upgrade-commands.ts b/lib/workers/repository/update/branch/execute-post-upgrade-commands.ts index f79916b6a7b157..f1a30887792b20 100644 --- a/lib/workers/repository/update/branch/execute-post-upgrade-commands.ts +++ b/lib/workers/repository/update/branch/execute-post-upgrade-commands.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import is from '@sindresorhus/is'; import minimatch from 'minimatch'; import { GlobalConfig } from '../../../../config/global'; @@ -25,8 +26,8 @@ export async function postUpgradeCommandsExecutor( filteredUpgradeCommands: BranchUpgradeConfig[], config: BranchConfig ): Promise { - let updatedArtifacts = [...(config.updatedArtifacts || [])]; - const artifactErrors = [...(config.artifactErrors || [])]; + let updatedArtifacts = [...(config.updatedArtifacts ?? [])]; + const artifactErrors = [...(config.artifactErrors ?? [])]; const { allowedPostUpgradeCommands, allowPostUpgradeCommandTemplating } = GlobalConfig.get(); @@ -39,11 +40,11 @@ export async function postUpgradeCommandsExecutor( }, `Checking for post-upgrade tasks` ); - const commands = upgrade.postUpgradeTasks?.commands || []; - const fileFilters = upgrade.postUpgradeTasks?.fileFilters || []; + const commands = upgrade.postUpgradeTasks?.commands ?? []; + const fileFilters = upgrade.postUpgradeTasks?.fileFilters ?? []; if (is.nonEmptyArray(commands)) { // Persist updated files in file system so any executed commands can see them - for (const file of config.updatedPackageFiles.concat(updatedArtifacts)) { + for (const file of config.updatedPackageFiles!.concat(updatedArtifacts)) { const canWriteFile = await localPathIsFile(file.path); if (file.type === 'addition' && canWriteFile) { let contents; @@ -58,7 +59,9 @@ export async function postUpgradeCommandsExecutor( for (const cmd of commands) { if ( - allowedPostUpgradeCommands.some((pattern) => regEx(pattern).test(cmd)) + allowedPostUpgradeCommands!.some((pattern) => + regEx(pattern).test(cmd) + ) ) { try { const compiledCmd = allowPostUpgradeCommandTemplating @@ -156,8 +159,8 @@ export default async function executePostUpgradeCommands( const { allowedPostUpgradeCommands } = GlobalConfig.get(); const hasChangedFiles = - config.updatedPackageFiles?.length > 0 || - config.updatedArtifacts?.length > 0; + (config.updatedPackageFiles && config.updatedPackageFiles.length > 0) || + (config.updatedArtifacts && config.updatedArtifacts.length > 0); if ( /* Only run post-upgrade tasks if there are changes to package files... */ @@ -173,7 +176,7 @@ export default async function executePostUpgradeCommands( depName: config.upgrades.map(({ depName }) => depName).join(' '), branchName: config.branchName, postUpgradeTasks: - config.postUpgradeTasks.executionMode === 'branch' + config.postUpgradeTasks!.executionMode === 'branch' ? config.postUpgradeTasks : undefined, fileFilters: config.fileFilters, diff --git a/lib/workers/repository/update/branch/get-updated.ts b/lib/workers/repository/update/branch/get-updated.ts index 669b87dbfc443b..c287fe0c7a8b2d 100644 --- a/lib/workers/repository/update/branch/get-updated.ts +++ b/lib/workers/repository/update/branch/get-updated.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import is from '@sindresorhus/is'; import { WORKER_FILE_UPDATE_FAILED } from '../../../../constants/error-messages'; import { logger } from '../../../../logger'; @@ -22,7 +23,7 @@ export async function getUpdatedPackageFiles( config: BranchConfig ): Promise { logger.trace({ config }); - const { reuseExistingBranch } = config; + const reuseExistingBranch = config.reuseExistingBranch!; logger.debug( `manager.getUpdatedPackageFiles() reuseExistinbranch=${reuseExistingBranch}` ); @@ -32,21 +33,24 @@ export async function getUpdatedPackageFiles( const packageFileUpdatedDeps: Record = {}; const lockFileMaintenanceFiles = []; for (const upgrade of config.upgrades) { - const { manager, packageFile, depName, newVersion } = upgrade; - const updateLockedDependency = get(manager, 'updateLockedDependency'); + const manager = upgrade.manager!; + const packageFile = upgrade.packageFile!; + const depName = upgrade.depName!; + const newVersion = upgrade.newVersion!; + const updateLockedDependency = get(manager, 'updateLockedDependency')!; packageFileManagers[packageFile] = manager; packageFileUpdatedDeps[packageFile] = packageFileUpdatedDeps[packageFile] || []; packageFileUpdatedDeps[packageFile].push({ ...upgrade }); - let packageFileContent = updatedFileContents[packageFile]; + let packageFileContent: string | null = updatedFileContents[packageFile]; if (!packageFileContent) { packageFileContent = await getFile( packageFile, reuseExistingBranch ? config.branchName : config.baseBranch ); } - let lockFileContent: string; - const lockFile = upgrade.lockFile || upgrade.lockFiles?.[0] || ''; + let lockFileContent: string | null = null; + const lockFile = upgrade.lockFile ?? upgrade.lockFiles?.[0] ?? ''; if (lockFile) { lockFileContent = updatedFileContents[lockFile]; if (!lockFileContent) { @@ -78,9 +82,9 @@ export async function getUpdatedPackageFiles( depName, newVersion, packageFile, - packageFileContent, + packageFileContent: packageFileContent!, lockFile, - lockFileContent, + lockFileContent: lockFileContent!, allowParentUpdates: true, allowHigherOrRemoved: true, }); @@ -107,14 +111,14 @@ export async function getUpdatedPackageFiles( depName, newVersion, packageFile, - packageFileContent, + packageFileContent: packageFileContent!, lockFile, - lockFileContent, + lockFileContent: lockFileContent!, allowParentUpdates: false, }); if (status === 'unsupported') { // incompatible lock file - nonUpdatedFileContents[packageFile] = packageFileContent; + nonUpdatedFileContents[packageFile] = packageFileContent!; } else if (status === 'already-updated') { logger.debug( `Upgrade of ${depName} to ${newVersion} is already done in existing branch` @@ -140,7 +144,7 @@ export async function getUpdatedPackageFiles( { manager }, 'isLockFileUpdate without updateLockedDependency' ); - nonUpdatedFileContents[packageFile] = packageFileContent; + nonUpdatedFileContents[packageFile] = packageFileContent!; } } else { const bumpPackageVersion = get(manager, 'bumpPackageVersion'); @@ -148,14 +152,14 @@ export async function getUpdatedPackageFiles( if (!updateDependency) { let res = await doAutoReplace( upgrade, - packageFileContent, + packageFileContent!, reuseExistingBranch ); if (res) { if (bumpPackageVersion && upgrade.bumpVersion) { const { bumpedContent } = await bumpPackageVersion( res, - upgrade.packageFileVersion, + upgrade.packageFileVersion!, upgrade.bumpVersion ); res = bumpedContent; @@ -164,7 +168,7 @@ export async function getUpdatedPackageFiles( logger.debug({ packageFile, depName }, 'No content changed'); } else { logger.debug({ packageFile, depName }, 'Contents updated'); - updatedFileContents[packageFile] = res; + updatedFileContents[packageFile] = res!; } continue; } else if (reuseExistingBranch) { @@ -177,13 +181,13 @@ export async function getUpdatedPackageFiles( throw new Error(WORKER_FILE_UPDATE_FAILED); } let newContent = await updateDependency({ - fileContent: packageFileContent, + fileContent: packageFileContent!, upgrade, }); if (bumpPackageVersion && upgrade.bumpVersion) { const { bumpedContent } = await bumpPackageVersion( - newContent, - upgrade.packageFileVersion, + newContent!, + upgrade.packageFileVersion!, upgrade.bumpVersion ); newContent = bumpedContent; @@ -306,7 +310,7 @@ export async function getUpdatedPackageFiles( const results = await updateArtifacts({ packageFileName: packageFile, updatedDeps: [], - newPackageFileContent: packageFileContents, + newPackageFileContent: packageFileContents!, config, }); if (is.nonEmptyArray(results)) { diff --git a/lib/workers/repository/update/branch/handle-existing.ts b/lib/workers/repository/update/branch/handle-existing.ts index 5f93efef05c0ba..e832bc1ffdd695 100644 --- a/lib/workers/repository/update/branch/handle-existing.ts +++ b/lib/workers/repository/update/branch/handle-existing.ts @@ -10,16 +10,18 @@ import type { BranchConfig } from '../../../types'; export async function handlepr(config: BranchConfig, pr: Pr): Promise { if (pr.state === PrState.Closed) { let content; + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + const userStrings = config.userStrings!; if (config.updateType === 'major') { - content = template.compile(config.userStrings.ignoreMajor, config); + content = template.compile(userStrings.ignoreMajor, config); } else if (config.updateType === 'digest') { - content = template.compile(config.userStrings.ignoreDigest, config); + content = template.compile(userStrings.ignoreDigest, config); } else { - content = template.compile(config.userStrings.ignoreOther, config); + content = template.compile(userStrings.ignoreOther, config); } content += '\n\nIf this PR was closed by mistake or you changed your mind, you can simply rename this PR and you will soon get a fresh replacement PR opened.'; - if (!config.suppressNotifications.includes('prIgnoreNotification')) { + if (!config.suppressNotifications!.includes('prIgnoreNotification')) { if (GlobalConfig.get('dryRun')) { logger.info( `DRY-RUN: Would ensure closed PR comment in PR #${pr.number}` @@ -27,7 +29,7 @@ export async function handlepr(config: BranchConfig, pr: Pr): Promise { } else { await ensureComment({ number: pr.number, - topic: config.userStrings.ignoreTopic, + topic: userStrings.ignoreTopic, content, }); } diff --git a/lib/workers/repository/update/branch/index.ts b/lib/workers/repository/update/branch/index.ts index ffbeac01c0fbed..6df732162e5ee9 100644 --- a/lib/workers/repository/update/branch/index.ts +++ b/lib/workers/repository/update/branch/index.ts @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ +import is from '@sindresorhus/is'; import { DateTime } from 'luxon'; import { GlobalConfig } from '../../../../config/global'; import type { RenovateConfig } from '../../../../config/types'; @@ -56,7 +58,7 @@ import { setConfidence, setStability } from './status-checks'; function rebaseCheck(config: RenovateConfig, branchPr: Pr): boolean { const titleRebase = branchPr.title?.startsWith('rebase!'); - const labelRebase = branchPr.labels?.includes(config.rebaseLabel); + const labelRebase = !!branchPr.labels?.includes(config.rebaseLabel!); const prRebaseChecked = !!branchPr.bodyStruct?.rebaseRequested; return titleRebase || labelRebase || prRebaseChecked; @@ -82,13 +84,13 @@ export async function processBranch( ): Promise { let config: BranchConfig = { ...branchConfig }; logger.trace({ config }, 'processBranch()'); - await checkoutBranch(config.baseBranch); + await checkoutBranch(config.baseBranch!); let branchExists = gitBranchExists(config.branchName); if (!branchExists && config.branchPrefix !== config.branchPrefixOld) { const branchName = config.branchName.replace( - config.branchPrefix, - config.branchPrefixOld + config.branchPrefix!, + config.branchPrefixOld! ); branchExists = gitBranchExists(branchName); if (branchExists) { @@ -101,7 +103,7 @@ export async function processBranch( logger.debug(`branchExists=${branchExists}`); const dependencyDashboardCheck = config.dependencyDashboardChecks?.[config.branchName]; - logger.debug(`dependencyDashboardCheck=${dependencyDashboardCheck}`); + logger.debug(`dependencyDashboardCheck=${dependencyDashboardCheck!}`); if (branchPr) { config.rebaseRequested = rebaseCheck(config, branchPr); logger.debug(`PR rebase requested=${config.rebaseRequested}`); @@ -223,7 +225,6 @@ export async function processBranch( logger.debug('Branch has been edited but found no PR - skipping'); return { branchExists, - prNo: branchPr?.number, result: BranchResult.PrEdited, }; } @@ -241,7 +242,6 @@ export async function processBranch( ); return { branchExists, - prNo: branchPr?.number, result: BranchResult.PrEdited, }; } @@ -272,7 +272,6 @@ export async function processBranch( logger.debug('Skipping PR creation out of schedule'); return { branchExists, - prNo: branchPr?.number, result: BranchResult.NotScheduled, }; } @@ -285,7 +284,7 @@ export async function processBranch( config.upgrades.some( (upgrade) => (upgrade.stabilityDays && upgrade.releaseTimestamp) || - isActiveConfidenceLevel(upgrade.minimumConfidence) + isActiveConfidenceLevel(upgrade.minimumConfidence!) ) ) { // Only set a stability status check if one or more of the updates contain @@ -293,7 +292,7 @@ export async function processBranch( config.stabilityStatus = BranchStatus.green; // Default to 'success' but set 'pending' if any update is pending for (const upgrade of config.upgrades) { - if (upgrade.stabilityDays && upgrade.releaseTimestamp) { + if (is.number(upgrade.stabilityDays) && upgrade.releaseTimestamp) { const daysElapsed = getElapsedDays(upgrade.releaseTimestamp); if (daysElapsed < upgrade.stabilityDays) { logger.debug( @@ -308,14 +307,12 @@ export async function processBranch( continue; } } - const { - datasource, - depName, - minimumConfidence, - updateType, - currentVersion, - newVersion, - } = upgrade; + const datasource = upgrade.datasource!; + const depName = upgrade.depName!; + const minimumConfidence = upgrade.minimumConfidence!; + const updateType = upgrade.updateType!; + const currentVersion = upgrade.currentVersion!; + const newVersion = upgrade.newVersion!; if (isActiveConfidenceLevel(minimumConfidence)) { const confidence = await getMergeConfidenceLevel( datasource, @@ -341,7 +338,7 @@ export async function processBranch( !dependencyDashboardCheck && !branchExists && config.stabilityStatus === BranchStatus.yellow && - ['not-pending', 'status-success'].includes(config.prCreation) + ['not-pending', 'status-success'].includes(config.prCreation!) ) { logger.debug( 'Skipping branch creation due to internal status checks not met' @@ -388,12 +385,12 @@ export async function processBranch( } const additionalFiles = await getAdditionalFiles( config, - branchConfig.packageFiles + branchConfig.packageFiles! ); - config.artifactErrors = (config.artifactErrors || []).concat( + config.artifactErrors = (config.artifactErrors ?? []).concat( additionalFiles.artifactErrors ); - config.updatedArtifacts = (config.updatedArtifacts || []).concat( + config.updatedArtifacts = (config.updatedArtifacts ?? []).concat( additionalFiles.updatedArtifacts ); if (config.updatedArtifacts?.length) { @@ -459,10 +456,10 @@ export async function processBranch( config.isConflicted ??= branchExists && - (await isBranchConflicted(config.baseBranch, config.branchName)); + (await isBranchConflicted(config.baseBranch!, config.branchName)); config.forceCommit = forcedManually || config.isConflicted; - config.stopUpdating = branchPr?.labels?.includes(config.stopUpdatingLabel); + config.stopUpdating = branchPr?.labels?.includes(config.stopUpdatingLabel!); const prRebaseChecked = !!branchPr?.bodyStruct?.rebaseRequested; @@ -537,7 +534,7 @@ export async function processBranch( } if ( mergeStatus === 'stale' && - ['conflicted', 'never'].includes(config.rebaseWhen) + ['conflicted', 'never'].includes(config.rebaseWhen!) ) { logger.warn( 'Branch cannot automerge because it is stale and rebaseWhen setting disallows rebasing - raising a PR instead' @@ -635,7 +632,9 @@ export async function processBranch( try { logger.debug('Ensuring PR'); logger.debug( - `There are ${config.errors.length} errors and ${config.warnings.length} warnings` + `There are ${config.errors!.length} errors and ${ + config.warnings!.length + } warnings` ); const ensurePrResult = await ensurePr(config); if (ensurePrResult.type === 'without-pr') { @@ -704,8 +703,8 @@ export async function processBranch( content = platform.massageMarkdown(content); if ( !( - config.suppressNotifications.includes('artifactErrors') || - config.suppressNotifications.includes('lockFileErrors') + config.suppressNotifications!.includes('artifactErrors') || + config.suppressNotifications!.includes('lockFileErrors') ) ) { if (GlobalConfig.get('dryRun')) { diff --git a/lib/workers/repository/update/branch/reuse.ts b/lib/workers/repository/update/branch/reuse.ts index 8a6447b036dbf1..11a8e149d7df8a 100644 --- a/lib/workers/repository/update/branch/reuse.ts +++ b/lib/workers/repository/update/branch/reuse.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { GlobalConfig } from '../../../../config/global'; import { logger } from '../../../../logger'; import { platform } from '../../../../modules/platform'; @@ -40,15 +41,17 @@ export async function shouldReuseExistingBranch( logger.debug(`Manual rebase requested via PR checkbox for #${pr.number}`); return result; } - if (pr.labels?.includes(config.rebaseLabel)) { + if (pr.labels?.includes(config.rebaseLabel!)) { logger.debug(`Manual rebase requested via PR labels for #${pr.number}`); // istanbul ignore if if (GlobalConfig.get('dryRun')) { logger.info( - `DRY-RUN: Would delete label ${config.rebaseLabel} from #${pr.number}` + `DRY-RUN: Would delete label ${config.rebaseLabel!} from #${ + pr.number + }` ); } else { - await platform.deleteLabel(pr.number, config.rebaseLabel); + await platform.deleteLabel(pr.number, config.rebaseLabel!); } return result; } @@ -74,12 +77,12 @@ export async function shouldReuseExistingBranch( logger.debug('Branch is up-to-date'); } else { logger.debug( - `Skipping stale branch check due to rebaseWhen=${config.rebaseWhen}` + `Skipping stale branch check due to rebaseWhen=${config.rebaseWhen!}` ); } // Now check if PR is unmergeable. If so then we also rebase - result.isConflicted = await isBranchConflicted(baseBranch, branchName); + result.isConflicted = await isBranchConflicted(baseBranch!, branchName); if (result.isConflicted) { logger.debug('Branch is conflicted'); @@ -106,13 +109,13 @@ export async function shouldReuseExistingBranch( // This is why we are skipping branch reuse in this case (#10050) const groupedByPackageFile: Record> = {}; for (const upgrade of config.upgrades) { - groupedByPackageFile[upgrade.packageFile] = - groupedByPackageFile[upgrade.packageFile] || new Set(); - groupedByPackageFile[upgrade.packageFile].add(upgrade.rangeStrategy); + const packageFile = upgrade.packageFile!; + groupedByPackageFile[packageFile] ??= new Set(); + groupedByPackageFile[packageFile].add(upgrade.rangeStrategy!); if ( - groupedByPackageFile[upgrade.packageFile].size > 1 && - groupedByPackageFile[upgrade.packageFile].has('update-lockfile') + groupedByPackageFile[packageFile].size > 1 && + groupedByPackageFile[packageFile].has('update-lockfile') ) { logger.debug( `Detected multiple rangeStrategies along with update-lockfile` diff --git a/lib/workers/repository/update/pr/automerge.ts b/lib/workers/repository/update/pr/automerge.ts index 227f7f69b23f5c..2ec9b9546c3256 100644 --- a/lib/workers/repository/update/pr/automerge.ts +++ b/lib/workers/repository/update/pr/automerge.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { GlobalConfig } from '../../../../config/global'; import { logger } from '../../../../logger'; import { Pr, platform } from '../../../../modules/platform'; @@ -56,7 +57,7 @@ export async function checkAutoMerge( } const isConflicted = config.isConflicted ?? - (await isBranchConflicted(config.baseBranch, config.branchName)); + (await isBranchConflicted(config.baseBranch!, config.branchName)); if (isConflicted) { logger.debug('PR is conflicted'); return { @@ -110,13 +111,13 @@ export async function checkAutoMerge( await ensureCommentRemoval({ type: 'by-content', number: pr.number, - content: automergeComment, + content: automergeComment!, }); } await ensureComment({ number: pr.number, topic: null, - content: automergeComment, + content: automergeComment!, }); return { automerged: true, branchRemoved: false }; } diff --git a/lib/workers/repository/update/pr/changelog/release-notes.ts b/lib/workers/repository/update/pr/changelog/release-notes.ts index 71c0a8aed6ee8a..8a94dec41c3a89 100644 --- a/lib/workers/repository/update/pr/changelog/release-notes.ts +++ b/lib/workers/repository/update/pr/changelog/release-notes.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import URL from 'url'; import is from '@sindresorhus/is'; import { DateTime } from 'luxon'; @@ -70,7 +71,7 @@ export function massageBody( input: string | undefined | null, baseUrl: string ): string { - let body = input || ''; + let body = input ?? ''; // Convert line returns body = body.replace(regEx(/\r\n/g), '\n'); // semantic-release cleanup @@ -109,7 +110,7 @@ export async function getReleaseNotes( logger.trace({ releases }, 'Release list from getReleaseList'); let releaseNotes: ChangeLogNotes | null = null; - let matchedRelease = getExactReleaseMatch(depName, version, releases); + let matchedRelease = getExactReleaseMatch(depName!, version, releases); if (is.undefined(matchedRelease)) { // no exact match of a release then check other cases matchedRelease = releases.find( @@ -123,7 +124,8 @@ export async function getReleaseNotes( if (is.undefined(matchedRelease) && config.extractVersion) { const extractVersionRegEx = regEx(config.extractVersion); matchedRelease = releases.find((r) => { - const extractedVersion = extractVersionRegEx.exec(r.tag)?.groups?.version; + const extractedVersion = extractVersionRegEx.exec(r.tag!)?.groups + ?.version; return version === extractedVersion; }); } @@ -140,7 +142,7 @@ function getExactReleaseMatch( const exactReleaseReg = regEx(`${depName}[@_-]v?${version}`); const candidateReleases = releases.filter((r) => r.tag?.endsWith(version)); const matchedRelease = candidateReleases.find((r) => - exactReleaseReg.test(r.tag) + exactReleaseReg.test(r.tag!) ); return matchedRelease; } @@ -189,7 +191,7 @@ function sectionize(text: string, level: number): string[] { if (token.type === 'heading_open') { const lev = +token.tag.substr(1); if (lev <= level) { - sections.push([lev, token.map[0]]); + sections.push([lev, token.map![0]]); } } }); @@ -218,8 +220,10 @@ function isUrl(url: string): boolean { export async function getReleaseNotesMdFileInner( project: ChangeLogProject -): Promise | null { - const { apiBaseUrl, repository, sourceDirectory, type } = project; +): Promise { + const { repository, type } = project; + const apiBaseUrl = project.apiBaseUrl!; + const sourceDirectory = project.sourceDirectory!; try { switch (type) { case 'gitlab': @@ -355,7 +359,7 @@ export async function getReleaseNotesMd( export function releaseNotesCacheMinutes(releaseDate?: string | Date): number { const dt = is.date(releaseDate) ? DateTime.fromJSDate(releaseDate) - : DateTime.fromISO(releaseDate); + : DateTime.fromISO(releaseDate!); const now = DateTime.local(); @@ -387,7 +391,7 @@ export async function addReleaseNotes( }${version}`; } for (const v of input.versions) { - let releaseNotes: ChangeLogNotes; + let releaseNotes: ChangeLogNotes | null | undefined; const cacheKey = getCacheKey(v.version); releaseNotes = await packageCache.get(cacheNamespace, cacheKey); // istanbul ignore else: no cache tests @@ -409,11 +413,11 @@ export async function addReleaseNotes( cacheMinutes ); } - output.versions.push({ + output.versions!.push({ ...v, - releaseNotes, + releaseNotes: releaseNotes!, }); - output.hasReleaseNotes = output.hasReleaseNotes || !!releaseNotes; + output.hasReleaseNotes = !!output.hasReleaseNotes || !!releaseNotes; } return output; } diff --git a/lib/workers/repository/update/pr/changelog/releases.ts b/lib/workers/repository/update/pr/changelog/releases.ts index 9163fd5448ebdd..a0298f48f83813 100644 --- a/lib/workers/repository/update/pr/changelog/releases.ts +++ b/lib/workers/repository/update/pr/changelog/releases.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { logger } from '../../../../../logger'; import { Release, @@ -26,14 +27,17 @@ function matchesUnstable( export async function getInRangeReleases( config: BranchUpgradeConfig ): Promise { - const { versioning, currentVersion, newVersion, depName, datasource } = - config; + const versioning = config.versioning!; + const currentVersion = config.currentVersion!; + const newVersion = config.newVersion!; + const depName = config.depName!; + const datasource = config.datasource!; // istanbul ignore if if (!isGetPkgReleasesConfig(config)) { return null; } try { - const pkgReleases = (await getPkgReleases(config)).releases; + const pkgReleases = (await getPkgReleases(config))!.releases; const version = get(versioning); const releases = pkgReleases diff --git a/lib/workers/repository/update/pr/changelog/source-github.ts b/lib/workers/repository/update/pr/changelog/source-github.ts index 2dbd02457d722c..c111c7a28b1756 100644 --- a/lib/workers/repository/update/pr/changelog/source-github.ts +++ b/lib/workers/repository/update/pr/changelog/source-github.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import URL from 'url'; import { GlobalConfig } from '../../../../../config/global'; import { PlatformId } from '../../../../../constants'; @@ -32,15 +33,13 @@ function getCachedTags( export async function getChangeLogJSON( config: BranchUpgradeConfig ): Promise { - const { - versioning, - currentVersion, - newVersion, - sourceUrl, - sourceDirectory, - depName, - manager, - } = config; + const versioning = config.versioning!; + const currentVersion = config.currentVersion!; + const newVersion = config.newVersion!; + const sourceUrl = config.sourceUrl!; + const sourceDirectory = config.sourceDirectory!; + const depName = config.depName!; + const manager = config.manager; if (sourceUrl === 'https://github.com/DefinitelyTyped/DefinitelyTyped') { logger.trace('No release notes for @types'); return null; @@ -57,7 +56,7 @@ export async function getChangeLogJSON( }); // istanbul ignore if if (!token) { - if (host.endsWith('github.com')) { + if (host!.endsWith('.github.com') || host === 'github.com') { if (!GlobalConfig.get().githubTokenWarn) { logger.debug( { manager, depName, sourceUrl }, @@ -80,7 +79,7 @@ export async function getChangeLogJSON( const apiBaseUrl = sourceUrl.startsWith('https://github.com/') ? 'https://api.github.com/' : baseUrl + 'api/v3/'; - const repository = pathname + const repository = pathname! .slice(1) .replace(regEx(/\/$/), '') .replace(regEx(/\.git$/), ''); @@ -88,7 +87,7 @@ export async function getChangeLogJSON( logger.debug({ sourceUrl }, 'Invalid github URL found'); return null; } - const releases = config.releases || (await getInRangeReleases(config)); + const releases = config.releases ?? (await getInRangeReleases(config)); if (!releases?.length) { logger.debug('No releases'); return null; diff --git a/lib/workers/repository/update/pr/changelog/source-gitlab.ts b/lib/workers/repository/update/pr/changelog/source-gitlab.ts index 1775f8e91ac79c..964ced4a93acec 100644 --- a/lib/workers/repository/update/pr/changelog/source-gitlab.ts +++ b/lib/workers/repository/update/pr/changelog/source-gitlab.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import URL from 'url'; import { logger } from '../../../../../logger'; import type { Release } from '../../../../../modules/datasource/types'; @@ -32,18 +33,22 @@ function getCachedTags( export async function getChangeLogJSON( config: BranchUpgradeConfig ): Promise { - const { - versioning, - currentVersion, - newVersion, - sourceUrl, - depName, - manager, - sourceDirectory, - } = config; + const versioning = config.versioning!; + const currentVersion = config.currentVersion!; + const newVersion = config.newVersion!; + const sourceUrl = config.sourceUrl!; + const depName = config.depName!; + const manager = config.manager; + const sourceDirectory = config.sourceDirectory!; + logger.trace('getChangeLogJSON for gitlab'); const version = allVersioning.get(versioning); - const { protocol, host, pathname } = URL.parse(sourceUrl); + + const parsedUrl = URL.parse(sourceUrl); + const protocol = parsedUrl.protocol!; + const host = parsedUrl.host!; + const pathname = parsedUrl.pathname!; + logger.trace({ protocol, host, pathname }, 'Protocol, host, pathname'); const baseUrl = protocol.concat('//', host, '/'); const apiBaseUrl = baseUrl.concat('api/v4/'); @@ -55,7 +60,7 @@ export async function getChangeLogJSON( logger.info({ sourceUrl }, 'Invalid gitlab URL found'); return null; } - const releases = config.releases || (await getInRangeReleases(config)); + const releases = config.releases ?? (await getInRangeReleases(config)); if (!releases?.length) { logger.debug('No releases'); return null; diff --git a/lib/workers/repository/updates/branch-name.ts b/lib/workers/repository/updates/branch-name.ts index 2e4b08e4ef33ee..abcd703f5cbb9d 100644 --- a/lib/workers/repository/updates/branch-name.ts +++ b/lib/workers/repository/updates/branch-name.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import cleanGitRef from 'clean-git-ref'; import hasha from 'hasha'; import slugify from 'slugify'; @@ -51,12 +52,12 @@ export function generateBranchName(update: RenovateConfig): void { if (update.updateType === 'patch' && update.separateMinorPatch) { update.groupSlug = `patch-${update.groupSlug}`; } - update.branchTopic = update.group.branchTopic || update.branchTopic; - update.branchName = update.group.branchName || update.branchName; + update.branchTopic = update.group!.branchTopic || update.branchTopic; + update.branchName = update.group!.branchName || update.branchName; } if (update.hashedBranchLength) { - let hashLength = update.hashedBranchLength - update.branchPrefix.length; + let hashLength = update.hashedBranchLength - update.branchPrefix!.length; if (hashLength < MIN_HASH_LENGTH) { logger.warn( `\`hashedBranchLength\` must allow for at least ${MIN_HASH_LENGTH} characters hashing in addition to \`branchPrefix\`. Using ${MIN_HASH_LENGTH} character hash instead.` @@ -84,7 +85,7 @@ export function generateBranchName(update: RenovateConfig): void { update.branchName = update.branchPrefix + hash.slice(0, hashLength); } else { - update.branchName = template.compile(update.branchName, update); + update.branchName = template.compile(update.branchName!, update); // Compile extra times in case of nested templates update.branchName = template.compile(update.branchName, update); diff --git a/lib/workers/repository/updates/branchify.ts b/lib/workers/repository/updates/branchify.ts index 15e8f7b0d9be61..739cb1a7900298 100644 --- a/lib/workers/repository/updates/branchify.ts +++ b/lib/workers/repository/updates/branchify.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import type { Merge } from 'type-fest'; import type { RenovateConfig, ValidationMessage } from '../../../config/types'; import { addMeta, logger, removeMeta } from '../../../logger'; @@ -45,7 +46,7 @@ export async function branchifyUpgrades( addMeta({ branch: branchName, }); - const seenUpdates = {}; + const seenUpdates: Record = {}; // Filter out duplicates branchUpgrades[branchName] = branchUpgrades[branchName] .reverse() @@ -68,7 +69,7 @@ export async function branchifyUpgrades( ); return false; } - seenUpdates[upgradeKey] = newValue; + seenUpdates[upgradeKey] = newValue!; return true; }) .reverse(); @@ -93,7 +94,7 @@ export async function branchifyUpgrades( const key = `${sourceUrl}|${newVersion}`; branchUpdates[key] = branchUpdates[key] || {}; if (!branchUpdates[key][branchName]) { - branchUpdates[key][branchName] = depName; + branchUpdates[key][branchName] = depName!; } } } @@ -110,9 +111,9 @@ export async function branchifyUpgrades( logger.debug({ err }, 'Error checking branch duplicates'); } return { - errors: config.errors.concat(errors), - warnings: config.warnings.concat(warnings), + errors: config.errors!.concat(errors), + warnings: config.warnings!.concat(warnings), branches, - branchList, + branchList: branchList!, }; } diff --git a/lib/workers/repository/updates/flatten.ts b/lib/workers/repository/updates/flatten.ts index fc3b35736f2ce8..4c6fba0de806c0 100644 --- a/lib/workers/repository/updates/flatten.ts +++ b/lib/workers/repository/updates/flatten.ts @@ -101,7 +101,7 @@ export async function flattenUpdates( updateConfig[`is${upper(updateConfig.updateType)}`] = true; } if (updateConfig.updateTypes) { - updateConfig.updateTypes.forEach((updateType) => { + updateConfig.updateTypes.forEach((updateType: string) => { updateConfig[`is${upper(updateType)}`] = true; }); } @@ -157,7 +157,11 @@ export async function flattenUpdates( } if (get(manager, 'updateLockedDependency')) { for (const lockFile of packageFileConfig.lockFiles || []) { - const remediations = config.remediations?.[lockFile]; + const lockfileRemediations = config.remediations as Record< + string, + Record[] + >; + const remediations = lockfileRemediations?.[lockFile]; if (remediations) { for (const remediation of remediations) { let updateConfig = mergeChildConfig( diff --git a/lib/workers/repository/updates/generate.ts b/lib/workers/repository/updates/generate.ts index f3df4f73124313..04af7f203a1bee 100644 --- a/lib/workers/repository/updates/generate.ts +++ b/lib/workers/repository/updates/generate.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import is from '@sindresorhus/is'; import { DateTime } from 'luxon'; import mdTable from 'markdown-table'; @@ -22,7 +23,7 @@ function isTypesGroup(branchUpgrades: BranchUpgradeConfig[]): boolean { function sortTypesGroup(upgrades: BranchUpgradeConfig[]): void { const isTypesUpgrade = ({ depName }: BranchUpgradeConfig): boolean => - depName?.startsWith('@types/'); + !!depName?.startsWith('@types/'); const regularUpgrades = upgrades.filter( (upgrade) => !isTypesUpgrade(upgrade) ); @@ -31,15 +32,13 @@ function sortTypesGroup(upgrades: BranchUpgradeConfig[]): void { upgrades.push(...regularUpgrades, ...typesUpgrades); } -function getTableValues( - upgrade: BranchUpgradeConfig -): [string, string, string, string] | null { +function getTableValues(upgrade: BranchUpgradeConfig): string[] | null { if (!upgrade.commitBodyTable) { return null; } const { datasource, packageName, depName, currentVersion, newVersion } = upgrade; - const name = packageName || depName; + const name = packageName ?? depName; if (datasource && name && currentVersion && newVersion) { return [datasource, name, currentVersion, newVersion]; } @@ -76,13 +75,13 @@ export function generateBranchConfig( const toVersions: string[] = []; const toValues = new Set(); branchUpgrades.forEach((upg) => { - if (!depNames.includes(upg.depName)) { - depNames.push(upg.depName); + if (!depNames.includes(upg.depName!)) { + depNames.push(upg.depName!); } - if (!toVersions.includes(upg.newVersion)) { - toVersions.push(upg.newVersion); + if (!toVersions.includes(upg.newVersion!)) { + toVersions.push(upg.newVersion!); } - toValues.add(upg.newValue); + toValues.add(upg.newValue!); if (upg.commitMessageExtra) { const extra = template.compile(upg.commitMessageExtra, upg); if (!newValue.includes(extra)) { @@ -107,7 +106,7 @@ export function generateBranchConfig( let upgrade: BranchUpgradeConfig = { ...branchUpgrade }; if (upgrade.currentDigest) { upgrade.currentDigestShort = - upgrade.currentDigestShort || + upgrade.currentDigestShort ?? upgrade.currentDigest.replace('sha256:', '').substring(0, 7); } if (upgrade.newDigest) { @@ -129,7 +128,9 @@ export function generateBranchConfig( upgrade.displayTo ??= ''; const pendingVersionsLength = upgrade.pendingVersions?.length; if (pendingVersionsLength) { - upgrade.displayPending = `\`${upgrade.pendingVersions.slice(-1).pop()}\``; + upgrade.displayPending = `\`${upgrade + .pendingVersions!.slice(-1) + .pop()}\``; if (pendingVersionsLength > 1) { upgrade.displayPending += ` (+${pendingVersionsLength - 1})`; } @@ -137,7 +138,7 @@ export function generateBranchConfig( upgrade.displayPending = ''; } upgrade.prettyDepType = - upgrade.prettyDepType || upgrade.depType || 'dependency'; + upgrade.prettyDepType ?? upgrade.depType ?? 'dependency'; if (useGroupSettings) { // Now overwrite original config with group config upgrade = mergeChildConfig(upgrade, upgrade.group); @@ -176,14 +177,14 @@ export function generateBranchConfig( upgrade )})`; } - upgrade.commitMessagePrefix = CommitMessage.formatPrefix(semanticPrefix); + upgrade.commitMessagePrefix = CommitMessage.formatPrefix(semanticPrefix!); upgrade.toLowerCase = - regEx(/[A-Z]/).exec(upgrade.semanticCommitType) === null && - !upgrade.semanticCommitType.startsWith(':'); + regEx(/[A-Z]/).exec(upgrade.semanticCommitType!) === null && + !upgrade.semanticCommitType!.startsWith(':'); } // Compile a few times in case there are nested templates upgrade.commitMessage = template.compile( - upgrade.commitMessage || '', + upgrade.commitMessage ?? '', upgrade ); upgrade.commitMessage = template.compile(upgrade.commitMessage, upgrade); @@ -256,7 +257,7 @@ export function generateBranchConfig( logger.trace(`prTitle: ` + JSON.stringify(upgrade.prTitle)); config.upgrades.push(upgrade); if (upgrade.releaseTimestamp) { - if (releaseTimestamp) { + if (releaseTimestamp!) { const existingStamp = DateTime.fromISO(releaseTimestamp); const upgradeStamp = DateTime.fromISO(upgrade.releaseTimestamp); if (upgradeStamp > existingStamp) { @@ -291,17 +292,21 @@ export function generateBranchConfig( return -1; } - if (a.depName < b.depName) { + if (a.depName! < b.depName!) { return -1; } - if (a.depName > b.depName) { + if (a.depName! > b.depName!) { return 1; } return 0; }); } // Now assign first upgrade's config as branch config - config = { ...config, ...config.upgrades[0], releaseTimestamp }; // TODO: fixme (#9666) + config = { + ...config, + ...config.upgrades[0], + releaseTimestamp: releaseTimestamp!, + }; // TODO: fixme (#9666) config.reuseLockFiles = config.upgrades.every( (upgrade) => upgrade.updateType !== 'lockFileMaintenance' ); @@ -314,7 +319,8 @@ export function generateBranchConfig( config.prBodyColumns = [ ...new Set( config.upgrades.reduce( - (existing, upgrade) => existing.concat(upgrade.prBodyColumns), + (existing: string[], upgrade) => + existing.concat(upgrade.prBodyColumns!), [] ) ), @@ -324,14 +330,14 @@ export function generateBranchConfig( config.labels = [ ...new Set( config.upgrades - .map((upgrade) => upgrade.labels || []) + .map((upgrade) => upgrade.labels ?? []) .reduce((a, b) => a.concat(b), []) ), ]; config.addLabels = [ ...new Set( config.upgrades - .map((upgrade) => upgrade.addLabels || []) + .map((upgrade) => upgrade.addLabels ?? []) .reduce((a, b) => a.concat(b), []) ), ]; @@ -344,13 +350,14 @@ export function generateBranchConfig( config.constraints = { ...config.constraints, ...upgrade.constraints }; } } + const tableRows = config.upgrades - .map((upgrade) => getTableValues(upgrade)) - .filter(Boolean); + .map(getTableValues) + .filter((x): x is string[] => is.array(x, is.string)); if (tableRows.length) { - let table = []; + let table: string[][] = []; table.push(['datasource', 'package', 'from', 'to']); - table = table.concat(tableRows); + table = table.concat(tableRows!); config.commitMessage += '\n\n' + mdTable(table) + '\n'; } return config; diff --git a/lib/workers/types.ts b/lib/workers/types.ts index 8e94d85a80d7ec..1ad103efc03379 100644 --- a/lib/workers/types.ts +++ b/lib/workers/types.ts @@ -66,7 +66,7 @@ export interface BranchUpgradeConfig updatedPackageFiles?: FileChange[]; updatedArtifacts?: FileChange[]; - logJSON?: ChangeLogResult; + logJSON?: ChangeLogResult | null; hasReleaseNotes?: boolean; homepage?: string; diff --git a/tsconfig.strict.json b/tsconfig.strict.json index 6d4dc16e5ed380..f3e83a6a7d6a14 100644 --- a/tsconfig.strict.json +++ b/tsconfig.strict.json @@ -17,70 +17,6 @@ "lib/workers/**/*.spec.ts", "lib/modules/datasource/**/*.spec.ts", "lib/modules/manager/**/*.spec.ts", - "lib/renovate.ts", - "lib/renovate.spec.ts", - "lib/workers/global/autodiscover.ts", - "lib/workers/global/config/parse/cli.ts", - "lib/workers/global/config/parse/env.ts", - "lib/workers/global/config/parse/file.ts", - "lib/workers/global/config/parse/host-rules-from-env.ts", - "lib/workers/global/config/parse/index.ts", - "lib/workers/global/index.ts", - "lib/workers/global/initialize.ts", - "lib/workers/repository/changelog/index.ts", - "lib/workers/repository/error-config.ts", - "lib/workers/repository/error.ts", - "lib/workers/repository/finalise/index.ts", - "lib/workers/repository/finalise/prune.ts", - "lib/workers/repository/index.ts", - "lib/workers/repository/init/apis.ts", - "lib/workers/repository/init/config.ts", - "lib/workers/repository/init/index.ts", - "lib/workers/repository/init/semantic.ts", - "lib/workers/repository/init/vulnerability.ts", - "lib/workers/repository/onboarding/branch/check.ts", - "lib/workers/repository/onboarding/branch/config.ts", - "lib/workers/repository/onboarding/branch/create.ts", - "lib/workers/repository/onboarding/branch/index.ts", - "lib/workers/repository/onboarding/branch/rebase.ts", - "lib/workers/repository/onboarding/pr/base-branch.ts", - "lib/workers/repository/onboarding/pr/config-description.ts", - "lib/workers/repository/errors-warnings.ts", - "lib/workers/repository/onboarding/pr/index.ts", - "lib/workers/repository/onboarding/pr/pr-list.ts", - "lib/workers/repository/config-migration/pr/index.ts", - "lib/workers/repository/process/deprecated.ts", - "lib/workers/repository/process/extract-update.ts", - "lib/workers/repository/process/fetch.ts", - "lib/workers/repository/process/index.ts", - "lib/workers/repository/process/limits.ts", - "lib/workers/repository/process/sort.ts", - "lib/workers/repository/process/write.ts", - "lib/workers/repository/process/vulnerabilities.ts", - "lib/workers/repository/updates/branch-name.ts", - "lib/workers/repository/updates/branchify.ts", - "lib/workers/repository/updates/flatten.ts", - "lib/workers/repository/updates/generate.ts", - "lib/workers/repository/update/branch/artifacts.ts", - "lib/workers/repository/update/branch/auto-replace.ts", - "lib/workers/repository/update/branch/automerge.ts", - "lib/workers/repository/update/branch/check-existing.ts", - "lib/workers/repository/update/branch/commit.ts", - "lib/workers/repository/update/branch/execute-post-upgrade-commands.ts", - "lib/workers/repository/update/branch/get-updated.ts", - "lib/workers/repository/update/branch/handle-existing.ts", - "lib/workers/repository/update/branch/index.ts", - "lib/workers/repository/update/branch/reuse.ts", - "lib/workers/repository/update/branch/schedule.ts", - "lib/workers/repository/update/pr/automerge.ts", - "lib/workers/repository/update/pr/body/controls.ts", - "lib/workers/repository/update/pr/changelog/github/index.ts", - "lib/workers/repository/update/pr/changelog/gitlab/index.ts", - "lib/workers/repository/update/pr/changelog/index.ts", - "lib/workers/repository/update/pr/changelog/release-notes.ts", - "lib/workers/repository/update/pr/changelog/releases.ts", - "lib/workers/repository/update/pr/changelog/source-github.ts", - "lib/workers/repository/update/pr/changelog/source-gitlab.ts", - "lib/workers/repository/update/pr/code-owners.ts" + "lib/renovate.spec.ts" ] } From 0838ca209c3d11d12fc65c42a46be22632be437c Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Mon, 20 Jun 2022 13:15:02 +0200 Subject: [PATCH 145/240] refactor: strict datasource tests (#16150) --- .../datasource/golang-version/index.spec.ts | 20 ++-- .../datasource/gradle-version/index.spec.ts | 9 +- lib/modules/datasource/helm/index.spec.ts | 4 +- lib/modules/datasource/hex/index.spec.ts | 12 +-- lib/modules/datasource/index.spec.ts | 19 ++-- .../datasource/jenkins-plugins/index.spec.ts | 18 ++-- lib/modules/datasource/maven/index.spec.ts | 92 +++++++++---------- lib/modules/datasource/maven/util.spec.ts | 23 +++-- lib/modules/datasource/node/index.spec.ts | 2 +- lib/modules/datasource/npm/get.spec.ts | 25 ++--- lib/modules/datasource/npm/index.spec.ts | 6 +- lib/modules/datasource/repology/index.spec.ts | 40 ++++---- lib/modules/datasource/rubygems/index.spec.ts | 38 ++++---- .../datasource/sbt-package/index.spec.ts | 2 +- .../datasource/sbt-plugin/index.spec.ts | 8 +- lib/util/modules.ts | 2 +- 16 files changed, 164 insertions(+), 156 deletions(-) diff --git a/lib/modules/datasource/golang-version/index.spec.ts b/lib/modules/datasource/golang-version/index.spec.ts index 39ea17852cb9fb..8b0ab2e03adf2b 100644 --- a/lib/modules/datasource/golang-version/index.spec.ts +++ b/lib/modules/datasource/golang-version/index.spec.ts @@ -1,16 +1,16 @@ import { getPkgReleases } from '..'; +import { Fixtures } from '../../../../test/fixtures'; import * as httpMock from '../../../../test/http-mock'; -import { loadFixture } from '../../../../test/util'; import { ExternalHostError } from '../../../types/errors/external-host-error'; import { GolangVersionDatasource } from '.'; -const golangReleasesContent = loadFixture('releases.go'); -const golangReleasesInvalidContent = loadFixture('releases-invalid.go'); -const golangReleasesInvalidContent2 = loadFixture('releases-invalid2.go'); -const golangReleasesInvalidContent3 = loadFixture('releases-invalid3.go'); -const golangReleasesInvalidContent4 = loadFixture('releases-invalid4.go'); -const golangReleasesInvalidContent5 = loadFixture('releases-invalid5.go'); -const golangReleasesInvalidContent6 = loadFixture('releases-invalid6.go'); +const golangReleasesContent = Fixtures.get('releases.go'); +const golangReleasesInvalidContent = Fixtures.get('releases-invalid.go'); +const golangReleasesInvalidContent2 = Fixtures.get('releases-invalid2.go'); +const golangReleasesInvalidContent3 = Fixtures.get('releases-invalid3.go'); +const golangReleasesInvalidContent4 = Fixtures.get('releases-invalid4.go'); +const golangReleasesInvalidContent5 = Fixtures.get('releases-invalid5.go'); +const golangReleasesInvalidContent6 = Fixtures.get('releases-invalid6.go'); const datasource = GolangVersionDatasource.id; @@ -25,8 +25,8 @@ describe('modules/datasource/golang-version/index', () => { datasource, depName: 'golang', }); - expect(res.releases).toHaveLength(132); - expect(res.releases[0]).toEqual({ + expect(res?.releases).toHaveLength(132); + expect(res?.releases[0]).toEqual({ releaseTimestamp: '2012-03-28T00:00:00.000Z', version: '1.0.0', }); diff --git a/lib/modules/datasource/gradle-version/index.spec.ts b/lib/modules/datasource/gradle-version/index.spec.ts index ce97975706a085..e8dbc138ead954 100644 --- a/lib/modules/datasource/gradle-version/index.spec.ts +++ b/lib/modules/datasource/gradle-version/index.spec.ts @@ -1,11 +1,12 @@ import { GetPkgReleasesConfig, GetReleasesConfig, getPkgReleases } from '..'; +import { Fixtures } from '../../../../test/fixtures'; import * as httpMock from '../../../../test/http-mock'; -import { loadJsonFixture, partial } from '../../../../test/util'; +import { partial } from '../../../../test/util'; import { ExternalHostError } from '../../../types/errors/external-host-error'; import { id as versioning } from '../../versioning/gradle'; import { GradleVersionDatasource } from '.'; -const allResponse: any = loadJsonFixture('all.json'); +const allResponse = Fixtures?.get('all.json'); let config: GetPkgReleasesConfig; @@ -30,9 +31,9 @@ describe('modules/datasource/gradle-version/index', () => { const res = await getPkgReleases(config); expect(res).toMatchSnapshot(); expect(res).not.toBeNull(); - expect(res.releases).toHaveLength(300); + expect(res?.releases).toHaveLength(300); expect( - res.releases.filter(({ isDeprecated }) => isDeprecated) + res?.releases.filter(({ isDeprecated }) => isDeprecated) ).toHaveLength(1); }); diff --git a/lib/modules/datasource/helm/index.spec.ts b/lib/modules/datasource/helm/index.spec.ts index 6280a5f3d3305d..54ea10e1198a18 100644 --- a/lib/modules/datasource/helm/index.spec.ts +++ b/lib/modules/datasource/helm/index.spec.ts @@ -16,7 +16,7 @@ describe('modules/datasource/helm/index', () => { expect( await getPkgReleases({ datasource: HelmDatasource.id, - depName: undefined, + depName: undefined as never, // #7154 registryUrls: ['https://example-repository.com'], }) ).toBeNull(); @@ -41,7 +41,7 @@ describe('modules/datasource/helm/index', () => { httpMock .scope('https://example-repository.com') .get('/index.yaml') - .reply(200, null); + .reply(200); expect( await getPkgReleases({ datasource: HelmDatasource.id, diff --git a/lib/modules/datasource/hex/index.spec.ts b/lib/modules/datasource/hex/index.spec.ts index 669faf63f48cba..1e8401d8cfa0c7 100644 --- a/lib/modules/datasource/hex/index.spec.ts +++ b/lib/modules/datasource/hex/index.spec.ts @@ -1,11 +1,12 @@ import { getPkgReleases } from '..'; +import { Fixtures } from '../../../../test/fixtures'; import * as httpMock from '../../../../test/http-mock'; -import { hostRules, loadJsonFixture } from '../../../../test/util'; +import { hostRules } from '../../../../test/util'; import { EXTERNAL_HOST_ERROR } from '../../../constants/error-messages'; import { HexDatasource } from '.'; -const certifiResponse = loadJsonFixture('certifi.json'); -const privatePackageResponse = loadJsonFixture('private_package.json'); +const certifiResponse = Fixtures.get('certifi.json'); +const privatePackageResponse = Fixtures.get('private_package.json'); jest.mock('../../../util/host-rules'); @@ -24,10 +25,7 @@ describe('modules/datasource/hex/index', () => { describe('getReleases', () => { it('returns null for empty result', async () => { - httpMock - .scope(baseUrl) - .get('/packages/non_existent_package') - .reply(200, null); + httpMock.scope(baseUrl).get('/packages/non_existent_package').reply(200); expect( await getPkgReleases({ datasource, diff --git a/lib/modules/datasource/index.spec.ts b/lib/modules/datasource/index.spec.ts index ace1cba910a42d..1463e98cd00769 100644 --- a/lib/modules/datasource/index.spec.ts +++ b/lib/modules/datasource/index.spec.ts @@ -1,3 +1,5 @@ +/* fixme #7154 */ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import fs from 'fs-extra'; import { logger } from '../../../test/util'; import { @@ -20,7 +22,10 @@ import { const datasource = 'dummy'; const depName = 'package'; -type RegistriesMock = Record ReleaseResult)>; +type RegistriesMock = Record< + string, + ReleaseResult | (() => ReleaseResult) | null +>; const defaultRegistriesMock: RegistriesMock = { 'https://reg1.com': { releases: [{ version: '1.2.3' }] }, }; @@ -35,7 +40,7 @@ class DummyDatasource extends Datasource { override getReleases({ registryUrl, }: GetReleasesConfig): Promise { - const fn = this.registriesMock[registryUrl]; + const fn = this.registriesMock[registryUrl!]; if (typeof fn === 'function') { return Promise.resolve(fn()); } @@ -55,7 +60,7 @@ class DummyDatasource2 extends Datasource { override getReleases({ registryUrl, }: GetReleasesConfig): Promise { - const fn = this.registriesMock[registryUrl]; + const fn = this.registriesMock[registryUrl!]; if (typeof fn === 'function') { return Promise.resolve(fn()); } @@ -76,7 +81,7 @@ class DummyDatasource3 extends Datasource { override getReleases({ registryUrl, }: GetReleasesConfig): Promise { - const fn = this.registriesMock[registryUrl]; + const fn = this.registriesMock[registryUrl!]; if (typeof fn === 'function') { return Promise.resolve(fn()); } @@ -151,7 +156,7 @@ describe('modules/datasource/index', () => { expect(Array.from(dss.keys())).toEqual(Object.keys(loadedDs)); for (const dsName of dss.keys()) { - const ds = dss.get(dsName); + const ds = dss.get(dsName)!; expect(validateDatasource(ds, dsName)).toBeTrue(); } }); @@ -159,7 +164,7 @@ describe('modules/datasource/index', () => { it('returns null for null datasource', async () => { expect( await getPkgReleases({ - datasource: null, + datasource: null as never, // #7154 depName: 'some/dep', }) ).toBeNull(); @@ -170,7 +175,7 @@ describe('modules/datasource/index', () => { expect( await getPkgReleases({ datasource: datasource, - depName: null, + depName: null as never, // #7154 }) ).toBeNull(); }); diff --git a/lib/modules/datasource/jenkins-plugins/index.spec.ts b/lib/modules/datasource/jenkins-plugins/index.spec.ts index be2a514f685d41..d00abf611f65d8 100644 --- a/lib/modules/datasource/jenkins-plugins/index.spec.ts +++ b/lib/modules/datasource/jenkins-plugins/index.spec.ts @@ -1,11 +1,11 @@ import { getPkgReleases } from '..'; +import { Fixtures } from '../../../../test/fixtures'; import * as httpMock from '../../../../test/http-mock'; -import { loadJsonFixture } from '../../../../test/util'; import * as versioning from '../../versioning/docker'; import { JenkinsPluginsDatasource } from '.'; -const jenkinsPluginsVersions = loadJsonFixture('plugin-versions.json'); -const jenkinsPluginsInfo = loadJsonFixture('update-center.actual.json'); +const jenkinsPluginsVersions = Fixtures?.getJson('plugin-versions.json'); +const jenkinsPluginsInfo = Fixtures?.getJson('update-center.actual.json'); describe('modules/datasource/jenkins-plugins/index', () => { describe('getReleases', () => { @@ -46,18 +46,18 @@ describe('modules/datasource/jenkins-plugins/index', () => { .reply(200, jenkinsPluginsVersions); const res = await getPkgReleases(params); - expect(res.releases).toHaveLength(75); + expect(res?.releases).toHaveLength(75); expect(res).toMatchSnapshot(); - expect(res.sourceUrl).toBe( + expect(res?.sourceUrl).toBe( 'https://github.com/jenkinsci/email-ext-plugin' ); expect( - res.releases.find((release) => release.version === '2.69') + res?.releases.find((release) => release.version === '2.69') ).toBeDefined(); expect( - res.releases.find((release) => release.version === '12.98') + res?.releases.find((release) => release.version === '12.98') ).toBeUndefined(); }); @@ -73,10 +73,10 @@ describe('modules/datasource/jenkins-plugins/index', () => { .reply(200, '{}'); const res = await getPkgReleases(params); - expect(res.releases).toBeEmpty(); + expect(res?.releases).toBeEmpty(); expect(res).toMatchSnapshot(); - expect(res.sourceUrl).toBe( + expect(res?.sourceUrl).toBe( 'https://github.com/jenkinsci/email-ext-plugin' ); }); diff --git a/lib/modules/datasource/maven/index.spec.ts b/lib/modules/datasource/maven/index.spec.ts index a20255759fb33f..00b5c40321af4f 100644 --- a/lib/modules/datasource/maven/index.spec.ts +++ b/lib/modules/datasource/maven/index.spec.ts @@ -1,6 +1,6 @@ import { ReleaseResult, getPkgReleases } from '..'; +import { Fixtures } from '../../../../test/fixtures'; import * as httpMock from '../../../../test/http-mock'; -import { loadFixture } from '../../../../test/util'; import { EXTERNAL_HOST_ERROR } from '../../../constants/error-messages'; import * as hostRules from '../../../util/host-rules'; import { id as versioning } from '../../versioning/maven'; @@ -25,7 +25,7 @@ interface MockOpts { latest?: string; jars?: Record | null; snapshots?: SnapshotOpts[] | null; - html?: string; + html?: string | null; } function mockGenericPackage(opts: MockOpts = {}) { @@ -36,8 +36,8 @@ function mockGenericPackage(opts: MockOpts = {}) { html, } = opts; const meta = - opts.meta === undefined ? loadFixture('metadata.xml') : opts.meta; - const pom = opts.pom === undefined ? loadFixture('pom.xml') : opts.pom; + opts.meta === undefined ? Fixtures.get('metadata.xml') : opts.meta; + const pom = opts.pom === undefined ? Fixtures.get('pom.xml') : opts.pom; const jars = opts.jars === undefined ? { @@ -54,12 +54,12 @@ function mockGenericPackage(opts: MockOpts = {}) { ? [ { version: '1.0.3-SNAPSHOT', - meta: loadFixture('metadata-snapshot-version.xml'), + meta: Fixtures.get('metadata-snapshot-version.xml'), jarStatus: 200, }, { version: '1.0.4-SNAPSHOT', - meta: loadFixture('metadata-snapshot-version-invalid.xml'), + meta: Fixtures.get('metadata-snapshot-version-invalid.xml'), }, { version: '1.0.5-SNAPSHOT', @@ -206,9 +206,9 @@ describe('modules/datasource/maven/index', () => { }); it('returns releases when only snapshot', async () => { - const meta = loadFixture('metadata-snapshot-version.xml'); + const meta = Fixtures.get('metadata-snapshot-version.xml'); mockGenericPackage({ - meta: loadFixture('metadata-snapshot-only.xml'), + meta: Fixtures.get('metadata-snapshot-only.xml'), jars: null, html: null, latest: '1.0.3-SNAPSHOT', @@ -248,8 +248,8 @@ describe('modules/datasource/maven/index', () => { mockGenericPackage({ latest: '2.0.0', jars: null, - html: loadFixture('index.html'), - meta: loadFixture('index.xml'), + html: Fixtures.get('index.html'), + meta: Fixtures.get('index.xml'), snapshots: null, }); @@ -282,19 +282,15 @@ describe('modules/datasource/maven/index', () => { mockGenericPackage({ html: null }); mockGenericPackage({ base: baseUrlCustom, - meta: loadFixture('metadata-extra.xml'), + meta: Fixtures.get('metadata-extra.xml'), latest: '3.0.0', jars: { '3.0.0': 200 }, snapshots: [], }); - const { releases } = await get( - 'org.example:package', - baseUrl, - baseUrlCustom - ); + const res = await get('org.example:package', baseUrl, baseUrlCustom); - expect(releases).toMatchObject([ + expect(res?.releases).toMatchObject([ { version: '0.0.1' }, { version: '1.0.0' }, { version: '1.0.3-SNAPSHOT' }, @@ -308,11 +304,11 @@ describe('modules/datasource/maven/index', () => { httpMock .scope('https://failed_repo') .get('/org/example/package/maven-metadata.xml') - .reply(404, null); + .reply(404); httpMock .scope('https://unauthorized_repo') .get('/org/example/package/maven-metadata.xml') - .reply(403, null); + .reply(403); httpMock .scope('https://empty_repo') .get('/org/example/package/maven-metadata.xml') @@ -347,13 +343,13 @@ describe('modules/datasource/maven/index', () => { const base = baseUrl.replace('https', 'http'); mockGenericPackage({ base }); - const { releases } = await get( + const res = await get( 'org.example:package', 'ftp://protocol_error_repo', base ); - expect(releases).toMatchSnapshot(); + expect(res?.releases).toMatchSnapshot(); }); it('skips registry with invalid metadata structure', async () => { @@ -361,7 +357,7 @@ describe('modules/datasource/maven/index', () => { httpMock .scope('https://invalid_metadata_repo') .get('/org/example/package/maven-metadata.xml') - .reply(200, loadFixture('metadata-invalid.xml')); + .reply(200, Fixtures.get('metadata-invalid.xml')); const res = await get( 'org.example:package', @@ -395,7 +391,7 @@ describe('modules/datasource/maven/index', () => { const resB = await get('org.example:package', baseUrl.replace(/\/*$/, '/')); expect(resA).not.toBeNull(); expect(resB).not.toBeNull(); - expect(resA.releases).toEqual(resB.releases); + expect(resA?.releases).toEqual(resB?.releases); }); it('returns null for invalid registryUrls', async () => { @@ -408,12 +404,12 @@ describe('modules/datasource/maven/index', () => { }); it('supports scm.url values prefixed with "scm:"', async () => { - const pom = loadFixture('pom.scm-prefix.xml'); + const pom = Fixtures.get('pom.scm-prefix.xml'); mockGenericPackage({ pom, html: null }); - const { sourceUrl } = await get(); + const res = await get(); - expect(sourceUrl).toBe('https://github.com/example/test'); + expect(res?.sourceUrl).toBe('https://github.com/example/test'); }); it('removes authentication header after redirect', async () => { @@ -449,9 +445,9 @@ describe('modules/datasource/maven/index', () => { httpMock .scope(backendUrl, { badheaders: ['authorization'] }) .get(`${metadataPath}${queryStr}`) - .reply(200, loadFixture('metadata.xml')) + .reply(200, Fixtures.get('metadata.xml')) .get(`${pomfilePath}${queryStr}`) - .reply(200, loadFixture('pom.xml')); + .reply(200, Fixtures.get('pom.xml')); const res = await get('org.example:package', frontendUrl); @@ -462,7 +458,7 @@ describe('modules/datasource/maven/index', () => { const parentPackage = { dep: 'org.example:parent', meta: null, - pom: loadFixture('parent-scm-homepage/pom.xml'), + pom: Fixtures.get('parent-scm-homepage/pom.xml'), latest: '1.0.0', jars: null, snapshots: [], @@ -470,8 +466,8 @@ describe('modules/datasource/maven/index', () => { it('should get source and homepage from parent', async () => { mockGenericPackage({ - meta: loadFixture('child-no-info/meta.xml'), - pom: loadFixture('child-no-info/pom.xml'), + meta: Fixtures.get('child-no-info/meta.xml'), + pom: Fixtures.get('child-no-info/pom.xml'), latest: '2.0.0', jars: { '2.0.0': 200 }, snapshots: [], @@ -489,8 +485,8 @@ describe('modules/datasource/maven/index', () => { it('should deal with missing parent fields', async () => { mockGenericPackage({ - meta: loadFixture('child-empty/meta.xml'), - pom: loadFixture('child-empty/pom.xml'), + meta: Fixtures.get('child-empty/meta.xml'), + pom: Fixtures.get('child-empty/pom.xml'), latest: '2.0.0', jars: { '2.0.0': 200 }, snapshots: [], @@ -509,7 +505,7 @@ describe('modules/datasource/maven/index', () => { }); it('should deal with circular hierarchy', async () => { - const parentPom = loadFixture('child-parent-cycle/parent.pom.xml'); + const parentPom = Fixtures.get('child-parent-cycle/parent.pom.xml'); const parentPomMock = { dep: 'org.example:parent', meta: null, @@ -519,8 +515,8 @@ describe('modules/datasource/maven/index', () => { snapshots: [], }; - const childMeta = loadFixture('child-parent-cycle/child.meta.xml'); - const childPom = loadFixture('child-parent-cycle/child.pom.xml'); + const childMeta = Fixtures.get('child-parent-cycle/child.meta.xml'); + const childPom = Fixtures.get('child-parent-cycle/child.pom.xml'); const childPomMock = { dep: 'org.example:child', meta: null, @@ -552,8 +548,8 @@ describe('modules/datasource/maven/index', () => { it('should get source from own pom and homepage from parent', async () => { mockGenericPackage({ - meta: loadFixture('child-scm/meta.xml'), - pom: loadFixture('child-scm/pom.xml'), + meta: Fixtures.get('child-scm/meta.xml'), + pom: Fixtures.get('child-scm/pom.xml'), latest: '2.0.0', jars: { '2.0.0': 200 }, snapshots: [], @@ -571,8 +567,8 @@ describe('modules/datasource/maven/index', () => { it('should get homepage from own pom and source from parent', async () => { mockGenericPackage({ - meta: loadFixture('child-url/meta.xml'), - pom: loadFixture('child-url/pom.xml'), + meta: Fixtures.get('child-url/meta.xml'), + pom: Fixtures.get('child-url/pom.xml'), latest: '2.0.0', jars: { '2.0.0': 200 }, snapshots: [], @@ -590,8 +586,8 @@ describe('modules/datasource/maven/index', () => { it('should get homepage and source from own pom', async () => { mockGenericPackage({ - meta: loadFixture('child-all-info/meta.xml'), - pom: loadFixture('child-all-info/pom.xml'), + meta: Fixtures.get('child-all-info/meta.xml'), + pom: Fixtures.get('child-all-info/pom.xml'), latest: '2.0.0', jars: { '2.0.0': 200 }, snapshots: [], @@ -608,8 +604,8 @@ describe('modules/datasource/maven/index', () => { it('should be able to detect git@github.com:child-scm as valid sourceUrl', async () => { mockGenericPackage({ - meta: loadFixture('child-scm-gitatcolon/meta.xml'), - pom: loadFixture('child-scm-gitatcolon/pom.xml'), + meta: Fixtures.get('child-scm-gitatcolon/meta.xml'), + pom: Fixtures.get('child-scm-gitatcolon/pom.xml'), latest: '2.0.0', jars: { '2.0.0': 200 }, snapshots: [], @@ -625,8 +621,8 @@ describe('modules/datasource/maven/index', () => { it('should be able to detect git@github.com/child-scm as valid sourceUrl', async () => { mockGenericPackage({ - meta: loadFixture('child-scm-gitatslash/meta.xml'), - pom: loadFixture('child-scm-gitatslash/pom.xml'), + meta: Fixtures.get('child-scm-gitatslash/meta.xml'), + pom: Fixtures.get('child-scm-gitatslash/pom.xml'), latest: '2.0.0', jars: { '2.0.0': 200 }, snapshots: [], @@ -642,8 +638,8 @@ describe('modules/datasource/maven/index', () => { it('should be able to detect git://@github.com/child-scm as valid sourceUrl', async () => { mockGenericPackage({ - meta: loadFixture('child-scm-gitprotocol/meta.xml'), - pom: loadFixture('child-scm-gitprotocol/pom.xml'), + meta: Fixtures.get('child-scm-gitprotocol/meta.xml'), + pom: Fixtures.get('child-scm-gitprotocol/pom.xml'), latest: '2.0.0', jars: { '2.0.0': 200 }, snapshots: [], diff --git a/lib/modules/datasource/maven/util.spec.ts b/lib/modules/datasource/maven/util.spec.ts index db90e0c21596ef..6cd18f78b485fa 100644 --- a/lib/modules/datasource/maven/util.spec.ts +++ b/lib/modules/datasource/maven/util.spec.ts @@ -10,40 +10,51 @@ describe('modules/datasource/maven/util', () => { describe('downloadMavenXml', () => { it('returns empty object for unsupported protocols', async () => { const res = await downloadMavenXml( - null, + null as never, // #7154 parseUrl('unsupported://server.com/') ); expect(res).toEqual({}); }); it('returns empty object for invalid URLs', async () => { - const res = await downloadMavenXml(null, null); + const res = await downloadMavenXml( + null as never, // #7154 + null + ); expect(res).toEqual({}); }); }); describe('downloadS3Protocol', () => { it('returns null for non-S3 URLs', async () => { - const res = await downloadS3Protocol(parseUrl('http://not-s3.com/')); + // #7154 + const res = await downloadS3Protocol(parseUrl('http://not-s3.com/')!); expect(res).toBeNull(); }); }); describe('checkResource', () => { it('returns not found for unsupported protocols', async () => { - const res = await checkResource(null, 'unsupported://server.com/'); + const res = await checkResource( + null as never, // #7154 + 'unsupported://server.com/' + ); expect(res).toBe('not-found'); }); it('returns error for invalid URLs', async () => { - const res = await checkResource(null, 'not-a-valid-url'); + const res = await checkResource( + null as never, // #7154 + 'not-a-valid-url' + ); expect(res).toBe('error'); }); }); describe('checkS3Resource', () => { it('returns error for non-S3 URLs', async () => { - const res = await checkS3Resource(parseUrl('http://not-s3.com/')); + // #7154 + const res = await checkS3Resource(parseUrl('http://not-s3.com/')!); expect(res).toBe('error'); }); }); diff --git a/lib/modules/datasource/node/index.spec.ts b/lib/modules/datasource/node/index.spec.ts index 4f0d1c92abc6ba..234b60e39a8db0 100644 --- a/lib/modules/datasource/node/index.spec.ts +++ b/lib/modules/datasource/node/index.spec.ts @@ -49,7 +49,7 @@ describe('modules/datasource/node/index', () => { depName: 'node', }); expect(res).toMatchSnapshot(); - expect(res.releases).toHaveLength(64); + expect(res?.releases).toHaveLength(64); }); }); }); diff --git a/lib/modules/datasource/npm/get.spec.ts b/lib/modules/datasource/npm/get.spec.ts index 375923b0152760..15c57debbd94d1 100644 --- a/lib/modules/datasource/npm/get.spec.ts +++ b/lib/modules/datasource/npm/get.spec.ts @@ -219,7 +219,8 @@ describe('modules/datasource/npm/get', () => { registryUrl = resolveRegistryUrl('error-404'); expect(await getDependency(http, registryUrl, 'error-404')).toBeNull(); - httpMock.scope('https://test.org').get('/error4').reply(200, null); + // return invalid json to get coverage + httpMock.scope('https://test.org').get('/error4').reply(200, '{'); registryUrl = resolveRegistryUrl('error4'); expect(await getDependency(http, registryUrl, 'error4')).toBeNull(); @@ -260,8 +261,8 @@ describe('modules/datasource/npm/get', () => { const registryUrl = resolveRegistryUrl('@neutrinojs/react'); const dep = await getDependency(http, registryUrl, '@neutrinojs/react'); - expect(dep.sourceUrl).toBe('https://github.com/neutrinojs/neutrino'); - expect(dep.sourceDirectory).toBe('packages/react'); + expect(dep?.sourceUrl).toBe('https://github.com/neutrinojs/neutrino'); + expect(dep?.sourceDirectory).toBe('packages/react'); expect(httpMock.getTrace()).toMatchInlineSnapshot(` Array [ @@ -297,8 +298,8 @@ describe('modules/datasource/npm/get', () => { const registryUrl = resolveRegistryUrl('@neutrinojs/react'); const dep = await getDependency(http, registryUrl, '@neutrinojs/react'); - expect(dep.sourceUrl).toBe('https://github.com/neutrinojs/neutrino'); - expect(dep.sourceDirectory).toBe('packages/react'); + expect(dep?.sourceUrl).toBe('https://github.com/neutrinojs/neutrino'); + expect(dep?.sourceDirectory).toBe('packages/react'); }); it('handles mixed sourceUrls in releases', async () => { @@ -332,9 +333,9 @@ describe('modules/datasource/npm/get', () => { const registryUrl = resolveRegistryUrl('vue'); const dep = await getDependency(http, registryUrl, 'vue'); - expect(dep.sourceUrl).toBe('https://github.com/vuejs/vue.git'); - expect(dep.releases[0].sourceUrl).toBeUndefined(); - expect(dep.releases[1].sourceUrl).toBe( + expect(dep?.sourceUrl).toBe('https://github.com/vuejs/vue.git'); + expect(dep?.releases[0].sourceUrl).toBeUndefined(); + expect(dep?.releases[1].sourceUrl).toBe( 'https://github.com/vuejs/vue-next.git' ); }); @@ -358,8 +359,8 @@ describe('modules/datasource/npm/get', () => { const registryUrl = resolveRegistryUrl('@neutrinojs/react'); const dep = await getDependency(http, registryUrl, '@neutrinojs/react'); - expect(dep.sourceUrl).toBe('https://github.com/neutrinojs/neutrino'); - expect(dep.sourceDirectory).toBe('packages/foo'); + expect(dep?.sourceUrl).toBe('https://github.com/neutrinojs/neutrino'); + expect(dep?.sourceDirectory).toBe('packages/foo'); expect(httpMock.getTrace()).toMatchInlineSnapshot(` Array [ @@ -396,10 +397,10 @@ describe('modules/datasource/npm/get', () => { const registryUrl = resolveRegistryUrl('@neutrinojs/react'); const dep = await getDependency(http, registryUrl, '@neutrinojs/react'); - expect(dep.sourceUrl).toBe( + expect(dep?.sourceUrl).toBe( 'https://bitbucket.org/neutrinojs/neutrino/tree/master/packages/react' ); - expect(dep.sourceDirectory).toBeUndefined(); + expect(dep?.sourceDirectory).toBeUndefined(); expect(httpMock.getTrace()).toMatchInlineSnapshot(` Array [ diff --git a/lib/modules/datasource/npm/index.spec.ts b/lib/modules/datasource/npm/index.spec.ts index 5377d8d78a6439..45698bb03d53a8 100644 --- a/lib/modules/datasource/npm/index.spec.ts +++ b/lib/modules/datasource/npm/index.spec.ts @@ -92,7 +92,7 @@ describe('modules/datasource/npm/index', () => { httpMock.scope('https://registry.npmjs.org').get('/foobar').reply(200, pkg); const res = await getPkgReleases({ datasource, depName: 'foobar' }); expect(res).toMatchSnapshot(); - expect(res.sourceUrl).toBeDefined(); + expect(res?.sourceUrl).toBeDefined(); }); it('should parse repo url (string)', async () => { @@ -113,7 +113,7 @@ describe('modules/datasource/npm/index', () => { httpMock.scope('https://registry.npmjs.org').get('/foobar').reply(200, pkg); const res = await getPkgReleases({ datasource, depName: 'foobar' }); expect(res).toMatchSnapshot(); - expect(res.sourceUrl).toBeDefined(); + expect(res?.sourceUrl).toBeDefined(); }); it('should return deprecated', async () => { @@ -146,7 +146,7 @@ describe('modules/datasource/npm/index', () => { .reply(200, deprecatedPackage); const res = await getPkgReleases({ datasource, depName: 'foobar' }); expect(res).toMatchSnapshot(); - expect(res.deprecationMessage).toMatchSnapshot(); + expect(res?.deprecationMessage).toMatchSnapshot(); }); it('should handle foobar', async () => { diff --git a/lib/modules/datasource/repology/index.spec.ts b/lib/modules/datasource/repology/index.spec.ts index 3a216789b861a0..5547fa9fb321a4 100644 --- a/lib/modules/datasource/repology/index.spec.ts +++ b/lib/modules/datasource/repology/index.spec.ts @@ -1,6 +1,6 @@ import { getPkgReleases } from '..'; +import { Fixtures } from '../../../../test/fixtures'; import * as httpMock from '../../../../test/http-mock'; -import { loadFixture } from '../../../../test/util'; import { EXTERNAL_HOST_ERROR } from '../../../constants/error-messages'; import { id as versioning } from '../../versioning/loose'; import type { RepologyPackage } from './types'; @@ -48,12 +48,12 @@ const mockResolverCall = ( } }; -const fixtureNginx = loadFixture(`nginx.json`); -const fixtureGccDefaults = loadFixture(`gcc-defaults.json`); -const fixtureGcc = loadFixture(`gcc.json`); -const fixturePulseaudio = loadFixture(`pulseaudio.json`); -const fixtureJdk = loadFixture(`openjdk.json`); -const fixturePython = loadFixture(`python.json`); +const fixtureNginx = Fixtures?.get(`nginx.json`); +const fixtureGccDefaults = Fixtures?.get(`gcc-defaults.json`); +const fixtureGcc = Fixtures?.get(`gcc.json`); +const fixturePulseaudio = Fixtures?.get(`pulseaudio.json`); +const fixtureJdk = Fixtures?.get(`openjdk.json`); +const fixturePython = Fixtures?.get(`python.json`); describe('modules/datasource/repology/index', () => { describe('getReleases', () => { @@ -214,8 +214,8 @@ describe('modules/datasource/repology/index', () => { depName: 'debian_stable/nginx', }); expect(res).toMatchSnapshot(); - expect(res.releases).toHaveLength(1); - expect(res.releases[0].version).toBe('1.14.2-2+deb10u1'); + expect(res?.releases).toHaveLength(1); + expect(res?.releases[0].version).toBe('1.14.2-2+deb10u1'); }); it('returns correct version for source package', async () => { @@ -233,8 +233,8 @@ describe('modules/datasource/repology/index', () => { depName: 'debian_stable/gcc-defaults', }); expect(res).toMatchSnapshot(); - expect(res.releases).toHaveLength(1); - expect(res.releases[0].version).toBe('1.181'); + expect(res?.releases).toHaveLength(1); + expect(res?.releases[0].version).toBe('1.181'); }); it('returns correct version for api package', async () => { @@ -249,8 +249,8 @@ describe('modules/datasource/repology/index', () => { depName: 'debian_stable/gcc-defaults', }); expect(res).toMatchSnapshot(); - expect(res.releases).toHaveLength(1); - expect(res.releases[0].version).toBe('1.181'); + expect(res?.releases).toHaveLength(1); + expect(res?.releases[0].version).toBe('1.181'); }); it('returns correct version for multi-package project with same name', async () => { @@ -265,8 +265,8 @@ describe('modules/datasource/repology/index', () => { depName: 'alpine_3_12/gcc', }); expect(res).toMatchSnapshot(); - expect(res.releases).toHaveLength(1); - expect(res.releases[0].version).toBe('9.3.0-r2'); + expect(res?.releases).toHaveLength(1); + expect(res?.releases[0].version).toBe('9.3.0-r2'); }); it('returns correct version for multi-package project with different name', async () => { @@ -281,8 +281,8 @@ describe('modules/datasource/repology/index', () => { depName: 'debian_stable/pulseaudio-utils', }); expect(res).toMatchSnapshot(); - expect(res.releases).toHaveLength(1); - expect(res.releases[0].version).toBe('12.2-4+deb10u1'); + expect(res?.releases).toHaveLength(1); + expect(res?.releases[0].version).toBe('12.2-4+deb10u1'); }); it('returns multiple versions if they are present in repository', async () => { @@ -300,9 +300,9 @@ describe('modules/datasource/repology/index', () => { depName: 'centos_8/java-11-openjdk', }); expect(res).toMatchSnapshot(); - expect(res.releases).toHaveLength(6); - expect(res.releases[0].version).toBe('1:11.0.7.10-1.el8_1'); - expect(res.releases[5].version).toBe('1:11.0.9.11-3.el8_3'); + expect(res?.releases).toHaveLength(6); + expect(res?.releases[0].version).toBe('1:11.0.7.10-1.el8_1'); + expect(res?.releases[5].version).toBe('1:11.0.9.11-3.el8_3'); }); it('returns null for scenario when repo is not in package results', async () => { diff --git a/lib/modules/datasource/rubygems/index.spec.ts b/lib/modules/datasource/rubygems/index.spec.ts index ad41ab55803048..e93b86154243c4 100644 --- a/lib/modules/datasource/rubygems/index.spec.ts +++ b/lib/modules/datasource/rubygems/index.spec.ts @@ -1,18 +1,14 @@ import { getPkgReleases } from '..'; +import { Fixtures } from '../../../../test/fixtures'; import * as httpMock from '../../../../test/http-mock'; -import { - loadBinaryFixture, - loadFixture, - loadJsonFixture, -} from '../../../../test/util'; import * as rubyVersioning from '../../versioning/ruby'; import { resetCache } from './get-rubygems-org'; import { RubyGemsDatasource } from '.'; -const rubygemsOrgVersions = loadFixture('rubygems-org.txt'); -const railsInfo = loadJsonFixture('rails/info.json'); -const railsVersions = loadJsonFixture('rails/versions.json'); -const railsDependencies = loadBinaryFixture('dependencies-rails.dat'); +const rubygemsOrgVersions = Fixtures?.get('rubygems-org.txt'); +const railsInfo = Fixtures?.getJson('rails/info.json'); +const railsVersions = Fixtures?.getJson('rails/versions.json'); +const railsDependencies = Fixtures?.getBinary('dependencies-rails.dat'); const emptyMarshalArray = Buffer.from([4, 8, 91, 0]); describe('modules/datasource/rubygems/index', () => { @@ -43,11 +39,11 @@ describe('modules/datasource/rubygems/index', () => { httpMock .scope('https://firstparty.com') .get('/basepath/api/v1/gems/rails.json') - .reply(200, null); + .reply(200); httpMock .scope('https://thirdparty.com') .get('/api/v1/gems/rails.json') - .reply(200, null); + .reply(200); expect(await getPkgReleases(params)).toBeNull(); }); @@ -74,13 +70,13 @@ describe('modules/datasource/rubygems/index', () => { .reply(200, rubygemsOrgVersions); const res = await getPkgReleases(newparams); expect(res).not.toBeNull(); - expect(res.releases).toHaveLength(2); + expect(res?.releases).toHaveLength(2); expect(res).toMatchSnapshot(); expect( - res.releases.find((release) => release.version === '0.1.1') + res?.releases.find((release) => release.version === '0.1.1') ).toBeDefined(); expect( - res.releases.find((release) => release.version === '0.1.2') + res?.releases.find((release) => release.version === '0.1.2') ).toBeUndefined(); }); @@ -103,7 +99,7 @@ describe('modules/datasource/rubygems/index', () => { registryUrls: [], }); expect(res).not.toBeNull(); - expect(res.releases).toHaveLength(2); + expect(res?.releases).toHaveLength(2); expect(res).toMatchSnapshot(); }); @@ -116,7 +112,7 @@ describe('modules/datasource/rubygems/index', () => { .reply(200, railsVersions); const res = await getPkgReleases(params); - expect(res.releases).toHaveLength(339); + expect(res?.releases).toHaveLength(339); expect(res).toMatchSnapshot(); }); @@ -133,7 +129,7 @@ describe('modules/datasource/rubygems/index', () => { .reply(200, railsVersions); const res = await getPkgReleases(params); - expect(res.releases).toHaveLength(339); + expect(res?.releases).toHaveLength(339); expect(res).toMatchSnapshot(); }); @@ -145,7 +141,7 @@ describe('modules/datasource/rubygems/index', () => { httpMock .scope('https://firstparty.com/') .get('/basepath/api/v1/gems/rails.json') - .reply(200, null); + .reply(200); expect(await getPkgReleases(params)).toBeNull(); }); @@ -157,8 +153,8 @@ describe('modules/datasource/rubygems/index', () => { .get('/api/v1/versions/rails.json') .reply(400, {}); const res = await getPkgReleases(params); - expect(res.releases).toHaveLength(1); - expect(res.releases[0].version).toBe(railsInfo.version); + expect(res?.releases).toHaveLength(1); + expect(res?.releases[0].version).toBe(railsInfo.version); }); it('errors when version request fails with anything other than 400 or 404', async () => { @@ -205,7 +201,7 @@ describe('modules/datasource/rubygems/index', () => { .get('/api/v1/dependencies?gems=rails') .reply(200, railsDependencies); const res = await getPkgReleases(newparams); - expect(res.releases).toHaveLength(339); + expect(res?.releases).toHaveLength(339); expect(res).toMatchSnapshot(); }); }); diff --git a/lib/modules/datasource/sbt-package/index.spec.ts b/lib/modules/datasource/sbt-package/index.spec.ts index 271be15ee1d0b2..b85e70b1d2016d 100644 --- a/lib/modules/datasource/sbt-package/index.spec.ts +++ b/lib/modules/datasource/sbt-package/index.spec.ts @@ -22,7 +22,7 @@ describe('modules/datasource/sbt-package/index', () => { httpMock .scope('https://failed_repo') .get('/maven/org/scalatest/') - .reply(404, null); + .reply(404); httpMock .scope('https://repo.maven.apache.org') .get('/maven2/com/example/') diff --git a/lib/modules/datasource/sbt-plugin/index.spec.ts b/lib/modules/datasource/sbt-plugin/index.spec.ts index 1d70d672d2751a..99260993895ccd 100644 --- a/lib/modules/datasource/sbt-plugin/index.spec.ts +++ b/lib/modules/datasource/sbt-plugin/index.spec.ts @@ -1,13 +1,13 @@ import { getPkgReleases } from '..'; +import { Fixtures } from '../../../../test/fixtures'; import * as httpMock from '../../../../test/http-mock'; -import { loadFixture } from '../../../../test/util'; import * as mavenVersioning from '../../versioning/maven'; import { MAVEN_REPO } from '../maven/common'; import { parseIndexDir } from '../sbt-package/util'; import { SbtPluginDatasource } from '.'; -const mavenIndexHtml = loadFixture(`maven-index.html`); -const sbtPluginIndex = loadFixture(`sbt-plugins-index.html`); +const mavenIndexHtml = Fixtures.get(`maven-index.html`); +const sbtPluginIndex = Fixtures.get(`sbt-plugins-index.html`); describe('modules/datasource/sbt-plugin/index', () => { it('parses Maven index directory', () => { @@ -23,7 +23,7 @@ describe('modules/datasource/sbt-plugin/index', () => { httpMock .scope('https://failed_repo') .get('/maven/org/scalatest/') - .reply(404, null); + .reply(404); httpMock .scope('https://repo.maven.apache.org') .get('/maven2/org/scalatest/') diff --git a/lib/util/modules.ts b/lib/util/modules.ts index 2f2776c1d67978..e0bc3596cc0bf4 100644 --- a/lib/util/modules.ts +++ b/lib/util/modules.ts @@ -27,7 +27,7 @@ function relatePath(here: string, there: string): string { export function loadModules( dirname: string, - validate?: (module: T, moduleName?: string) => boolean, + validate?: (module: T, moduleName: string) => boolean, filter: (moduleName: string) => boolean = () => true ): Record { const result: Record = {}; From f7454a0f6be0696ed990b58f618525135d7f4fa0 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Mon, 20 Jun 2022 13:20:14 +0200 Subject: [PATCH 146/240] docs: no `toDeepEqual` on jest v28 (#16152) --- docs/development/best-practices.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/development/best-practices.md b/docs/development/best-practices.md index d5f5327aecacb6..fb72949dedf83f 100644 --- a/docs/development/best-practices.md +++ b/docs/development/best-practices.md @@ -130,7 +130,7 @@ Use `UTC` to be time zone independent. - For `Luxon` mocking see [Example](https://github.com/renovatebot/renovate/blob/5043379847818ac1fa71ff69c098451975e95710/lib/modules/versioning/distro.spec.ts#L7-L10) - Prefer `jest.spyOn` for mocking single functions, or mock entire modules - Avoid overwriting functions, for example: (`func = jest.fn();`) -- Prefer `toEqual` or `toDeepEqual` +- Prefer `toEqual` - Use `toMatchObject` for huge objects when only parts need to be tested - Avoid `toMatchSnapshot`, only use it for: - huge strings like the Renovate PR body text From 69e3f5117ee9c12763ad07853bfa75cf446dc2a7 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Mon, 20 Jun 2022 14:52:22 +0200 Subject: [PATCH 147/240] fix: use re2 (#16044) --- lib/modules/platform/utils/pr-body.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/modules/platform/utils/pr-body.ts b/lib/modules/platform/utils/pr-body.ts index c3647402ae218d..a64c78bfc7ca05 100644 --- a/lib/modules/platform/utils/pr-body.ts +++ b/lib/modules/platform/utils/pr-body.ts @@ -1,4 +1,6 @@ -const re = new RegExp( +import { regEx } from '../../../util/regex'; + +const re = regEx( `(?.*### Release Notes)(?.*)### Configuration(?.*)`, 's' ); From 93dd94057485123eed71b8aeae221b767d7ce012 Mon Sep 17 00:00:00 2001 From: RahulGautamSingh Date: Mon, 20 Jun 2022 19:54:37 +0530 Subject: [PATCH 148/240] refactor(modules/datasource): fix null-check issues (#16153) * fix null-check issues * Update index.spec.ts * apply suggestion from review * fix coverage issue * Update index.spec.ts * Apply suggestions from code review Co-authored-by: Michael Kriese * Update datasource.spec.ts * Update lib/modules/datasource/conan/index.spec.ts Co-authored-by: Michael Kriese * Update datasource.spec.ts * fix null-check issue Co-authored-by: Michael Kriese --- .../datasource/bitbucket-tags/index.spec.ts | 2 +- lib/modules/datasource/cdnjs/index.spec.ts | 2 +- lib/modules/datasource/clojure/index.spec.ts | 16 ++-- lib/modules/datasource/conan/index.spec.ts | 2 +- lib/modules/datasource/crate/index.spec.ts | 4 +- lib/modules/datasource/dart/index.spec.ts | 2 +- lib/modules/datasource/datasource.spec.ts | 11 +-- .../datasource/flutter-version/index.spec.ts | 2 +- .../galaxy-collection/index.spec.ts | 6 +- lib/modules/datasource/git-refs/index.spec.ts | 8 +- lib/modules/datasource/git-tags/index.spec.ts | 2 +- .../github-releases/cache/cache-base.spec.ts | 2 +- .../datasource/github-releases/common.spec.ts | 2 +- .../datasource/github-releases/digest.spec.ts | 8 +- .../datasource/github-tags/index.spec.ts | 6 +- .../datasource/gitlab-packages/index.spec.ts | 2 +- .../datasource/gitlab-releases/index.spec.ts | 4 +- .../datasource/gitlab-tags/index.spec.ts | 9 +- .../datasource/go/releases-direct.spec.ts | 10 +-- .../datasource/go/releases-goproxy.spec.ts | 88 +++++++++---------- tsconfig.strict.json | 1 - 21 files changed, 94 insertions(+), 95 deletions(-) diff --git a/lib/modules/datasource/bitbucket-tags/index.spec.ts b/lib/modules/datasource/bitbucket-tags/index.spec.ts index ade861718fb8a3..369f646c3cb170 100644 --- a/lib/modules/datasource/bitbucket-tags/index.spec.ts +++ b/lib/modules/datasource/bitbucket-tags/index.spec.ts @@ -35,7 +35,7 @@ describe('modules/datasource/bitbucket-tags/index', () => { depName: 'some/dep2', }); expect(res).toMatchSnapshot(); - expect(res.releases).toHaveLength(3); + expect(res?.releases).toHaveLength(3); }); }); diff --git a/lib/modules/datasource/cdnjs/index.spec.ts b/lib/modules/datasource/cdnjs/index.spec.ts index 84744a0080be5f..550b87d665224d 100644 --- a/lib/modules/datasource/cdnjs/index.spec.ts +++ b/lib/modules/datasource/cdnjs/index.spec.ts @@ -16,7 +16,7 @@ describe('modules/datasource/cdnjs/index', () => { }); it('throws for empty result', async () => { - httpMock.scope(baseUrl).get(pathFor('foo/bar')).reply(200, null); + httpMock.scope(baseUrl).get(pathFor('foo/bar')).reply(200, '}'); await expect( getPkgReleases({ datasource: CdnJsDatasource.id, diff --git a/lib/modules/datasource/clojure/index.spec.ts b/lib/modules/datasource/clojure/index.spec.ts index a7377e4de67bb4..5fbaf52f888ae9 100644 --- a/lib/modules/datasource/clojure/index.spec.ts +++ b/lib/modules/datasource/clojure/index.spec.ts @@ -184,11 +184,11 @@ describe('modules/datasource/clojure/index', () => { snapshots: [], }); - const { releases } = await get( + const { releases } = (await get( 'org.example:package', baseUrl, baseUrlCustom - ); + ))!; expect(releases).toMatchObject([ { version: '0.0.1' }, @@ -204,11 +204,11 @@ describe('modules/datasource/clojure/index', () => { httpMock .scope('https://failed_repo') .get('/org/example/package/maven-metadata.xml') - .reply(404, null); + .reply(404, '}'); httpMock .scope('https://unauthorized_repo') .get('/org/example/package/maven-metadata.xml') - .reply(403, null); + .reply(403, '}'); httpMock .scope('https://empty_repo') .get('/org/example/package/maven-metadata.xml') @@ -234,11 +234,11 @@ describe('modules/datasource/clojure/index', () => { const base = baseUrl.replace('https', 'http'); mockGenericPackage({ base }); - const { releases } = await get( + const { releases } = (await get( 'org.example:package', 'ftp://protocol_error_repo', base - ); + ))!; expect(releases).toMatchSnapshot(); }); @@ -285,7 +285,7 @@ describe('modules/datasource/clojure/index', () => { const resB = await get('org.example:package', baseUrl.replace(/\/*$/, '/')); expect(resA).not.toBeNull(); expect(resB).not.toBeNull(); - expect(resA.releases).toEqual(resB.releases); + expect(resA?.releases).toEqual(resB?.releases); }); it('returns null for invalid registryUrls', async () => { @@ -306,7 +306,7 @@ describe('modules/datasource/clojure/index', () => { .get('/maven2/org/example/package/maven-metadata.xml') .reply(200, '###'); - const { sourceUrl } = await get(); + const { sourceUrl } = (await get())!; expect(sourceUrl).toBe('https://github.com/example/test'); }); diff --git a/lib/modules/datasource/conan/index.spec.ts b/lib/modules/datasource/conan/index.spec.ts index c8f3802145378e..999cf62c99dd21 100644 --- a/lib/modules/datasource/conan/index.spec.ts +++ b/lib/modules/datasource/conan/index.spec.ts @@ -31,7 +31,7 @@ describe('modules/datasource/conan/index', () => { httpMock .scope(nonDefaultRegistryUrl) .get('/v2/conans/search?q=fakepackage') - .reply(200, null); + .reply(200); config.depName = 'fakepackage'; expect( await getPkgReleases({ diff --git a/lib/modules/datasource/crate/index.spec.ts b/lib/modules/datasource/crate/index.spec.ts index bbe2ac3910fc1f..9a376abdbbea2b 100644 --- a/lib/modules/datasource/crate/index.spec.ts +++ b/lib/modules/datasource/crate/index.spec.ts @@ -28,7 +28,7 @@ function setupGitMocks(delayMs?: number): { mockClone: jest.Mock } { .mockName('clone') .mockImplementation( async (_registryUrl: string, clonePath: string, _opts) => { - if (delayMs > 0) { + if (delayMs && delayMs > 0) { await delay(delayMs); } @@ -114,7 +114,7 @@ describe('modules/datasource/crate/index', () => { }); afterEach(async () => { - await tmpDir.cleanup(); + await tmpDir?.cleanup(); tmpDir = null; GlobalConfig.reset(); }); diff --git a/lib/modules/datasource/dart/index.spec.ts b/lib/modules/datasource/dart/index.spec.ts index 526618f03b71f8..2d433c747623bd 100644 --- a/lib/modules/datasource/dart/index.spec.ts +++ b/lib/modules/datasource/dart/index.spec.ts @@ -10,7 +10,7 @@ const baseUrl = 'https://pub.dartlang.org/api/packages/'; describe('modules/datasource/dart/index', () => { describe('getReleases', () => { it('returns null for empty result', async () => { - httpMock.scope(baseUrl).get('/non_sense').reply(200, null); + httpMock.scope(baseUrl).get('/non_sense').reply(200, '}'); expect( await getPkgReleases({ datasource: DartDatasource.id, diff --git a/lib/modules/datasource/datasource.spec.ts b/lib/modules/datasource/datasource.spec.ts index 242c725cc42b9f..e36bd37b2eb867 100644 --- a/lib/modules/datasource/datasource.spec.ts +++ b/lib/modules/datasource/datasource.spec.ts @@ -1,4 +1,5 @@ import * as httpMock from '../../../test/http-mock'; +import { partial } from '../../../test/util'; import { EXTERNAL_HOST_ERROR } from '../../constants/error-messages'; import { Datasource } from './datasource'; import type { GetReleasesConfig, ReleaseResult } from './types'; @@ -12,13 +13,13 @@ class TestDatasource extends Datasource { async getReleases( getReleasesConfig: GetReleasesConfig - ): Promise { + ): Promise { try { await this.http.get(exampleUrl); } catch (err) { this.handleGenericErrors(err); } - return Promise.resolve(undefined); + return Promise.resolve(null); } } @@ -28,8 +29,8 @@ describe('modules/datasource/datasource', () => { httpMock.scope(exampleUrl).get('/').reply(429); - await expect(testDatasource.getReleases(undefined)).rejects.toThrow( - EXTERNAL_HOST_ERROR - ); + await expect( + testDatasource.getReleases(partial({})) + ).rejects.toThrow(EXTERNAL_HOST_ERROR); }); }); diff --git a/lib/modules/datasource/flutter-version/index.spec.ts b/lib/modules/datasource/flutter-version/index.spec.ts index 7bc6a5d4e47c7b..bd217e16e04361 100644 --- a/lib/modules/datasource/flutter-version/index.spec.ts +++ b/lib/modules/datasource/flutter-version/index.spec.ts @@ -51,7 +51,7 @@ describe('modules/datasource/flutter-version/index', () => { depName, }); expect(res).toMatchSnapshot(); - expect(res.releases).toHaveLength(31); + expect(res?.releases).toHaveLength(31); }); }); }); diff --git a/lib/modules/datasource/galaxy-collection/index.spec.ts b/lib/modules/datasource/galaxy-collection/index.spec.ts index 05845c6e69e8b7..019ccaa90e54b8 100644 --- a/lib/modules/datasource/galaxy-collection/index.spec.ts +++ b/lib/modules/datasource/galaxy-collection/index.spec.ts @@ -108,7 +108,7 @@ describe('modules/datasource/galaxy-collection/index', () => { expect(res).toMatchSnapshot(); expect(res).not.toBeNull(); expect(res).toBeDefined(); - expect(res.releases).toHaveLength(2); + expect(res?.releases).toHaveLength(2); }); it('returns null for empty lookup', async () => { @@ -124,7 +124,7 @@ describe('modules/datasource/galaxy-collection/index', () => { expect( await getPkgReleases({ datasource, - depName: null, + depName: '', }) ).toBeNull(); }); @@ -162,7 +162,7 @@ describe('modules/datasource/galaxy-collection/index', () => { expect(res).toMatchSnapshot(); expect(res).not.toBeNull(); expect(res).toBeDefined(); - expect(res.releases).toHaveLength(3); + expect(res?.releases).toHaveLength(3); }); }); }); diff --git a/lib/modules/datasource/git-refs/index.spec.ts b/lib/modules/datasource/git-refs/index.spec.ts index 5524c9814bdb91..5c1f47ae5913f3 100644 --- a/lib/modules/datasource/git-refs/index.spec.ts +++ b/lib/modules/datasource/git-refs/index.spec.ts @@ -17,7 +17,7 @@ describe('modules/datasource/git-refs/index', () => { it('returns nil if response is wrong', async () => { simpleGit.mockReturnValue({ listRemote() { - return Promise.resolve(null) as Response; + return Promise.resolve('') as Response; }, }); const versions = await getPkgReleases({ @@ -33,10 +33,10 @@ describe('modules/datasource/git-refs/index', () => { return Promise.resolve('aabbccddeeff') as Response; }, }); - const { releases } = await getPkgReleases({ + const { releases } = (await getPkgReleases({ datasource, depName, - }); + }))!; expect(releases).toBeEmpty(); }); @@ -65,7 +65,7 @@ describe('modules/datasource/git-refs/index', () => { depName, }); expect(versions).toMatchSnapshot(); - const result = versions.releases.map((x) => x.version).sort(); + const result = versions?.releases.map((x) => x.version).sort(); expect(result).toHaveLength(6); }); }); diff --git a/lib/modules/datasource/git-tags/index.spec.ts b/lib/modules/datasource/git-tags/index.spec.ts index a9d45d400f3199..d47c6b12e9ed5a 100644 --- a/lib/modules/datasource/git-tags/index.spec.ts +++ b/lib/modules/datasource/git-tags/index.spec.ts @@ -18,7 +18,7 @@ describe('modules/datasource/git-tags/index', () => { it('returns nil if response is wrong', async () => { simpleGit.mockReturnValue({ listRemote() { - return Promise.resolve(null) as Response; + return Promise.resolve('') as Response; }, }); const versions = await getPkgReleases({ datasource, depName }); diff --git a/lib/modules/datasource/github-releases/cache/cache-base.spec.ts b/lib/modules/datasource/github-releases/cache/cache-base.spec.ts index bfb558cdc12926..3227499450ccb2 100644 --- a/lib/modules/datasource/github-releases/cache/cache-base.spec.ts +++ b/lib/modules/datasource/github-releases/cache/cache-base.spec.ts @@ -87,7 +87,7 @@ describe('modules/datasource/github-releases/cache/cache-base', () => { jest.resetAllMocks(); jest.spyOn(DateTime, 'now').mockReturnValue(now); httpPostJson.mockImplementation(() => { - const resp = responses.shift(); + const resp = responses.shift()!; return resp instanceof Error ? Promise.reject(resp) : Promise.resolve(resp); diff --git a/lib/modules/datasource/github-releases/common.spec.ts b/lib/modules/datasource/github-releases/common.spec.ts index ebcaffcbbf9bd9..a75e527a803b32 100644 --- a/lib/modules/datasource/github-releases/common.spec.ts +++ b/lib/modules/datasource/github-releases/common.spec.ts @@ -8,7 +8,7 @@ describe('modules/datasource/github-releases/common', () => { }); it('defaults to github.com', () => { - const sourceUrl = getSourceUrlBase(null); + const sourceUrl = getSourceUrlBase(undefined); expect(sourceUrl).toBe('https://github.com/'); }); }); diff --git a/lib/modules/datasource/github-releases/digest.spec.ts b/lib/modules/datasource/github-releases/digest.spec.ts index cd09db7a90d921..d370acc027dd3c 100644 --- a/lib/modules/datasource/github-releases/digest.spec.ts +++ b/lib/modules/datasource/github-releases/digest.spec.ts @@ -25,8 +25,8 @@ describe('modules/datasource/github-releases/digest', () => { release, 'test-digest' ); - expect(digestAsset.assetName).toBe('SHASUMS.txt'); - expect(digestAsset.digestedFileName).toBe('linux-amd64.tar.gz'); + expect(digestAsset?.assetName).toBe('SHASUMS.txt'); + expect(digestAsset?.digestedFileName).toBe('linux-amd64.tar.gz'); }); it('returns null when not found in digest file asset', async () => { @@ -61,8 +61,8 @@ describe('modules/datasource/github-releases/digest', () => { release, contentDigest ); - expect(digestAsset.assetName).toBe('asset.zip'); - expect(digestAsset.digestedFileName).toBeUndefined(); + expect(digestAsset?.assetName).toBe('asset.zip'); + expect(digestAsset?.digestedFileName).toBeUndefined(); }); it('returns null when no assets available', async () => { diff --git a/lib/modules/datasource/github-tags/index.spec.ts b/lib/modules/datasource/github-tags/index.spec.ts index e93874312132a2..e3f40cbb3e0d49 100644 --- a/lib/modules/datasource/github-tags/index.spec.ts +++ b/lib/modules/datasource/github-tags/index.spec.ts @@ -40,7 +40,7 @@ describe('modules/datasource/github-tags/index', () => { .get(`/repos/${packageName}/commits?per_page=1`) .reply(200, [{ sha: 'abcdef' }]); - const res = await github.getDigest({ packageName }, null); + const res = await github.getDigest({ packageName }, undefined); expect(res).toBe('abcdef'); }); @@ -51,7 +51,7 @@ describe('modules/datasource/github-tags/index', () => { .get(`/repos/${packageName}/commits?per_page=1`) .reply(200, []); - const res = await github.getDigest({ packageName }, null); + const res = await github.getDigest({ packageName }, undefined); expect(res).toBeNull(); }); @@ -86,7 +86,7 @@ describe('modules/datasource/github-tags/index', () => { const res = await github.getDigest( { packageName, registryUrl: githubEnterpriseApiHost }, - null + undefined ); expect(res).toBe('abcdef'); diff --git a/lib/modules/datasource/gitlab-packages/index.spec.ts b/lib/modules/datasource/gitlab-packages/index.spec.ts index 86b00110297eef..697c2123c74ee3 100644 --- a/lib/modules/datasource/gitlab-packages/index.spec.ts +++ b/lib/modules/datasource/gitlab-packages/index.spec.ts @@ -42,7 +42,7 @@ describe('modules/datasource/gitlab-packages/index', () => { depName: 'user/project1:mypkg', }); expect(res).toMatchSnapshot(); - expect(res.releases).toHaveLength(3); + expect(res?.releases).toHaveLength(3); }); it('returns null for 404', async () => { diff --git a/lib/modules/datasource/gitlab-releases/index.spec.ts b/lib/modules/datasource/gitlab-releases/index.spec.ts index 51453e13b6708f..e0480cd0c7f5d2 100644 --- a/lib/modules/datasource/gitlab-releases/index.spec.ts +++ b/lib/modules/datasource/gitlab-releases/index.spec.ts @@ -26,7 +26,7 @@ describe('modules/datasource/gitlab-releases/index', () => { depName: 'some/dep2', }); expect(res).toMatchSnapshot(); - expect(res.releases).toHaveLength(2); + expect(res?.releases).toHaveLength(2); }); it('returns releases from default registry', async () => { @@ -39,7 +39,7 @@ describe('modules/datasource/gitlab-releases/index', () => { depName: 'some/dep2', }); expect(res).toMatchSnapshot(); - expect(res.releases).toHaveLength(2); + expect(res?.releases).toHaveLength(2); }); it('return null if not found', async () => { diff --git a/lib/modules/datasource/gitlab-tags/index.spec.ts b/lib/modules/datasource/gitlab-tags/index.spec.ts index 7ff5c82f14f183..49467bd9b4263c 100644 --- a/lib/modules/datasource/gitlab-tags/index.spec.ts +++ b/lib/modules/datasource/gitlab-tags/index.spec.ts @@ -32,7 +32,7 @@ describe('modules/datasource/gitlab-tags/index', () => { depName: 'some/dep2', }); expect(res).toMatchSnapshot(); - expect(res.releases).toHaveLength(3); + expect(res?.releases).toHaveLength(3); }); it('returns tags from custom registry in sub path', async () => { @@ -75,7 +75,7 @@ describe('modules/datasource/gitlab-tags/index', () => { depName: 'some/dep2', }); expect(res).toMatchSnapshot(); - expect(res.releases).toHaveLength(2); + expect(res?.releases).toHaveLength(2); }); }); @@ -120,11 +120,10 @@ describe('modules/datasource/gitlab-tags/index', () => { }); it('returns null from gitlab installation with no commits', async () => { - const body = []; httpMock .scope('https://gitlab.company.com') .get('/api/v4/projects/some%2Fdep2/repository/commits?per_page=1') - .reply(200, body); + .reply(200, []); const res = await getDigest({ datasource, registryUrls: ['https://gitlab.company.com/api/v4/'], @@ -137,7 +136,7 @@ describe('modules/datasource/gitlab-tags/index', () => { httpMock .scope('https://gitlab.company.com') .get('/api/v4/projects/some%2Fdep2/repository/commits/unknown-branch') - .reply(404, null); + .reply(404, '}'); const res = await getDigest( { datasource, diff --git a/lib/modules/datasource/go/releases-direct.spec.ts b/lib/modules/datasource/go/releases-direct.spec.ts index 5753655146d089..53753b91761f0e 100644 --- a/lib/modules/datasource/go/releases-direct.spec.ts +++ b/lib/modules/datasource/go/releases-direct.spec.ts @@ -184,7 +184,7 @@ describe('modules/datasource/go/releases-direct', () => { ]; for (const pkg of packages) { const res = await datasource.getReleases(pkg); - expect(res.releases).toBeEmpty(); + expect(res?.releases).toBeEmpty(); } expect(githubGetTags).toHaveBeenCalledTimes(3); }); @@ -240,8 +240,8 @@ describe('modules/datasource/go/releases-direct', () => { for (const pkg of packages) { const prefix = pkg.packageName.split('/')[3]; const result = await datasource.getReleases(pkg); - expect(result.releases).toHaveLength(1); - expect(result.releases[0].version.startsWith(prefix)).toBeFalse(); + expect(result?.releases).toHaveLength(1); + expect(result?.releases[0].version.startsWith(prefix)).toBeFalse(); } }); @@ -270,7 +270,7 @@ describe('modules/datasource/go/releases-direct', () => { for (const pkg of packages) { const result = await datasource.getReleases(pkg); - expect(result.releases).toHaveLength(0); + expect(result?.releases).toHaveLength(0); } }); @@ -292,7 +292,7 @@ describe('modules/datasource/go/releases-direct', () => { }); const result = await datasource.getReleases(pkg); - expect(result.releases).toEqual([ + expect(result?.releases).toEqual([ { version: 'v2.0.0', gitRef: 'b/v2.0.0' }, { version: 'v3.0.0', gitRef: 'b/v3.0.0' }, ]); diff --git a/lib/modules/datasource/go/releases-goproxy.spec.ts b/lib/modules/datasource/go/releases-goproxy.spec.ts index 9936e8d1bf7bd2..17c181af30dcb5 100644 --- a/lib/modules/datasource/go/releases-goproxy.spec.ts +++ b/lib/modules/datasource/go/releases-goproxy.spec.ts @@ -76,7 +76,7 @@ describe('modules/datasource/go/releases-goproxy', () => { it('ignores everything starting from "direct" and "off" keywords', () => { expect(datasource.parseGoproxy(undefined)).toBeEmpty(); - expect(datasource.parseGoproxy(null)).toBeEmpty(); + expect(datasource.parseGoproxy(undefined)).toBeEmpty(); expect(datasource.parseGoproxy('')).toBeEmpty(); expect(datasource.parseGoproxy('off')).toMatchObject([ { url: 'off', fallback: '|' }, @@ -133,144 +133,144 @@ describe('modules/datasource/go/releases-goproxy', () => { it('matches on real package prefixes', () => { expect( - GoProxyDatasource.parseNoproxy('ex.co').test('ex.co/foo') + GoProxyDatasource.parseNoproxy('ex.co')?.test('ex.co/foo') ).toBeTrue(); expect( - GoProxyDatasource.parseNoproxy('ex.co/').test('ex.co/foo') + GoProxyDatasource.parseNoproxy('ex.co/')?.test('ex.co/foo') ).toBeTrue(); expect( - GoProxyDatasource.parseNoproxy('ex.co/foo/bar').test('ex.co/foo/bar') + GoProxyDatasource.parseNoproxy('ex.co/foo/bar')?.test('ex.co/foo/bar') ).toBeTrue(); expect( - GoProxyDatasource.parseNoproxy('ex.co/foo/bar').test('ex.co/foo/bar') + GoProxyDatasource.parseNoproxy('ex.co/foo/bar')?.test('ex.co/foo/bar') ).toBeTrue(); expect( - GoProxyDatasource.parseNoproxy('*/foo/*').test('example.com/foo/bar') + GoProxyDatasource.parseNoproxy('*/foo/*')?.test('example.com/foo/bar') ).toBeTrue(); expect( - GoProxyDatasource.parseNoproxy('ex.co/foo/*').test('ex.co/foo/bar') + GoProxyDatasource.parseNoproxy('ex.co/foo/*')?.test('ex.co/foo/bar') ).toBeTrue(); expect( - GoProxyDatasource.parseNoproxy('ex.co/foo/*').test('ex.co/foo/baz') + GoProxyDatasource.parseNoproxy('ex.co/foo/*')?.test('ex.co/foo/baz') ).toBeTrue(); expect( - GoProxyDatasource.parseNoproxy('ex.co').test('ex.co/foo/v2') + GoProxyDatasource.parseNoproxy('ex.co')?.test('ex.co/foo/v2') ).toBeTrue(); expect( - GoProxyDatasource.parseNoproxy('ex.co/foo/bar').test('ex.co/foo/bar') + GoProxyDatasource.parseNoproxy('ex.co/foo/bar')?.test('ex.co/foo/bar') ).toBeTrue(); expect( - GoProxyDatasource.parseNoproxy('*/foo/*').test('example.com/foo/bar') + GoProxyDatasource.parseNoproxy('*/foo/*')?.test('example.com/foo/bar') ).toBeTrue(); expect( - GoProxyDatasource.parseNoproxy('ex.co/foo/*').test('ex.co/foo/bar') + GoProxyDatasource.parseNoproxy('ex.co/foo/*')?.test('ex.co/foo/bar') ).toBeTrue(); expect( - GoProxyDatasource.parseNoproxy('ex.co/foo/*').test('ex.co/foo/baz') + GoProxyDatasource.parseNoproxy('ex.co/foo/*')?.test('ex.co/foo/baz') ).toBeTrue(); expect( - GoProxyDatasource.parseNoproxy('ex.co/foo/bar,ex.co/foo/baz').test( + GoProxyDatasource.parseNoproxy('ex.co/foo/bar,ex.co/foo/baz')?.test( 'ex.co/foo/bar' ) ).toBeTrue(); expect( - GoProxyDatasource.parseNoproxy('ex.co/foo/bar,ex.co/foo/baz').test( + GoProxyDatasource.parseNoproxy('ex.co/foo/bar,ex.co/foo/baz')?.test( 'ex.co/foo/baz' ) ).toBeTrue(); expect( - GoProxyDatasource.parseNoproxy('ex.co/foo/bar,ex.co/foo/baz').test( + GoProxyDatasource.parseNoproxy('ex.co/foo/bar,ex.co/foo/baz')?.test( 'ex.co/foo/qux' ) ).toBeFalse(); expect( - GoProxyDatasource.parseNoproxy('ex').test('ex.co/foo') + GoProxyDatasource.parseNoproxy('ex')?.test('ex.co/foo') ).toBeFalse(); - expect(GoProxyDatasource.parseNoproxy('aba').test('x/aba')).toBeFalse(); - expect(GoProxyDatasource.parseNoproxy('x/b').test('x/aba')).toBeFalse(); - expect(GoProxyDatasource.parseNoproxy('x/ab').test('x/aba')).toBeFalse(); + expect(GoProxyDatasource.parseNoproxy('aba')?.test('x/aba')).toBeFalse(); + expect(GoProxyDatasource.parseNoproxy('x/b')?.test('x/aba')).toBeFalse(); + expect(GoProxyDatasource.parseNoproxy('x/ab')?.test('x/aba')).toBeFalse(); expect( - GoProxyDatasource.parseNoproxy('x/ab[a-b]').test('x/aba') + GoProxyDatasource.parseNoproxy('x/ab[a-b]')?.test('x/aba') ).toBeTrue(); }); it('matches on wildcards', () => { expect( - GoProxyDatasource.parseNoproxy('/*/').test('ex.co/foo') + GoProxyDatasource.parseNoproxy('/*/')?.test('ex.co/foo') ).toBeFalse(); expect( - GoProxyDatasource.parseNoproxy('*/foo').test('ex.co/foo') + GoProxyDatasource.parseNoproxy('*/foo')?.test('ex.co/foo') ).toBeTrue(); expect( - GoProxyDatasource.parseNoproxy('*/fo').test('ex.co/foo') + GoProxyDatasource.parseNoproxy('*/fo')?.test('ex.co/foo') ).toBeFalse(); expect( - GoProxyDatasource.parseNoproxy('*/fo?').test('ex.co/foo') + GoProxyDatasource.parseNoproxy('*/fo?')?.test('ex.co/foo') ).toBeTrue(); expect( - GoProxyDatasource.parseNoproxy('*/fo*').test('ex.co/foo') + GoProxyDatasource.parseNoproxy('*/fo*')?.test('ex.co/foo') ).toBeTrue(); expect( - GoProxyDatasource.parseNoproxy('*fo*').test('ex.co/foo') + GoProxyDatasource.parseNoproxy('*fo*')?.test('ex.co/foo') ).toBeFalse(); expect( - GoProxyDatasource.parseNoproxy('*.co').test('ex.co/foo') + GoProxyDatasource.parseNoproxy('*.co')?.test('ex.co/foo') ).toBeTrue(); expect( - GoProxyDatasource.parseNoproxy('ex*').test('ex.co/foo') + GoProxyDatasource.parseNoproxy('ex*')?.test('ex.co/foo') ).toBeTrue(); expect( - GoProxyDatasource.parseNoproxy('*/foo').test('ex.co/foo/v2') + GoProxyDatasource.parseNoproxy('*/foo')?.test('ex.co/foo/v2') ).toBeTrue(); expect( - GoProxyDatasource.parseNoproxy('*/foo/').test('ex.co/foo/v2') + GoProxyDatasource.parseNoproxy('*/foo/')?.test('ex.co/foo/v2') ).toBeTrue(); expect( - GoProxyDatasource.parseNoproxy('*/foo/*').test('ex.co/foo/v2') + GoProxyDatasource.parseNoproxy('*/foo/*')?.test('ex.co/foo/v2') ).toBeTrue(); expect( - GoProxyDatasource.parseNoproxy('*/foo/*/').test('ex.co/foo/v2') + GoProxyDatasource.parseNoproxy('*/foo/*/')?.test('ex.co/foo/v2') ).toBeTrue(); expect( - GoProxyDatasource.parseNoproxy('*/v2').test('ex.co/foo/v2') + GoProxyDatasource.parseNoproxy('*/v2')?.test('ex.co/foo/v2') ).toBeFalse(); expect( - GoProxyDatasource.parseNoproxy('*/*/v2').test('ex.co/foo/v2') + GoProxyDatasource.parseNoproxy('*/*/v2')?.test('ex.co/foo/v2') ).toBeTrue(); expect( - GoProxyDatasource.parseNoproxy('*/*/*').test('ex.co/foo/v2') + GoProxyDatasource.parseNoproxy('*/*/*')?.test('ex.co/foo/v2') ).toBeTrue(); expect( - GoProxyDatasource.parseNoproxy('*/*/*/').test('ex.co/foo/v2') + GoProxyDatasource.parseNoproxy('*/*/*/')?.test('ex.co/foo/v2') ).toBeTrue(); expect( - GoProxyDatasource.parseNoproxy('*/*/*').test('ex.co/foo') + GoProxyDatasource.parseNoproxy('*/*/*')?.test('ex.co/foo') ).toBeFalse(); expect( - GoProxyDatasource.parseNoproxy('*/*/*/').test('ex.co/foo') + GoProxyDatasource.parseNoproxy('*/*/*/')?.test('ex.co/foo') ).toBeFalse(); expect( - GoProxyDatasource.parseNoproxy('*/*/*,,').test('ex.co/repo') + GoProxyDatasource.parseNoproxy('*/*/*,,')?.test('ex.co/repo') ).toBeFalse(); expect( - GoProxyDatasource.parseNoproxy('*/*/*,,*/repo').test('ex.co/repo') + GoProxyDatasource.parseNoproxy('*/*/*,,*/repo')?.test('ex.co/repo') ).toBeTrue(); expect( - GoProxyDatasource.parseNoproxy(',,*/repo').test('ex.co/repo') + GoProxyDatasource.parseNoproxy(',,*/repo')?.test('ex.co/repo') ).toBeTrue(); }); it('matches on character ranges', () => { expect( - GoProxyDatasource.parseNoproxy('x/ab[a-b]').test('x/aba') + GoProxyDatasource.parseNoproxy('x/ab[a-b]')?.test('x/aba') ).toBeTrue(); expect( - GoProxyDatasource.parseNoproxy('x/ab[a-b]').test('x/abc') + GoProxyDatasource.parseNoproxy('x/ab[a-b]')?.test('x/abc') ).toBeFalse(); }); }); diff --git a/tsconfig.strict.json b/tsconfig.strict.json index f3e83a6a7d6a14..7ecbdc242979bf 100644 --- a/tsconfig.strict.json +++ b/tsconfig.strict.json @@ -15,7 +15,6 @@ "tmp", // TODO: fixme "lib/workers/**/*.spec.ts", - "lib/modules/datasource/**/*.spec.ts", "lib/modules/manager/**/*.spec.ts", "lib/renovate.spec.ts" ] From 7cb98e1a5b637966a012b832c27f261e34a2072a Mon Sep 17 00:00:00 2001 From: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Date: Mon, 20 Jun 2022 16:36:10 +0200 Subject: [PATCH 149/240] build: use ESLint cache option (#16151) * ci: use ESLint cache option * Update .gitignore Co-authored-by: Michael Kriese --- .prettierignore | 1 + package.json | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.prettierignore b/.prettierignore index 286760af2ee8bd..5ef10e0f4e9e19 100644 --- a/.prettierignore +++ b/.prettierignore @@ -13,6 +13,7 @@ package.json **/__mocks__/ bin/yarn* .clinic/ +.eslintcache # generated code **/*.generated.ts diff --git a/package.json b/package.json index c57f89b0dbe563..89f568e33b60d7 100644 --- a/package.json +++ b/package.json @@ -17,8 +17,8 @@ "debug": "node --inspect-brk -r ts-node/register/transpile-only -- lib/renovate.ts", "doc-fix": "run-s markdown-lint-fix prettier-fix", "doc-fence-check": "node tools/check-fenced-code.mjs", - "eslint": "eslint . --report-unused-disable-directives", - "eslint-fix": "eslint --fix . --report-unused-disable-directives", + "eslint": "eslint . --cache --report-unused-disable-directives", + "eslint-fix": "eslint --cache --fix . --report-unused-disable-directives", "generate": "run-s generate:*", "generate:imports": "node tools/generate-imports.mjs", "git-check": "node tools/check-git-version.mjs", From b4319928f1886a7275b9d45f7c148ba63c300e0e Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Mon, 20 Jun 2022 17:05:39 +0200 Subject: [PATCH 150/240] refactor: strict manager tests (#16155) * refactor: strict manager tests * chore: revert changes * Update lib/modules/manager/gradle/extract.spec.ts --- .../manager/ansible-galaxy/extract.spec.ts | 25 +-- lib/modules/manager/ansible/extract.spec.ts | 10 +- lib/modules/manager/argocd/extract.spec.ts | 6 +- .../manager/azure-pipelines/extract.spec.ts | 6 +- lib/modules/manager/azure-pipelines/types.ts | 4 +- .../manager/batect-wrapper/artifacts.spec.ts | 2 +- .../manager/batect-wrapper/extract.spec.ts | 2 +- lib/modules/manager/batect/extract.spec.ts | 6 +- lib/modules/manager/bazel/extract.spec.ts | 24 +-- lib/modules/manager/bazel/update.spec.ts | 10 +- .../bitbucket-pipelines/extract.spec.ts | 6 +- lib/modules/manager/buildkite/extract.spec.ts | 14 +- lib/modules/manager/bundler/extract.spec.ts | 45 +++--- lib/modules/manager/cargo/artifacts.spec.ts | 2 +- lib/modules/manager/cargo/extract.spec.ts | 48 +++--- lib/modules/manager/circleci/extract.spec.ts | 10 +- .../manager/cloudbuild/extract.spec.ts | 6 +- .../manager/composer/artifacts.spec.ts | 4 +- lib/modules/manager/composer/extract.spec.ts | 16 +- lib/modules/manager/deps-edn/extract.spec.ts | 2 +- .../manager/docker-compose/extract.spec.ts | 18 +-- .../manager/dockerfile/extract.spec.ts | 103 ++++++------- lib/modules/manager/droneci/extract.spec.ts | 6 +- lib/modules/manager/fingerprint.spec.ts | 2 +- lib/modules/manager/flux/extract.spec.ts | 16 +- lib/modules/manager/fvm/extract.spec.ts | 4 +- .../manager/git-submodules/artifact.spec.ts | 2 +- .../manager/git-submodules/extract.spec.ts | 51 ++++--- .../manager/git-submodules/update.spec.ts | 6 +- .../manager/github-actions/extract.spec.ts | 16 +- .../manager/gitlabci-include/extract.spec.ts | 12 +- lib/modules/manager/gitlabci/extract.spec.ts | 16 +- lib/modules/manager/gomod/artifacts.spec.ts | 67 +++++--- lib/modules/manager/gomod/extract.spec.ts | 14 +- lib/modules/manager/gomod/update.spec.ts | 14 +- .../gradle-wrapper/artifacts-real.spec.ts | 28 ++-- .../manager/gradle-wrapper/artifacts.spec.ts | 4 +- .../manager/gradle-wrapper/extract.spec.ts | 14 +- .../manager/gradle-wrapper/util.spec.ts | 7 +- lib/modules/manager/gradle/extract.spec.ts | 2 +- lib/modules/manager/gradle/parser.spec.ts | 8 +- lib/modules/manager/gradle/tokenizer.spec.ts | 2 +- lib/modules/manager/gradle/update.spec.ts | 2 +- lib/modules/manager/gradle/utils.spec.ts | 3 +- lib/modules/manager/gradle/utils.ts | 4 +- .../manager/helm-requirements/extract.spec.ts | 10 +- .../manager/helm-values/extract.spec.ts | 9 +- lib/modules/manager/helmfile/extract.spec.ts | 10 +- lib/modules/manager/helmsman/extract.spec.ts | 4 +- lib/modules/manager/helmv3/artifacts.spec.ts | 2 +- lib/modules/manager/helmv3/extract.spec.ts | 6 +- lib/modules/manager/helmv3/update.spec.ts | 2 +- lib/modules/manager/helmv3/utils.spec.ts | 12 +- lib/modules/manager/homebrew/extract.spec.ts | 20 +-- lib/modules/manager/homebrew/update.spec.ts | 2 +- lib/modules/manager/index.spec.ts | 11 +- lib/modules/manager/jenkins/extract.spec.ts | 10 +- .../manager/jsonnet-bundler/artifacts.spec.ts | 22 +-- .../manager/jsonnet-bundler/extract.spec.ts | 10 +- .../manager/kubernetes/extract.spec.ts | 20 +-- lib/modules/manager/kustomize/extract.spec.ts | 116 +++++++------- lib/modules/manager/leiningen/extract.spec.ts | 8 +- lib/modules/manager/maven/extract.spec.ts | 4 +- lib/modules/manager/maven/index.spec.ts | 65 ++++---- lib/modules/manager/maven/update.spec.ts | 10 +- lib/modules/manager/metadata.spec.ts | 5 +- lib/modules/manager/meteor/extract.spec.ts | 4 +- lib/modules/manager/mix/artifacts.spec.ts | 4 +- lib/modules/manager/mix/extract.spec.ts | 4 +- lib/modules/manager/npm/extract/pnpm.spec.ts | 2 +- lib/modules/manager/npm/utils.spec.ts | 10 +- lib/modules/manager/nuget/extract.spec.ts | 36 ++--- lib/modules/manager/nvm/extract.spec.ts | 2 +- .../manager/pip-compile/artifacts.spec.ts | 33 ++-- .../pip_requirements/artifacts.spec.ts | 4 +- .../manager/pip_requirements/extract.spec.ts | 74 ++++----- lib/modules/manager/pip_setup/extract.spec.ts | 2 +- lib/modules/manager/pipenv/artifacts.spec.ts | 5 +- lib/modules/manager/pipenv/extract.spec.ts | 55 +++---- lib/modules/manager/poetry/artifacts.spec.ts | 24 +-- lib/modules/manager/poetry/extract.spec.ts | 53 +++---- .../manager/poetry/update-locked.spec.ts | 4 +- .../manager/pre-commit/extract.spec.ts | 20 +-- lib/modules/manager/pyenv/extract.spec.ts | 2 +- lib/modules/manager/regex/index.spec.ts | 56 +++---- .../manager/ruby-version/extract.spec.ts | 2 +- lib/modules/manager/sbt/extract.spec.ts | 4 +- lib/modules/manager/sbt/update.spec.ts | 2 +- lib/modules/manager/setup-cfg/extract.spec.ts | 2 +- lib/modules/manager/swift/index.spec.ts | 3 +- .../manager/terraform-version/extract.spec.ts | 2 +- lib/modules/manager/terraform/extract.spec.ts | 60 ++++---- .../manager/terraform/lockfile/index.spec.ts | 63 ++++---- lib/modules/manager/terraform/modules.spec.ts | 144 ++++++++++-------- .../terragrunt-version/extract.spec.ts | 2 +- .../manager/terragrunt/extract.spec.ts | 8 +- .../manager/terragrunt/modules.spec.ts | 71 +++++---- lib/modules/manager/travis/extract.spec.ts | 16 +- lib/modules/manager/velaci/extract.spec.ts | 16 +- tsconfig.strict.json | 1 - 100 files changed, 950 insertions(+), 867 deletions(-) diff --git a/lib/modules/manager/ansible-galaxy/extract.spec.ts b/lib/modules/manager/ansible-galaxy/extract.spec.ts index cc7dc519e70bb9..0aa97824f98c68 100644 --- a/lib/modules/manager/ansible-galaxy/extract.spec.ts +++ b/lib/modules/manager/ansible-galaxy/extract.spec.ts @@ -1,5 +1,6 @@ import { loadFixture } from '../../../../test/util'; -import { extractPackageFile, getSliceEndNumber } from './extract'; +import { getSliceEndNumber } from './extract'; +import { extractPackageFile } from './'; const yamlFile1 = loadFixture('requirements01.yml'); const yamlFile2 = loadFixture('requirements02.yml'); @@ -16,14 +17,14 @@ describe('modules/manager/ansible-galaxy/extract', () => { it('extracts multiple dependencies from requirements.yml', () => { const res = extractPackageFile(yamlFile1, 'requirements.yml'); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(12); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(12); }); it('extracts dependencies from a not beautified requirements file', () => { const res = extractPackageFile(yamlFile2, 'requirements.yml'); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(2); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(2); }); it('check if an empty file returns null', () => { @@ -38,21 +39,21 @@ describe('modules/manager/ansible-galaxy/extract', () => { it('check collection style requirements file', () => { const res = extractPackageFile(collections1, 'requirements.yml'); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(13); - expect(res.deps.filter((value) => value.skipReason)).toHaveLength(6); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(13); + expect(res?.deps.filter((value) => value.skipReason)).toHaveLength(6); }); it('check collection style requirements file in reverse order and missing empty line', () => { const res = extractPackageFile(collections2, 'requirements.yml'); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(4); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(4); }); it('check galaxy definition file', () => { const res = extractPackageFile(galaxy, 'galaxy.yml'); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(2); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(2); }); }); diff --git a/lib/modules/manager/ansible/extract.spec.ts b/lib/modules/manager/ansible/extract.spec.ts index 4296d8b09d3a2f..e7bde92ed9c9fd 100644 --- a/lib/modules/manager/ansible/extract.spec.ts +++ b/lib/modules/manager/ansible/extract.spec.ts @@ -1,5 +1,5 @@ import { Fixtures } from '../../../../test/fixtures'; -import { extractPackageFile } from './extract'; +import { extractPackageFile } from '.'; describe('modules/manager/ansible/extract', () => { describe('extractPackageFile()', () => { @@ -9,14 +9,14 @@ describe('modules/manager/ansible/extract', () => { it('extracts multiple image lines from docker_container', () => { const res = extractPackageFile(Fixtures.get('main1.yaml')); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(9); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(9); }); it('extracts multiple image lines from docker_service', () => { const res = extractPackageFile(Fixtures.get('main2.yaml')); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(4); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(4); }); }); }); diff --git a/lib/modules/manager/argocd/extract.spec.ts b/lib/modules/manager/argocd/extract.spec.ts index 6e11eb5f044ef1..ba61d5fc8c8f75 100644 --- a/lib/modules/manager/argocd/extract.spec.ts +++ b/lib/modules/manager/argocd/extract.spec.ts @@ -1,5 +1,5 @@ import { Fixtures } from '../../../../test/fixtures'; -import { extractPackageFile } from './extract'; +import { extractPackageFile } from '.'; const validApplication = Fixtures.get('validApplication.yml'); const malformedApplication = Fixtures.get('malformedApplications.yml'); @@ -28,8 +28,8 @@ describe('modules/manager/argocd/extract', () => { it('full test', () => { const result = extractPackageFile(validApplication, 'applications.yml'); expect(result).not.toBeNull(); - expect(result.deps).toBeArrayOfSize(3); - expect(result.deps).toMatchSnapshot(); + expect(result?.deps).toBeArrayOfSize(3); + expect(result?.deps).toMatchSnapshot(); }); it('supports applicationsets', () => { diff --git a/lib/modules/manager/azure-pipelines/extract.spec.ts b/lib/modules/manager/azure-pipelines/extract.spec.ts index 6e9ff77d850c12..8bda784ab2c6c3 100644 --- a/lib/modules/manager/azure-pipelines/extract.spec.ts +++ b/lib/modules/manager/azure-pipelines/extract.spec.ts @@ -1,10 +1,10 @@ import { Fixtures } from '../../../../test/fixtures'; import { extractContainer, - extractPackageFile, extractRepository, parseAzurePipelines, } from './extract'; +import { extractPackageFile } from '.'; const azurePipelines = Fixtures.get('azure-pipelines.yaml'); @@ -95,8 +95,8 @@ describe('modules/manager/azure-pipelines/extract', () => { it('extracts dependencies', () => { const res = extractPackageFile(azurePipelines, 'some-file'); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(3); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(3); }); it('should return null when there is no dependency found', () => { diff --git a/lib/modules/manager/azure-pipelines/types.ts b/lib/modules/manager/azure-pipelines/types.ts index 708638e2006cc1..ad4335834ac9d8 100644 --- a/lib/modules/manager/azure-pipelines/types.ts +++ b/lib/modules/manager/azure-pipelines/types.ts @@ -1,10 +1,10 @@ export interface Container { - image: string; + image?: string | null; } export interface Repository { type: 'git' | 'github' | 'bitbucket'; name: string; - ref: string; + ref?: string | null; } export interface Resources { repositories: Repository[]; diff --git a/lib/modules/manager/batect-wrapper/artifacts.spec.ts b/lib/modules/manager/batect-wrapper/artifacts.spec.ts index 510f9647b133c9..6b501fd432a981 100644 --- a/lib/modules/manager/batect-wrapper/artifacts.spec.ts +++ b/lib/modules/manager/batect-wrapper/artifacts.spec.ts @@ -1,6 +1,6 @@ import * as httpMock from '../../../../test/http-mock'; import type { UpdateArtifact } from '../types'; -import { updateArtifacts } from './artifacts'; +import { updateArtifacts } from '.'; const defaultTo = '1.2.3'; const newUnixWrapperContent = `Unix wrapper script for ${defaultTo}`; diff --git a/lib/modules/manager/batect-wrapper/extract.spec.ts b/lib/modules/manager/batect-wrapper/extract.spec.ts index 23572bd6148db8..2e8fb2ef8eed4f 100644 --- a/lib/modules/manager/batect-wrapper/extract.spec.ts +++ b/lib/modules/manager/batect-wrapper/extract.spec.ts @@ -2,7 +2,7 @@ import { Fixtures } from '../../../../test/fixtures'; import { GithubReleasesDatasource } from '../../datasource/github-releases'; import { id as semverVersioning } from '../../versioning/semver'; import type { PackageDependency } from '../types'; -import { extractPackageFile } from './extract'; +import { extractPackageFile } from '.'; describe('modules/manager/batect-wrapper/extract', () => { describe('extractPackageFile()', () => { diff --git a/lib/modules/manager/batect/extract.spec.ts b/lib/modules/manager/batect/extract.spec.ts index 2522a8c7807994..3cc1f50465445f 100644 --- a/lib/modules/manager/batect/extract.spec.ts +++ b/lib/modules/manager/batect/extract.spec.ts @@ -5,7 +5,7 @@ import { id as dockerVersioning } from '../../versioning/docker'; import { id as semverVersioning } from '../../versioning/semver'; import { getDep } from '../dockerfile/extract'; import type { ExtractConfig, PackageDependency } from '../types'; -import { extractAllPackageFiles } from './extract'; +import { extractAllPackageFiles } from '.'; const fixturesDir = 'lib/modules/manager/batect/__fixtures__'; @@ -76,8 +76,10 @@ describe('modules/manager/batect/extract', () => { `${fixturesDir}/valid/batect.yml`, ]); + // TODO: #7154 expect( - result.sort((a, b) => a.packageFile.localeCompare(b.packageFile)) + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + result?.sort((a, b) => a.packageFile!.localeCompare(b.packageFile!)) ).toEqual([ { packageFile: `${fixturesDir}/valid/another-include.yml`, diff --git a/lib/modules/manager/bazel/extract.spec.ts b/lib/modules/manager/bazel/extract.spec.ts index c7fc036dc5ca31..dc3605204dcadd 100644 --- a/lib/modules/manager/bazel/extract.spec.ts +++ b/lib/modules/manager/bazel/extract.spec.ts @@ -1,5 +1,5 @@ import { Fixtures } from '../../../../test/fixtures'; -import { extractPackageFile } from './extract'; +import { extractPackageFile } from '.'; describe('modules/manager/bazel/extract', () => { describe('extractPackageFile()', () => { @@ -15,13 +15,13 @@ describe('modules/manager/bazel/extract', () => { it('extracts multiple types of dependencies', () => { const res = extractPackageFile(Fixtures.get('WORKSPACE1')); - expect(res.deps).toHaveLength(14); - expect(res.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(14); + expect(res?.deps).toMatchSnapshot(); }); it('extracts github tags', () => { const res = extractPackageFile(Fixtures.get('WORKSPACE2')); - expect(res.deps).toMatchSnapshot([ + expect(res?.deps).toMatchSnapshot([ { packageName: 'lmirosevic/GBDeviceInfo' }, { packageName: 'nelhage/rules_boost' }, { packageName: 'lmirosevic/GBDeviceInfo' }, @@ -31,14 +31,14 @@ describe('modules/manager/bazel/extract', () => { it('handle comments and strings', () => { const res = extractPackageFile(Fixtures.get('WORKSPACE3')); - expect(res.deps).toMatchSnapshot([ + expect(res?.deps).toMatchSnapshot([ { packageName: 'nelhage/rules_boost' }, ]); }); it('extracts dependencies from *.bzl files', () => { const res = extractPackageFile(Fixtures.get('repositories.bzl')); - expect(res.deps).toMatchSnapshot([ + expect(res?.deps).toMatchSnapshot([ { currentDigest: '0356bef3fbbabec5f0e196ecfacdeb6db62d48c0', packageName: 'google/subpar', @@ -62,7 +62,7 @@ describe('modules/manager/bazel/extract', () => { tag="v1.0.0-alpha31.cli-migrations" )` ); - expect(res.deps).toMatchSnapshot([ + expect(res?.deps).toMatchSnapshot([ { currentDigest: 'sha256:a4e8d8c444ca04fe706649e82263c9f4c2a4229bc30d2a64561b5e1d20cc8548', @@ -85,8 +85,8 @@ go_repository( ) ` ); - expect(successStory.deps[0].datasource).toBe('go'); - expect(successStory.deps[0].packageName).toBe( + expect(successStory?.deps[0].datasource).toBe('go'); + expect(successStory?.deps[0].packageName).toBe( 'github.com/test/uuid-fork' ); @@ -100,7 +100,7 @@ go_repository( ) ` ); - expect(badStory.deps[0].skipReason).toBe('unsupported-remote'); + expect(badStory?.deps[0].skipReason).toBe('unsupported-remote'); const gheStory = extractPackageFile( ` @@ -112,7 +112,7 @@ go_repository( ) ` ); - expect(gheStory.deps[0].skipReason).toBe('unsupported-remote'); + expect(gheStory?.deps[0].skipReason).toBe('unsupported-remote'); const gitlabRemote = extractPackageFile( ` @@ -124,7 +124,7 @@ go_repository( ) ` ); - expect(gitlabRemote.deps[0].skipReason).toBe('unsupported-remote'); + expect(gitlabRemote?.deps[0].skipReason).toBe('unsupported-remote'); }); }); }); diff --git a/lib/modules/manager/bazel/update.spec.ts b/lib/modules/manager/bazel/update.spec.ts index 82240d48ac2c94..2df19ebdbf8970 100644 --- a/lib/modules/manager/bazel/update.spec.ts +++ b/lib/modules/manager/bazel/update.spec.ts @@ -2,7 +2,7 @@ import { Readable } from 'stream'; import * as httpMock from '../../../../test/http-mock'; import { loadFixture } from '../../../../test/util'; import type { UpdateType } from '../../../config/types'; -import { updateDependency } from './update'; +import { updateDependency } from '.'; const content = loadFixture('WORKSPACE1'); const contentContainerPull = loadFixture('container_pull'); @@ -147,7 +147,7 @@ describe('modules/manager/bazel/update', () => { upgrade, }); expect(res).not.toEqual(fileWithBzlExtension); - expect(res.indexOf('0.8.0')).not.toBe(-1); + expect(res?.indexOf('0.8.0')).not.toBe(-1); }); it('updates finds url instead of urls', async () => { @@ -175,7 +175,7 @@ describe('modules/manager/bazel/update', () => { upgrade, }); expect(res).not.toEqual(fileWithBzlExtension); - expect(res.indexOf('0.8.0')).not.toBe(-1); + expect(res?.indexOf('0.8.0')).not.toBe(-1); }); it('returns null if no urls resolve hashes', async () => { @@ -267,8 +267,8 @@ http_archive( upgrade, }); expect(res).not.toEqual(content); - expect(res.indexOf('0.5.0')).toBe(-1); - expect(res.indexOf('0.6.2')).not.toBe(-1); + expect(res?.indexOf('0.5.0')).toBe(-1); + expect(res?.indexOf('0.6.2')).not.toBe(-1); }); }); }); diff --git a/lib/modules/manager/bitbucket-pipelines/extract.spec.ts b/lib/modules/manager/bitbucket-pipelines/extract.spec.ts index eb614e308e7174..fe35eb919888a8 100644 --- a/lib/modules/manager/bitbucket-pipelines/extract.spec.ts +++ b/lib/modules/manager/bitbucket-pipelines/extract.spec.ts @@ -1,5 +1,5 @@ import { Fixtures } from '../../../../test/fixtures'; -import { extractPackageFile } from './extract'; +import { extractPackageFile } from '.'; describe('modules/manager/bitbucket-pipelines/extract', () => { describe('extractPackageFile()', () => { @@ -9,7 +9,7 @@ describe('modules/manager/bitbucket-pipelines/extract', () => { it('extracts dependencies', () => { const res = extractPackageFile(Fixtures.get('bitbucket-pipelines.yaml')); - expect(res.deps).toMatchInlineSnapshot(` + expect(res?.deps).toMatchInlineSnapshot(` Array [ Object { "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", @@ -37,7 +37,7 @@ Array [ }, ] `); - expect(res.deps).toHaveLength(3); + expect(res?.deps).toHaveLength(3); }); }); }); diff --git a/lib/modules/manager/buildkite/extract.spec.ts b/lib/modules/manager/buildkite/extract.spec.ts index 5ab5f64322173b..0edd3aada9aa63 100644 --- a/lib/modules/manager/buildkite/extract.spec.ts +++ b/lib/modules/manager/buildkite/extract.spec.ts @@ -1,6 +1,6 @@ import { Fixtures } from '../../../../test/fixtures'; import type { PackageDependency } from '../types'; -import { extractPackageFile } from './extract'; +import { extractPackageFile } from '.'; describe('modules/manager/buildkite/extract', () => { describe('extractPackageFile()', () => { @@ -9,31 +9,31 @@ describe('modules/manager/buildkite/extract', () => { }); it('extracts simple single plugin', () => { - const res = extractPackageFile(Fixtures.get('pipeline1.yml')).deps; + const res = extractPackageFile(Fixtures.get('pipeline1.yml'))?.deps; expect(res).toMatchSnapshot(); expect(res).toHaveLength(1); }); it('extracts multiple plugins in same file', () => { - const res = extractPackageFile(Fixtures.get('pipeline2.yml')).deps; + const res = extractPackageFile(Fixtures.get('pipeline2.yml'))?.deps; expect(res).toMatchSnapshot(); expect(res).toHaveLength(2); }); it('adds skipReason', () => { - const res = extractPackageFile(Fixtures.get('pipeline3.yml')).deps; + const res = extractPackageFile(Fixtures.get('pipeline3.yml'))?.deps; expect(res).toMatchSnapshot(); expect(res).toHaveLength(2); }); it('extracts arrays of plugins', () => { - const res = extractPackageFile(Fixtures.get('pipeline4.yml')).deps; + const res = extractPackageFile(Fixtures.get('pipeline4.yml'))?.deps; expect(res).toMatchSnapshot(); expect(res).toHaveLength(4); }); it('extracts git-based plugins', () => { - const res = extractPackageFile(Fixtures.get('pipeline5.yml')).deps; + const res = extractPackageFile(Fixtures.get('pipeline5.yml'))?.deps; expect(res).toMatchSnapshot(); expect(res).toHaveLength(2); }); @@ -45,7 +45,7 @@ describe('modules/manager/buildkite/extract', () => { depName: 'some-org/some-plugin', registryUrls: ['https://github.company.com'], }; - const res = extractPackageFile(Fixtures.get('pipeline6.yml')).deps; + const res = extractPackageFile(Fixtures.get('pipeline6.yml'))?.deps; expect(res).toHaveLength(1); expect(res).toEqual([expectedPackageDependency]); }); diff --git a/lib/modules/manager/bundler/extract.spec.ts b/lib/modules/manager/bundler/extract.spec.ts index df8d1c0aede5ce..88a592a890c171 100644 --- a/lib/modules/manager/bundler/extract.spec.ts +++ b/lib/modules/manager/bundler/extract.spec.ts @@ -1,3 +1,4 @@ +import is from '@sindresorhus/is'; import { fs, loadFixture } from '../../../../test/util'; import { isValid } from '../../versioning/ruby'; import { extractPackageFile } from '.'; @@ -37,23 +38,21 @@ describe('modules/manager/bundler/extract', () => { expect(res).toMatchSnapshot(); // couple of dependency of ruby rails are not present in the lock file. Filter out those before processing expect( - res.deps + res?.deps .filter((dep) => Object.prototype.hasOwnProperty.call(dep, 'lockedVersion') ) .every( - (dep) => - Object.prototype.hasOwnProperty.call(dep, 'lockedVersion') && - isValid(dep.lockedVersion) + (dep) => is.string(dep.lockedVersion) && isValid(dep.lockedVersion) ) ).toBeTrue(); - expect(res.deps).toHaveLength(68); + expect(res?.deps).toHaveLength(68); }); it('parses sourceGroups', async () => { const res = await extractPackageFile(sourceGroupGemfile, 'Gemfile'); expect(res).toMatchSnapshot(); - expect(res.deps).toHaveLength(7); + expect(res?.deps).toHaveLength(7); }); it('parse webpacker Gemfile', async () => { @@ -61,13 +60,11 @@ describe('modules/manager/bundler/extract', () => { const res = await extractPackageFile(webPackerGemfile, 'Gemfile'); expect(res).toMatchSnapshot(); expect( - res.deps.every( - (dep) => - Object.prototype.hasOwnProperty.call(dep, 'lockedVersion') && - isValid(dep.lockedVersion) + res?.deps.every( + (dep) => is.string(dep.lockedVersion) && isValid(dep.lockedVersion) ) ).toBeTrue(); - expect(res.deps).toHaveLength(5); + expect(res?.deps).toHaveLength(5); }); it('parse mastodon Gemfile', async () => { @@ -75,17 +72,15 @@ describe('modules/manager/bundler/extract', () => { const res = await extractPackageFile(mastodonGemfile, 'Gemfile'); expect(res).toMatchSnapshot(); expect( - res.deps + res?.deps .filter((dep) => Object.prototype.hasOwnProperty.call(dep, 'lockedVersion') ) .every( - (dep) => - Object.prototype.hasOwnProperty.call(dep, 'lockedVersion') && - isValid(dep.lockedVersion) + (dep) => is.string(dep.lockedVersion) && isValid(dep.lockedVersion) ) ).toBeTrue(); - expect(res.deps).toHaveLength(125); + expect(res?.deps).toHaveLength(125); }); it('parse Ruby CI Gemfile', async () => { @@ -93,13 +88,11 @@ describe('modules/manager/bundler/extract', () => { const res = await extractPackageFile(rubyCIGemfile, 'Gemfile'); expect(res).toMatchSnapshot(); expect( - res.deps.every( - (dep) => - Object.prototype.hasOwnProperty.call(dep, 'lockedVersion') && - isValid(dep.lockedVersion) + res?.deps.every( + (dep) => is.string(dep.lockedVersion) && isValid(dep.lockedVersion) ) ).toBeTrue(); - expect(res.deps).toHaveLength(14); + expect(res?.deps).toHaveLength(14); }); }); @@ -108,13 +101,11 @@ describe('modules/manager/bundler/extract', () => { const res = await extractPackageFile(gitlabFossGemfile, 'Gemfile'); expect(res).toMatchSnapshot(); expect( - res.deps.every( - (dep) => - Object.prototype.hasOwnProperty.call(dep, 'lockedVersion') && - isValid(dep.lockedVersion) + res?.deps.every( + (dep) => is.string(dep.lockedVersion) && isValid(dep.lockedVersion) ) ).toBeTrue(); - expect(res.deps).toHaveLength(252); + expect(res?.deps).toHaveLength(252); }); it('parse source blocks in Gemfile', async () => { @@ -130,6 +121,6 @@ describe('modules/manager/bundler/extract', () => { 'Gemfile' ); expect(res).toMatchSnapshot(); - expect(res.deps).toHaveLength(2); + expect(res?.deps).toHaveLength(2); }); }); diff --git a/lib/modules/manager/cargo/artifacts.spec.ts b/lib/modules/manager/cargo/artifacts.spec.ts index 818e39e45dc472..93c52216107ae9 100644 --- a/lib/modules/manager/cargo/artifacts.spec.ts +++ b/lib/modules/manager/cargo/artifacts.spec.ts @@ -5,7 +5,7 @@ import { GlobalConfig } from '../../../config/global'; import type { RepoGlobalConfig } from '../../../config/types'; import * as docker from '../../../util/exec/docker'; import type { UpdateArtifactsConfig } from '../types'; -import * as cargo from './artifacts'; +import * as cargo from '.'; jest.mock('child_process'); jest.mock('../../../util/exec/env'); diff --git a/lib/modules/manager/cargo/extract.spec.ts b/lib/modules/manager/cargo/extract.spec.ts index 896ca48afc3ce2..fdbdcc083c0edc 100644 --- a/lib/modules/manager/cargo/extract.spec.ts +++ b/lib/modules/manager/cargo/extract.spec.ts @@ -5,7 +5,7 @@ import { GlobalConfig } from '../../../config/global'; import type { RepoGlobalConfig } from '../../../config/types'; import { writeLocalFile } from '../../../util/fs'; import type { ExtractConfig } from '../types'; -import { extractPackageFile } from './extract'; +import { extractPackageFile } from '.'; const cargo1toml = loadFixture('Cargo.1.toml'); const cargo2toml = loadFixture('Cargo.2.toml'); @@ -66,32 +66,32 @@ describe('modules/manager/cargo/extract', () => { it('extracts multiple dependencies simple', async () => { const res = await extractPackageFile(cargo1toml, 'Cargo.toml', config); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(15); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(15); }); it('extracts multiple dependencies advanced', async () => { const res = await extractPackageFile(cargo2toml, 'Cargo.toml', config); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(18 + 6 + 1); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(18 + 6 + 1); }); it('handles inline tables', async () => { const res = await extractPackageFile(cargo3toml, 'Cargo.toml', config); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(8); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(8); }); it('handles standard tables', async () => { const res = await extractPackageFile(cargo4toml, 'Cargo.toml', config); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(6); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(6); }); it('extracts platform specific dependencies', async () => { const res = await extractPackageFile(cargo5toml, 'Cargo.toml', config); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(4); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(4); }); it('extracts registry urls from .cargo/config.toml', async () => { @@ -99,8 +99,8 @@ describe('modules/manager/cargo/extract', () => { const res = await extractPackageFile(cargo6toml, 'Cargo.toml', { ...config, }); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(3); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(3); }); it('extracts registry urls from .cargo/config (legacy path)', async () => { @@ -108,16 +108,16 @@ describe('modules/manager/cargo/extract', () => { const res = await extractPackageFile(cargo6toml, 'Cargo.toml', { ...config, }); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(3); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(3); }); it('skips unknown registries', async () => { const cargotoml = '[dependencies]\nfoobar = { version = "0.1.0", registry = "not-listed" }'; const res = await extractPackageFile(cargotoml, 'Cargo.toml', config); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(1); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(1); }); it('fails to parse cargo config with invalid TOML', async () => { @@ -126,8 +126,8 @@ describe('modules/manager/cargo/extract', () => { const res = await extractPackageFile(cargo6toml, 'Cargo.toml', { ...config, }); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(3); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(3); }); it('ignore cargo config registries with missing index', async () => { @@ -136,8 +136,8 @@ describe('modules/manager/cargo/extract', () => { const res = await extractPackageFile(cargo6toml, 'Cargo.toml', { ...config, }); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(3); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(3); }); it('extracts original package name of renamed dependencies', async () => { @@ -145,9 +145,9 @@ describe('modules/manager/cargo/extract', () => { '[dependencies]\nboolector-solver = { package = "boolector", version = "0.4.0" }'; const res = await extractPackageFile(cargotoml, 'Cargo.toml', config); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(1); - expect(res.deps[0].packageName).toBe('boolector'); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(1); + expect(res?.deps[0].packageName).toBe('boolector'); }); }); }); diff --git a/lib/modules/manager/circleci/extract.spec.ts b/lib/modules/manager/circleci/extract.spec.ts index b6c6fe1b77de5e..7c7f1164936045 100644 --- a/lib/modules/manager/circleci/extract.spec.ts +++ b/lib/modules/manager/circleci/extract.spec.ts @@ -1,5 +1,5 @@ import { Fixtures } from '../../../../test/fixtures'; -import { extractPackageFile } from './extract'; +import { extractPackageFile } from '.'; const file1 = Fixtures.get('config.yml'); const file2 = Fixtures.get('config2.yml'); @@ -13,13 +13,13 @@ describe('modules/manager/circleci/extract', () => { it('extracts multiple image lines', () => { const res = extractPackageFile(file1); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(4); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(4); }); it('extracts orbs too', () => { const res = extractPackageFile(file2); - expect(res.deps).toMatchSnapshot([ + expect(res?.deps).toMatchSnapshot([ { depName: 'release-workflows', currentValue: '4.1.0', @@ -49,7 +49,7 @@ describe('modules/manager/circleci/extract', () => { it('extracts image without leading dash', () => { const res = extractPackageFile(file3); - expect(res.deps).toMatchSnapshot([ + expect(res?.deps).toMatchSnapshot([ { currentValue: '14.8.0', depName: 'cimg/node' }, ]); }); diff --git a/lib/modules/manager/cloudbuild/extract.spec.ts b/lib/modules/manager/cloudbuild/extract.spec.ts index 20671649164ed2..bc3e240c5e0966 100644 --- a/lib/modules/manager/cloudbuild/extract.spec.ts +++ b/lib/modules/manager/cloudbuild/extract.spec.ts @@ -1,5 +1,5 @@ import { Fixtures } from '../../../../test/fixtures'; -import { extractPackageFile } from './extract'; +import { extractPackageFile } from '.'; describe('modules/manager/cloudbuild/extract', () => { describe('extractPackageFile()', () => { @@ -9,8 +9,8 @@ describe('modules/manager/cloudbuild/extract', () => { it('extracts multiple image lines', () => { const res = extractPackageFile(Fixtures.get('cloudbuild.yml')); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(3); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(3); }); }); }); diff --git a/lib/modules/manager/composer/artifacts.spec.ts b/lib/modules/manager/composer/artifacts.spec.ts index e5899ab9fc9ae2..673e47c17e780e 100644 --- a/lib/modules/manager/composer/artifacts.spec.ts +++ b/lib/modules/manager/composer/artifacts.spec.ts @@ -10,7 +10,7 @@ import * as hostRules from '../../../util/host-rules'; import * as _datasource from '../../datasource'; import { PackagistDatasource } from '../../datasource/packagist'; import type { UpdateArtifactsConfig } from '../types'; -import * as composer from './artifacts'; +import * as composer from '.'; jest.mock('child_process'); jest.mock('../../../util/exec/env'); @@ -344,7 +344,7 @@ describe('modules/manager/composer/artifacts', () => { newPackageFileContent: '{}', config: { ...config, - composerIgnorePlatformReqs: null, + composerIgnorePlatformReqs: undefined, }, }) ).not.toBeNull(); diff --git a/lib/modules/manager/composer/extract.spec.ts b/lib/modules/manager/composer/extract.spec.ts index 97375edfd29fb2..aeb191389ee029 100644 --- a/lib/modules/manager/composer/extract.spec.ts +++ b/lib/modules/manager/composer/extract.spec.ts @@ -1,5 +1,5 @@ import { fs, loadFixture } from '../../../../test/util'; -import { extractPackageFile } from './extract'; +import { extractPackageFile } from '.'; jest.mock('../../../util/fs'); @@ -12,7 +12,7 @@ const requirements5Lock = loadFixture('composer5.lock'); describe('modules/manager/composer/extract', () => { describe('extractPackageFile()', () => { - let packageFile; + let packageFile: string; beforeEach(() => { packageFile = 'composer.json'; @@ -29,39 +29,39 @@ describe('modules/manager/composer/extract', () => { it('extracts dependencies with no lock file', async () => { const res = await extractPackageFile(requirements1, packageFile); expect(res).toMatchSnapshot(); - expect(res.deps).toHaveLength(32); + expect(res?.deps).toHaveLength(32); }); it('extracts registryUrls', async () => { const res = await extractPackageFile(requirements2, packageFile); expect(res).toMatchSnapshot(); - expect(res.registryUrls).toHaveLength(1); + expect(res?.registryUrls).toHaveLength(1); }); it('extracts object registryUrls', async () => { const res = await extractPackageFile(requirements3, packageFile); expect(res).toMatchSnapshot(); - expect(res.registryUrls).toHaveLength(1); + expect(res?.registryUrls).toHaveLength(1); }); it('extracts repositories and registryUrls', async () => { const res = await extractPackageFile(requirements4, packageFile); expect(res).toMatchSnapshot(); - expect(res.registryUrls).toHaveLength(3); + expect(res?.registryUrls).toHaveLength(3); }); it('extracts object repositories and registryUrls with lock file', async () => { fs.readLocalFile.mockResolvedValue(requirements5Lock); const res = await extractPackageFile(requirements5, packageFile); expect(res).toMatchSnapshot(); - expect(res.registryUrls).toHaveLength(2); + expect(res?.registryUrls).toHaveLength(2); }); it('extracts dependencies with lock file', async () => { fs.readLocalFile.mockResolvedValue('some content'); const res = await extractPackageFile(requirements1, packageFile); expect(res).toMatchSnapshot(); - expect(res.deps).toHaveLength(32); + expect(res?.deps).toHaveLength(32); }); }); }); diff --git a/lib/modules/manager/deps-edn/extract.spec.ts b/lib/modules/manager/deps-edn/extract.spec.ts index f64246cdebdca6..5737e3256d72e7 100644 --- a/lib/modules/manager/deps-edn/extract.spec.ts +++ b/lib/modules/manager/deps-edn/extract.spec.ts @@ -1,5 +1,5 @@ import { Fixtures } from '../../../../test/fixtures'; -import { extractPackageFile } from './extract'; +import { extractPackageFile } from '.'; describe('modules/manager/deps-edn/extract', () => { describe('extractPackageFile', () => { diff --git a/lib/modules/manager/docker-compose/extract.spec.ts b/lib/modules/manager/docker-compose/extract.spec.ts index ebfb2708dadbd1..00113e5ae7170a 100644 --- a/lib/modules/manager/docker-compose/extract.spec.ts +++ b/lib/modules/manager/docker-compose/extract.spec.ts @@ -1,5 +1,5 @@ import { loadFixture } from '../../../../test/util'; -import { extractPackageFile } from './extract'; +import { extractPackageFile } from '.'; const yamlFile1 = loadFixture('docker-compose.1.yml'); const yamlFile3 = loadFixture('docker-compose.3.yml'); @@ -22,25 +22,25 @@ describe('modules/manager/docker-compose/extract', () => { it('extracts multiple image lines for version 1', () => { const res = extractPackageFile(yamlFile1); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(8); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(8); }); it('extracts multiple image lines for version 3', () => { const res = extractPackageFile(yamlFile3); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(8); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(8); }); it('extracts multiple image lines for version 3 without set version key', () => { const res = extractPackageFile(yamlFile3NoVersion); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(8); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(8); }); it('extracts default variable values for version 3', () => { const res = extractPackageFile(yamlFile3DefaultValue); - expect(res.deps).toMatchInlineSnapshot(` + expect(res?.deps).toMatchInlineSnapshot(` Array [ Object { "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", @@ -52,7 +52,7 @@ describe('modules/manager/docker-compose/extract', () => { }, ] `); - expect(res.deps).toHaveLength(1); + expect(res?.deps).toHaveLength(1); }); }); }); diff --git a/lib/modules/manager/dockerfile/extract.spec.ts b/lib/modules/manager/dockerfile/extract.spec.ts index 38f0487483bd4f..5335b635f653b7 100644 --- a/lib/modules/manager/dockerfile/extract.spec.ts +++ b/lib/modules/manager/dockerfile/extract.spec.ts @@ -1,5 +1,6 @@ import { Fixtures } from '../../../../test/fixtures'; -import { extractPackageFile, extractVariables, getDep } from './extract'; +import { extractVariables, getDep } from './extract'; +import { extractPackageFile } from '.'; const d1 = Fixtures.get('1.Dockerfile'); const d2 = Fixtures.get('2.Dockerfile'); @@ -14,7 +15,7 @@ describe('modules/manager/dockerfile/extract', () => { }); it('handles naked dep', () => { - const res = extractPackageFile('FROM node\n').deps; + const res = extractPackageFile('FROM node\n')?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -31,7 +32,7 @@ describe('modules/manager/dockerfile/extract', () => { }); it('is case insensitive', () => { - const res = extractPackageFile('From node\n').deps; + const res = extractPackageFile('From node\n')?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -48,7 +49,7 @@ describe('modules/manager/dockerfile/extract', () => { }); it('handles tag', () => { - const res = extractPackageFile('FROM node:8.9.0-alpine\n').deps; + const res = extractPackageFile('FROM node:8.9.0-alpine\n')?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -67,7 +68,7 @@ describe('modules/manager/dockerfile/extract', () => { it('handles digest', () => { const res = extractPackageFile( 'FROM node@sha256:eb85fc5b1198f5e1ec025ea07586bdbbf397e7d82df66c90d7511f533517e063\n' - ).deps; + )?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -86,7 +87,7 @@ describe('modules/manager/dockerfile/extract', () => { it('handles tag and digest', () => { const res = extractPackageFile( 'FROM node:8.9.0@sha256:eb85fc5b1198f5e1ec025ea07586bdbbf397e7d82df66c90d7511f533517e063\n' - ).deps; + )?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -103,7 +104,7 @@ describe('modules/manager/dockerfile/extract', () => { }); it('handles from as', () => { - const res = extractPackageFile('FROM node:8.9.0-alpine as base\n').deps; + const res = extractPackageFile('FROM node:8.9.0-alpine as base\n')?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -122,7 +123,7 @@ describe('modules/manager/dockerfile/extract', () => { it('handles comments', () => { const res = extractPackageFile( '# some comment\n# another\n\nFROM node\n' - ).deps; + )?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -141,7 +142,7 @@ describe('modules/manager/dockerfile/extract', () => { it('handles custom hosts', () => { const res = extractPackageFile( 'FROM registry2.something.info/node:8\n' - ).deps; + )?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -160,7 +161,7 @@ describe('modules/manager/dockerfile/extract', () => { it('handles custom hosts and suffix', () => { const res = extractPackageFile( 'FROM registry2.something.info/node:8-alpine\n' - ).deps; + )?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -179,7 +180,7 @@ describe('modules/manager/dockerfile/extract', () => { it('handles custom hosts with port', () => { const res = extractPackageFile( 'FROM registry2.something.info:5005/node:8\n' - ).deps; + )?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -193,14 +194,14 @@ describe('modules/manager/dockerfile/extract', () => { }, ] `); - expect(res[0].depName).toBe('registry2.something.info:5005/node'); - expect(res[0].currentValue).toBe('8'); + expect(res?.[0].depName).toBe('registry2.something.info:5005/node'); + expect(res?.[0].currentValue).toBe('8'); }); it('handles custom hosts with port without tag', () => { const res = extractPackageFile( 'FROM registry2.something.info:5005/node\n' - ).deps; + )?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -214,12 +215,12 @@ describe('modules/manager/dockerfile/extract', () => { }, ] `); - expect(res[0].depName).toBe('registry2.something.info:5005/node'); + expect(res?.[0].depName).toBe('registry2.something.info:5005/node'); }); it('handles quay hosts with port', () => { - const res = extractPackageFile('FROM quay.io:1234/node\n').deps; - expect(res[0]).toMatchInlineSnapshot(` + const res = extractPackageFile('FROM quay.io:1234/node\n')?.deps; + expect(res?.[0]).toMatchInlineSnapshot(` Object { "autoReplaceStringTemplate": "{{packageName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", "currentDigest": undefined, @@ -234,7 +235,7 @@ describe('modules/manager/dockerfile/extract', () => { }); it('handles namespaced images', () => { - const res = extractPackageFile('FROM mynamespace/node:8\n').deps; + const res = extractPackageFile('FROM mynamespace/node:8\n')?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -253,7 +254,7 @@ describe('modules/manager/dockerfile/extract', () => { it('handles custom hosts with namespace', () => { const res = extractPackageFile( 'FROM registry2.something.info/someaccount/node:8\n' - ).deps; + )?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -272,7 +273,7 @@ describe('modules/manager/dockerfile/extract', () => { it('handles abnormal spacing', () => { const res = extractPackageFile( 'FROM registry.allmine.info:5005/node:8.7.0\n\n' - ).deps; + )?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -291,7 +292,7 @@ describe('modules/manager/dockerfile/extract', () => { it('extracts multiple FROM tags', () => { const res = extractPackageFile( 'FROM node:6.12.3 as frontend\n\n# comment\nENV foo=bar\nFROM python:3.6-slim\n' - ).deps; + )?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -325,7 +326,7 @@ describe('modules/manager/dockerfile/extract', () => { it('skips named multistage FROM tags', () => { const res = extractPackageFile( 'FROM node:6.12.3 as frontend\n\n# comment\nENV foo=bar\nFROM frontend\n' - ).deps; + )?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -345,7 +346,7 @@ describe('modules/manager/dockerfile/extract', () => { it('handles COPY --from', () => { const res = extractPackageFile( 'FROM scratch\nCOPY --from=gcr.io/k8s-skaffold/skaffold:v0.11.0 /usr/bin/skaffold /usr/bin/skaffold\n' - ).deps; + )?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -364,7 +365,7 @@ describe('modules/manager/dockerfile/extract', () => { it('skips named multistage COPY --from tags', () => { const res = extractPackageFile( 'FROM node:6.12.3 as frontend\n\n# comment\nENV foo=bar\nCOPY --from=frontend /usr/bin/node /usr/bin/node\n' - ).deps; + )?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -384,7 +385,7 @@ describe('modules/manager/dockerfile/extract', () => { it('skips index reference COPY --from tags', () => { const res = extractPackageFile( 'FROM node:6.12.3 as frontend\n\n# comment\nENV foo=bar\nCOPY --from=0 /usr/bin/node /usr/bin/node\n' - ).deps; + )?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -404,7 +405,7 @@ describe('modules/manager/dockerfile/extract', () => { it('detects ["stage"] and ["final"] deps of docker multi-stage build.', () => { const res = extractPackageFile( 'FROM node:8.15.1-alpine as skippedfrom\nFROM golang:1.7.3 as builder\n\n# comment\nWORKDIR /go/src/github.com/alexellis/href-counter/\nRUN go get -d -v golang.org/x/net/html \nCOPY app.go .\nRUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .\n\nFROM alpine:latest \nRUN apk --no-cache add ca-certificates\nWORKDIR /root/\nCOPY --from=builder /go/src/github.com/alexellis/href-counter/app .\nCMD ["./app"]\n' - ).deps; + )?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -437,15 +438,15 @@ describe('modules/manager/dockerfile/extract', () => { ] `); const passed = [ - res[2].depType === 'final', - res[1].depType === 'stage', - res[0].depType === 'stage', + res?.[2].depType === 'final', + res?.[1].depType === 'stage', + res?.[0].depType === 'stage', ].every(Boolean); expect(passed).toBeTrue(); }); it('extracts images on adjacent lines', () => { - const res = extractPackageFile(d1).deps; + const res = extractPackageFile(d1)?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -472,7 +473,7 @@ describe('modules/manager/dockerfile/extract', () => { }); it('extracts images from all sorts of (maybe multiline) FROM and COPY --from statements', () => { - const res = extractPackageFile(d2).deps; + const res = extractPackageFile(d2)?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -562,7 +563,7 @@ describe('modules/manager/dockerfile/extract', () => { }); it('handles calico/node', () => { - const res = extractPackageFile('FROM calico/node\n').deps; + const res = extractPackageFile('FROM calico/node\n')?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -579,7 +580,7 @@ describe('modules/manager/dockerfile/extract', () => { }); it('handles ubuntu', () => { - const res = extractPackageFile('FROM ubuntu:18.04\n').deps; + const res = extractPackageFile('FROM ubuntu:18.04\n')?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -597,7 +598,7 @@ describe('modules/manager/dockerfile/extract', () => { }); it('handles debian with codename', () => { - const res = extractPackageFile('FROM debian:buster\n').deps; + const res = extractPackageFile('FROM debian:buster\n')?.deps; expect(res).toEqual([ { autoReplaceStringTemplate: @@ -614,7 +615,7 @@ describe('modules/manager/dockerfile/extract', () => { }); it('handles debian with prefixes', () => { - const res = extractPackageFile('FROM amd64/debian:10\n').deps; + const res = extractPackageFile('FROM amd64/debian:10\n')?.deps; expect(res).toEqual([ { autoReplaceStringTemplate: @@ -632,7 +633,7 @@ describe('modules/manager/dockerfile/extract', () => { }); it('handles prefixes', () => { - const res = extractPackageFile('FROM amd64/ubuntu:18.04\n').deps; + const res = extractPackageFile('FROM amd64/ubuntu:18.04\n')?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -653,7 +654,7 @@ describe('modules/manager/dockerfile/extract', () => { it('handles implausible line continuation', () => { const res = extractPackageFile( 'FROM alpine:3.5\n\nRUN something \\' - ).deps; + )?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -670,7 +671,7 @@ describe('modules/manager/dockerfile/extract', () => { }); it('handles multi-line FROM with space after escape character', () => { - const res = extractPackageFile('FROM \\ \nnginx:1.20\n').deps; + const res = extractPackageFile('FROM \\ \nnginx:1.20\n')?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -687,7 +688,7 @@ describe('modules/manager/dockerfile/extract', () => { }); it('handles FROM without ARG default value', () => { - const res = extractPackageFile('ARG img_base\nFROM $img_base\n').deps; + const res = extractPackageFile('ARG img_base\nFROM $img_base\n')?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -704,7 +705,7 @@ describe('modules/manager/dockerfile/extract', () => { it('handles FROM with empty ARG default value', () => { const res = extractPackageFile( 'ARG patch1=""\nARG patch2=\nFROM nginx:1.20${patch1}$patch2\n' - ).deps; + )?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -723,7 +724,7 @@ describe('modules/manager/dockerfile/extract', () => { it('handles FROM with version in ARG value', () => { const res = extractPackageFile( 'ARG\tVARIANT="1.60.0-bullseye"\nFROM\trust:${VARIANT}\n' - ).deps; + )?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -742,7 +743,7 @@ describe('modules/manager/dockerfile/extract', () => { it('handles FROM with version in ARG default value', () => { const res = extractPackageFile( 'ARG IMAGE_VERSION=${IMAGE_VERSION:-ubuntu:xenial}\nfrom ${IMAGE_VERSION} as base\n' - ).deps; + )?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -762,7 +763,7 @@ describe('modules/manager/dockerfile/extract', () => { const res = extractPackageFile( 'ARG sha_digest=sha256:ab37242e81cbc031b2600eef4440fe87055a05c14b40686df85078cc5086c98f\n' + ' FROM gcr.io/distroless/java17@$sha_digest' - ).deps; + )?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -781,7 +782,7 @@ describe('modules/manager/dockerfile/extract', () => { it('handles FROM with overwritten ARG value', () => { const res = extractPackageFile( 'ARG base=nginx:1.19\nFROM $base as stage1\nARG base=nginx:1.20\nFROM --platform=amd64 $base as stage2\n' - ).deps; + )?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -809,7 +810,7 @@ describe('modules/manager/dockerfile/extract', () => { it('handles FROM with multiple ARG values', () => { const res = extractPackageFile( 'ARG CUDA=9.2\nARG LINUX_VERSION ubuntu16.04\nFROM nvidia/cuda:${CUDA}-devel-${LINUX_VERSION}\n' - ).deps; + )?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -831,7 +832,7 @@ describe('modules/manager/dockerfile/extract', () => { }); it('extracts images from multi-line ARG statements', () => { - const res = extractPackageFile(d3).deps; + const res = extractPackageFile(d3)?.deps; expect(res).toEqual([ { autoReplaceStringTemplate: @@ -874,7 +875,7 @@ describe('modules/manager/dockerfile/extract', () => { it('ignores parser directives in wrong order', () => { const res = extractPackageFile( '# dummy\n# escape = `\n\nFROM\\\nnginx:1.20' - ).deps; + )?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -891,7 +892,7 @@ describe('modules/manager/dockerfile/extract', () => { }); it('handles an alternative escape character', () => { - const res = extractPackageFile(d4).deps; + const res = extractPackageFile(d4)?.deps; expect(res).toEqual([ { autoReplaceStringTemplate: @@ -953,7 +954,7 @@ describe('modules/manager/dockerfile/extract', () => { it('handles FROM with version in ARG default value and quotes', () => { const res = extractPackageFile( 'ARG REF_NAME=${REF_NAME:-"gcr.io/distroless/static-debian11:nonroot@sha256:abc"}\nfrom ${REF_NAME}' - ).deps; + )?.deps; expect(res).toMatchInlineSnapshot(` Array [ Object { @@ -972,7 +973,7 @@ describe('modules/manager/dockerfile/extract', () => { it('handles version in ARG and digest in FROM with CRLF linefeed', () => { const res = extractPackageFile( 'ARG IMAGE_TAG=14.04\r\n#something unrelated\r\nFROM ubuntu:$IMAGE_TAG@sha256:abc\r\n' - ).deps; + )?.deps; expect(res).toEqual([ { autoReplaceStringTemplate: @@ -998,7 +999,7 @@ describe('modules/manager/dockerfile/extract', () => { 'ARG NODE_IMAGE_TAG="16.14.2-alpine3.14"\n' + 'ARG DUMMY_PREFIX=\n' + 'FROM ${DUMMY_PREFIX}${NODE_IMAGE_HOST}${NODE_IMAGE_NAME}:${NODE_IMAGE_TAG}${NODE_IMAGE_HASH} as yarn\n' - ).deps; + )?.deps; expect(res).toEqual([ { autoReplaceStringTemplate: diff --git a/lib/modules/manager/droneci/extract.spec.ts b/lib/modules/manager/droneci/extract.spec.ts index ca309dc78d1058..97e902236c4e20 100644 --- a/lib/modules/manager/droneci/extract.spec.ts +++ b/lib/modules/manager/droneci/extract.spec.ts @@ -1,6 +1,6 @@ import { Fixtures } from '../../../../test/fixtures'; -import { extractPackageFile } from './extract'; +import { extractPackageFile } from '.'; describe('modules/manager/droneci/extract', () => { describe('extractPackageFile()', () => { @@ -10,8 +10,8 @@ describe('modules/manager/droneci/extract', () => { it('extracts multiple image lines', () => { const res = extractPackageFile(Fixtures.get('.drone.yml')); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(6); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(6); }); }); }); diff --git a/lib/modules/manager/fingerprint.spec.ts b/lib/modules/manager/fingerprint.spec.ts index bf29986163ac10..0060c790ecc370 100644 --- a/lib/modules/manager/fingerprint.spec.ts +++ b/lib/modules/manager/fingerprint.spec.ts @@ -6,7 +6,7 @@ describe('modules/manager/fingerprint', () => { const regex = regEx(/^[a-f0-9]{64}$/i); const managers = getManagers(); for (const [manager] of managers) { - const managerHash = hashMap.get(manager); + const managerHash = hashMap.get(manager)!; expect(regex.test(managerHash)).toBeTrue(); } }); diff --git a/lib/modules/manager/flux/extract.spec.ts b/lib/modules/manager/flux/extract.spec.ts index ced3bd438be2ef..adcc6b451c3f2d 100644 --- a/lib/modules/manager/flux/extract.spec.ts +++ b/lib/modules/manager/flux/extract.spec.ts @@ -55,7 +55,7 @@ describe('modules/manager/flux/extract', () => { `# Flux Version: v0.27.0`, 'clusters/my-cluster/flux-system/gotk-components.yaml' ); - expect(result.deps[0].managerData.components).toBeUndefined(); + expect(result?.deps[0].managerData?.components).toBeUndefined(); }); it('ignores system manifests without a version', () => { @@ -71,7 +71,7 @@ describe('modules/manager/flux/extract', () => { loadFixture('release.yaml'), 'release.yaml' ); - expect(result.deps[0].skipReason).toBe('unknown-registry'); + expect(result?.deps[0].skipReason).toBe('unknown-registry'); }); it('ignores HelmRelease resources without an apiVersion', () => { @@ -93,7 +93,7 @@ kind: HelmRepository `, 'test.yaml' ); - expect(result.deps[0].skipReason).toBe('unknown-registry'); + expect(result?.deps[0].skipReason).toBe('unknown-registry'); }); it('ignores HelmRelease resources without a chart name', () => { @@ -138,7 +138,7 @@ spec: `, 'test.yaml' ); - expect(result.deps[0].skipReason).toBe('unknown-registry'); + expect(result?.deps[0].skipReason).toBe('unknown-registry'); }); it('does not match HelmRelease resources without a sourceRef', () => { @@ -157,7 +157,7 @@ spec: `, 'test.yaml' ); - expect(result.deps[0].skipReason).toBe('unknown-registry'); + expect(result?.deps[0].skipReason).toBe('unknown-registry'); }); it('does not match HelmRelease resources without a namespace', () => { @@ -177,7 +177,7 @@ spec: `, 'test.yaml' ); - expect(result.deps[0].skipReason).toBe('unknown-registry'); + expect(result?.deps[0].skipReason).toBe('unknown-registry'); }); it('ignores HelmRepository resources without a namespace', () => { @@ -191,7 +191,7 @@ metadata: `, 'test.yaml' ); - expect(result.deps[0].skipReason).toBe('unknown-registry'); + expect(result?.deps[0].skipReason).toBe('unknown-registry'); }); it('ignores HelmRepository resources without a URL', () => { @@ -206,7 +206,7 @@ metadata: `, 'test.yaml' ); - expect(result.deps[0].skipReason).toBe('unknown-registry'); + expect(result?.deps[0].skipReason).toBe('unknown-registry'); }); it('ignores resources of an unknown kind', () => { diff --git a/lib/modules/manager/fvm/extract.spec.ts b/lib/modules/manager/fvm/extract.spec.ts index 129f6ead627f70..a078fef294d646 100644 --- a/lib/modules/manager/fvm/extract.spec.ts +++ b/lib/modules/manager/fvm/extract.spec.ts @@ -28,7 +28,7 @@ describe('modules/manager/fvm/extract', () => { '{"flutterSdkVersion": "2.10.1", "flavors": {}}', packageFile ); - expect(res.deps).toEqual([ + expect(res?.deps).toEqual([ { currentValue: '2.10.1', datasource: 'flutter-version', @@ -43,7 +43,7 @@ describe('modules/manager/fvm/extract', () => { '{"flutterSdkVersion": "stable", "flavors": {}}', packageFile ); - expect(res.deps).toEqual([ + expect(res?.deps).toEqual([ { currentValue: 'stable', datasource: 'flutter-version', diff --git a/lib/modules/manager/git-submodules/artifact.spec.ts b/lib/modules/manager/git-submodules/artifact.spec.ts index 806db009b72976..a9e90da76f8a73 100644 --- a/lib/modules/manager/git-submodules/artifact.spec.ts +++ b/lib/modules/manager/git-submodules/artifact.spec.ts @@ -1,4 +1,4 @@ -import updateArtifacts from './artifacts'; +import { updateArtifacts } from '.'; describe('modules/manager/git-submodules/artifact', () => { describe('updateArtifacts()', () => { diff --git a/lib/modules/manager/git-submodules/extract.spec.ts b/lib/modules/manager/git-submodules/extract.spec.ts index fd44c667e35934..020c86bee4c623 100644 --- a/lib/modules/manager/git-submodules/extract.spec.ts +++ b/lib/modules/manager/git-submodules/extract.spec.ts @@ -1,10 +1,10 @@ +import is from '@sindresorhus/is'; import { mock } from 'jest-mock-extended'; -import _simpleGit, { Response, SimpleGit } from 'simple-git'; -import { partial } from '../../../../test/util'; +import _simpleGit, { Response, SimpleGit, TaskOptions } from 'simple-git'; import { GlobalConfig } from '../../../config/global'; import * as hostRules from '../../../util/host-rules'; import type { PackageFile } from '../types'; -import extractPackageFile from './extract'; +import { extractPackageFile } from '.'; jest.mock('simple-git'); const simpleGit: jest.Mock> = _simpleGit as never; @@ -18,27 +18,28 @@ describe('modules/manager/git-submodules/extract', () => { simpleGit.mockImplementation((basePath: string) => { const git = Git(basePath); return { - subModule() { - return partial>( - Promise.resolve('4b825dc642cb6eb9a060e54bf8d69288fbee4904') - ); + subModule(): Response { + return Promise.resolve( + '4b825dc642cb6eb9a060e54bf8d69288fbee4904' + ) as Response; }, - raw(options: string | string[]): Response { - if (options.includes('remote.origin.url')) { - return partial>( - Promise.resolve('https://github.com/renovatebot/renovate.git') - ); + raw(options: string | string[] | TaskOptions): Response { + if ( + (is.string(options) || is.array(options, is.string)) && + options.includes('remote.origin.url') + ) { + return Promise.resolve( + 'https://github.com/renovatebot/renovate.git' + ) as Response; } return git.raw(options); }, listRemote(): Response { - return partial>( - Promise.resolve( - 'ref: refs/heads/main HEAD\n5701164b9f5edba1f6ca114c491a564ffb55a964 HEAD' - ) - ); + return Promise.resolve( + 'ref: refs/heads/main HEAD\n5701164b9f5edba1f6ca114c491a564ffb55a964 HEAD' + ) as Response; }, - ...mock(), + ...mock>(), }; }); }); @@ -47,18 +48,18 @@ describe('modules/manager/git-submodules/extract', () => { it('extracts submodules', async () => { GlobalConfig.set({ localDir: `${__dirname}/__fixtures__` }); hostRules.add({ matchHost: 'github.com', token: '123test' }); - let res: PackageFile; + let res: PackageFile | null; expect(await extractPackageFile('', '.gitmodules.1', {})).toBeNull(); res = await extractPackageFile('', '.gitmodules.2', {}); - expect(res.deps).toHaveLength(1); - expect(res.deps[0].currentValue).toBe('main'); + expect(res?.deps).toHaveLength(1); + expect(res?.deps[0].currentValue).toBe('main'); res = await extractPackageFile('', '.gitmodules.3', {}); - expect(res.deps).toHaveLength(1); + expect(res?.deps).toHaveLength(1); res = await extractPackageFile('', '.gitmodules.4', {}); - expect(res.deps).toHaveLength(1); + expect(res?.deps).toHaveLength(1); res = await extractPackageFile('', '.gitmodules.5', {}); - expect(res.deps).toHaveLength(3); - expect(res.deps[2].packageName).toBe( + expect(res?.deps).toHaveLength(3); + expect(res?.deps[2].packageName).toBe( 'https://github.com/renovatebot/renovate-config.git' ); }); diff --git a/lib/modules/manager/git-submodules/update.spec.ts b/lib/modules/manager/git-submodules/update.spec.ts index e3b5fb3ff40776..a9ef0700134f89 100644 --- a/lib/modules/manager/git-submodules/update.spec.ts +++ b/lib/modules/manager/git-submodules/update.spec.ts @@ -4,7 +4,7 @@ import { join } from 'upath'; import { GlobalConfig } from '../../../config/global'; import type { RepoGlobalConfig } from '../../../config/types'; import type { Upgrade } from '../types'; -import updateDependency from './update'; +import { updateDependency } from '.'; jest.mock('simple-git'); const simpleGit: jest.Mock> = _simpleGit as never; @@ -44,10 +44,10 @@ describe('modules/manager/git-submodules/update', () => { it('returns content on update', async () => { simpleGit.mockReturnValue({ submoduleUpdate() { - return Promise.resolve(null) as Response; + return Promise.resolve('') as Response; }, checkout() { - return Promise.resolve(null) as Response; + return Promise.resolve('') as Response; }, }); const update = await updateDependency({ diff --git a/lib/modules/manager/github-actions/extract.spec.ts b/lib/modules/manager/github-actions/extract.spec.ts index 3dde3933311814..55ce36032ce415 100644 --- a/lib/modules/manager/github-actions/extract.spec.ts +++ b/lib/modules/manager/github-actions/extract.spec.ts @@ -1,5 +1,5 @@ import { Fixtures } from '../../../../test/fixtures'; -import { extractPackageFile } from './extract'; +import { extractPackageFile } from '.'; describe('modules/manager/github-actions/extract', () => { describe('extractPackageFile()', () => { @@ -9,21 +9,23 @@ describe('modules/manager/github-actions/extract', () => { it('extracts multiple docker image lines from yaml configuration file', () => { const res = extractPackageFile(Fixtures.get('workflow_1.yml')); - expect(res.deps).toMatchSnapshot(); - expect(res.deps.filter((d) => d.datasource === 'docker')).toHaveLength(2); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps.filter((d) => d.datasource === 'docker')).toHaveLength( + 2 + ); }); it('extracts multiple action tag lines from yaml configuration file', () => { const res = extractPackageFile(Fixtures.get('workflow_2.yml')); - expect(res.deps).toMatchSnapshot(); + expect(res?.deps).toMatchSnapshot(); expect( - res.deps.filter((d) => d.datasource === 'github-tags') + res?.deps.filter((d) => d.datasource === 'github-tags') ).toHaveLength(8); }); it('extracts multiple action tag lines with double quotes and comments', () => { const res = extractPackageFile(Fixtures.get('workflow_3.yml')); - expect(res.deps).toMatchSnapshot([ + expect(res?.deps).toMatchSnapshot([ { currentValue: 'v0.13.1', datasource: 'github-tags', @@ -77,7 +79,7 @@ describe('modules/manager/github-actions/extract', () => { uses: "actions/setup-java@v2"`; const res = extractPackageFile(yamlContent); - expect(res.deps).toMatchObject([ + expect(res?.deps).toMatchObject([ { depName: 'actions/setup-node', commitMessageTopic: '{{{depName}}} action', diff --git a/lib/modules/manager/gitlabci-include/extract.spec.ts b/lib/modules/manager/gitlabci-include/extract.spec.ts index 1a384e662a359a..4cd1c60567b200 100644 --- a/lib/modules/manager/gitlabci-include/extract.spec.ts +++ b/lib/modules/manager/gitlabci-include/extract.spec.ts @@ -1,6 +1,6 @@ import { loadFixture } from '../../../../test/util'; import { GlobalConfig } from '../../../config/global'; -import { extractPackageFile } from './extract'; +import { extractPackageFile } from '.'; const yamlFileMultiConfig = loadFixture('gitlab-ci.1.yaml'); const yamlFileSingleConfig = loadFixture('gitlab-ci.2.yaml'); @@ -19,14 +19,14 @@ describe('modules/manager/gitlabci-include/extract', () => { it('extracts single include block', () => { const res = extractPackageFile(yamlFileSingleConfig); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(1); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(1); }); it('extracts multiple include blocks', () => { const res = extractPackageFile(yamlFileMultiConfig); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(3); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(3); }); it('normalizes configured endpoints', () => { @@ -38,7 +38,7 @@ describe('modules/manager/gitlabci-include/extract', () => { for (const endpoint of endpoints) { GlobalConfig.set({ platform: 'gitlab', endpoint }); const res = extractPackageFile(yamlFileMultiConfig); - expect(res.deps[0].registryUrls[0]).toBe('http://gitlab.test'); + expect(res?.deps[0].registryUrls).toEqual(['http://gitlab.test']); } }); }); diff --git a/lib/modules/manager/gitlabci/extract.spec.ts b/lib/modules/manager/gitlabci/extract.spec.ts index 16d19ea37b9e59..fb66a99062ed8d 100644 --- a/lib/modules/manager/gitlabci/extract.spec.ts +++ b/lib/modules/manager/gitlabci/extract.spec.ts @@ -45,7 +45,7 @@ describe('modules/manager/gitlabci/extract', () => { expect(res).toHaveLength(3); const deps: PackageDependency[] = []; - res.forEach((e) => { + res?.forEach((e) => { e.deps.forEach((d) => { deps.push(d); }); @@ -59,7 +59,7 @@ describe('modules/manager/gitlabci/extract', () => { ]); expect(res).toMatchSnapshot(); expect(res).toHaveLength(1); - expect(res[0].deps).toHaveLength(3); + expect(res?.[0].deps).toHaveLength(3); }); it('extracts multiple named services', async () => { @@ -68,7 +68,7 @@ describe('modules/manager/gitlabci/extract', () => { ]); expect(res).toMatchSnapshot(); expect(res).toHaveLength(1); - expect(res[0].deps).toHaveLength(10); + expect(res?.[0].deps).toHaveLength(10); }); it('extracts multiple image lines', async () => { @@ -79,14 +79,16 @@ describe('modules/manager/gitlabci/extract', () => { expect(res).toHaveLength(1); const deps: PackageDependency[] = []; - res.forEach((e) => { + res?.forEach((e) => { e.deps.forEach((d) => { deps.push(d); }); }); expect(deps).toHaveLength(8); - expect(deps.some((dep) => dep.currentValue.includes("'"))).toBeFalse(); + // TODO #7154 + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + expect(deps.some((dep) => dep.currentValue!.includes("'"))).toBeFalse(); }); it('extracts multiple image lines with comments', async () => { @@ -97,7 +99,7 @@ describe('modules/manager/gitlabci/extract', () => { expect(res).toHaveLength(1); const deps: PackageDependency[] = []; - res.forEach((e) => { + res?.forEach((e) => { e.deps.forEach((d) => { deps.push(d); }); @@ -177,7 +179,7 @@ describe('modules/manager/gitlabci/extract', () => { - name: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/other/image1:1.0.0 alias: imagealias1 `); - expect(res.deps).toEqual([ + expect(res?.deps).toEqual([ { autoReplaceStringTemplate: '${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/' + diff --git a/lib/modules/manager/gomod/artifacts.spec.ts b/lib/modules/manager/gomod/artifacts.spec.ts index cae9a08625d78d..e9e28f0f830d7b 100644 --- a/lib/modules/manager/gomod/artifacts.spec.ts +++ b/lib/modules/manager/gomod/artifacts.spec.ts @@ -8,7 +8,7 @@ import * as docker from '../../../util/exec/docker'; import type { StatusResult } from '../../../util/git/types'; import * as _hostRules from '../../../util/host-rules'; import type { UpdateArtifactsConfig } from '../types'; -import * as gomod from './artifacts'; +import * as gomod from '.'; jest.mock('child_process'); jest.mock('../../../util/exec/env'); @@ -89,10 +89,11 @@ describe('modules/manager/gomod/artifacts', () => { it('returns null if unchanged', async () => { fs.readLocalFile.mockResolvedValueOnce('Current go.sum'); - fs.readLocalFile.mockResolvedValueOnce(null); // vendor modules filename + // TODO: #7154 can be null + fs.readLocalFile.mockResolvedValueOnce(null as never); // vendor modules filename const execSnapshots = mockExecAll(exec); git.getRepoStatus.mockResolvedValueOnce({ - modified: [], + modified: [] as string[], } as StatusResult); expect( @@ -108,7 +109,8 @@ describe('modules/manager/gomod/artifacts', () => { it('returns updated go.sum', async () => { fs.readLocalFile.mockResolvedValueOnce('Current go.sum'); - fs.readLocalFile.mockResolvedValueOnce(null); // vendor modules filename + // TODO: #7154 can be null + fs.readLocalFile.mockResolvedValueOnce(null as never); // vendor modules filename const execSnapshots = mockExecAll(exec); git.getRepoStatus.mockResolvedValueOnce({ modified: ['go.sum'], @@ -165,7 +167,8 @@ describe('modules/manager/gomod/artifacts', () => { it('supports docker mode without credentials', async () => { GlobalConfig.set({ ...adminConfig, binarySource: 'docker' }); fs.readLocalFile.mockResolvedValueOnce('Current go.sum'); - fs.readLocalFile.mockResolvedValueOnce(null); // vendor modules filename + // TODO: #7154 can be null + fs.readLocalFile.mockResolvedValueOnce(null as never); // vendor modules filename const execSnapshots = mockExecAll(exec); git.getRepoStatus.mockResolvedValueOnce({ modified: ['go.sum'], @@ -185,7 +188,8 @@ describe('modules/manager/gomod/artifacts', () => { it('supports global mode', async () => { GlobalConfig.set({ ...adminConfig, binarySource: 'global' }); fs.readLocalFile.mockResolvedValueOnce('Current go.sum'); - fs.readLocalFile.mockResolvedValueOnce(null); // vendor modules filename + // TODO: #7154 can be null + fs.readLocalFile.mockResolvedValueOnce(null as never); // vendor modules filename const execSnapshots = mockExecAll(exec); git.getRepoStatus.mockResolvedValueOnce({ modified: ['go.sum'], @@ -208,7 +212,8 @@ describe('modules/manager/gomod/artifacts', () => { token: 'some-token', }); fs.readLocalFile.mockResolvedValueOnce('Current go.sum'); - fs.readLocalFile.mockResolvedValueOnce(null); // vendor modules filename + // TODO: #7154 can be null + fs.readLocalFile.mockResolvedValueOnce(null as never); // vendor modules filename const execSnapshots = mockExecAll(exec); git.getRepoStatus.mockResolvedValueOnce({ modified: ['go.sum'], @@ -238,7 +243,8 @@ describe('modules/manager/gomod/artifacts', () => { }, ]); fs.readLocalFile.mockResolvedValueOnce('Current go.sum'); - fs.readLocalFile.mockResolvedValueOnce(null); // vendor modules filename + // TODO: #7154 can be null + fs.readLocalFile.mockResolvedValueOnce(null as never); // vendor modules filename const execSnapshots = mockExecAll(exec); git.getRepoStatus.mockResolvedValueOnce({ modified: ['go.sum'], @@ -292,7 +298,8 @@ describe('modules/manager/gomod/artifacts', () => { }, ]); fs.readLocalFile.mockResolvedValueOnce('Current go.sum'); - fs.readLocalFile.mockResolvedValueOnce(null); // vendor modules filename + // TODO: #7154 can be null + fs.readLocalFile.mockResolvedValueOnce(null as never); // vendor modules filename const execSnapshots = mockExecAll(exec); git.getRepoStatus.mockResolvedValueOnce({ modified: ['go.sum'], @@ -343,7 +350,8 @@ describe('modules/manager/gomod/artifacts', () => { }, ]); fs.readLocalFile.mockResolvedValueOnce('Current go.sum'); - fs.readLocalFile.mockResolvedValueOnce(null); // vendor modules filename + // TODO: #7154 can be null + fs.readLocalFile.mockResolvedValueOnce(null as never); // vendor modules filename const execSnapshots = mockExecAll(exec); git.getRepoStatus.mockResolvedValueOnce({ modified: ['go.sum'], @@ -403,7 +411,8 @@ describe('modules/manager/gomod/artifacts', () => { }, ]); fs.readLocalFile.mockResolvedValueOnce('Current go.sum'); - fs.readLocalFile.mockResolvedValueOnce(null); // vendor modules filename + // TODO: #7154 can be null + fs.readLocalFile.mockResolvedValueOnce(null as never); // vendor modules filename const execSnapshots = mockExecAll(exec); git.getRepoStatus.mockResolvedValueOnce({ modified: ['go.sum'], @@ -462,7 +471,8 @@ describe('modules/manager/gomod/artifacts', () => { }, ]); fs.readLocalFile.mockResolvedValueOnce('Current go.sum'); - fs.readLocalFile.mockResolvedValueOnce(null); // vendor modules filename + // TODO: #7154 can be null + fs.readLocalFile.mockResolvedValueOnce(null as never); // vendor modules filename const execSnapshots = mockExecAll(exec); git.getRepoStatus.mockResolvedValueOnce({ modified: ['go.sum'], @@ -537,7 +547,8 @@ describe('modules/manager/gomod/artifacts', () => { }, ]); fs.readLocalFile.mockResolvedValueOnce('Current go.sum'); - fs.readLocalFile.mockResolvedValueOnce(null); // vendor modules filename + // TODO: #7154 can be null + fs.readLocalFile.mockResolvedValueOnce(null as never); // vendor modules filename const execSnapshots = mockExecAll(exec); git.getRepoStatus.mockResolvedValueOnce({ modified: ['go.sum'], @@ -576,7 +587,8 @@ describe('modules/manager/gomod/artifacts', () => { GlobalConfig.set({ ...adminConfig, binarySource: 'docker' }); hostRules.find.mockReturnValueOnce({}); fs.readLocalFile.mockResolvedValueOnce('Current go.sum'); - fs.readLocalFile.mockResolvedValueOnce(null); // vendor modules filename + // TODO: #7154 can be null + fs.readLocalFile.mockResolvedValueOnce(null as never); // vendor modules filename const execSnapshots = mockExecAll(exec); git.getRepoStatus.mockResolvedValueOnce({ modified: ['go.sum'], @@ -603,7 +615,8 @@ describe('modules/manager/gomod/artifacts', () => { GlobalConfig.set({ ...adminConfig, binarySource: 'docker' }); hostRules.find.mockReturnValueOnce({}); fs.readLocalFile.mockResolvedValueOnce('Current go.sum'); - fs.readLocalFile.mockResolvedValueOnce(null); // vendor modules filename + // TODO: #7154 can be null + fs.readLocalFile.mockResolvedValueOnce(null as never); // vendor modules filename const execSnapshots = mockExecAll(exec); git.getRepoStatus.mockResolvedValueOnce({ modified: ['go.sum'], @@ -629,7 +642,8 @@ describe('modules/manager/gomod/artifacts', () => { it('catches errors', async () => { const execSnapshots = mockExecAll(exec); fs.readLocalFile.mockResolvedValueOnce('Current go.sum'); - fs.readLocalFile.mockResolvedValueOnce(null); // vendor modules filename + // TODO: #7154 can be null + fs.readLocalFile.mockResolvedValueOnce(null as never); // vendor modules filename fs.writeLocalFile.mockImplementationOnce(() => { throw new Error('This update totally doesnt work'); }); @@ -653,7 +667,8 @@ describe('modules/manager/gomod/artifacts', () => { it('updates import paths with gomodUpdateImportPaths', async () => { fs.readLocalFile.mockResolvedValueOnce('Current go.sum'); - fs.readLocalFile.mockResolvedValueOnce(null); // vendor modules filename + // TODO: #7154 can be null + fs.readLocalFile.mockResolvedValueOnce(null as never); // vendor modules filename const execSnapshots = mockExecAll(exec); git.getRepoStatus.mockResolvedValueOnce({ modified: ['go.sum', 'main.go'], @@ -684,7 +699,8 @@ describe('modules/manager/gomod/artifacts', () => { it('skips updating import paths with gomodUpdateImportPaths on v0 to v1', async () => { fs.readLocalFile.mockResolvedValueOnce('Current go.sum'); - fs.readLocalFile.mockResolvedValueOnce(null); // vendor modules filename + // TODO: #7154 can be null + fs.readLocalFile.mockResolvedValueOnce(null as never); // vendor modules filename const execSnapshots = mockExecAll(exec); git.getRepoStatus.mockResolvedValueOnce({ modified: ['go.sum', 'main.go'], @@ -713,7 +729,8 @@ describe('modules/manager/gomod/artifacts', () => { it('skips gomodTidy without gomodUpdateImportPaths on major update', async () => { fs.readLocalFile.mockResolvedValueOnce('Current go.sum'); - fs.readLocalFile.mockResolvedValueOnce(null); // vendor modules filename + // TODO: #7154 can be null + fs.readLocalFile.mockResolvedValueOnce(null as never); // vendor modules filename const execSnapshots = mockExecAll(exec); git.getRepoStatus.mockResolvedValueOnce({ modified: ['go.sum', 'main.go'], @@ -740,7 +757,8 @@ describe('modules/manager/gomod/artifacts', () => { it('does not execute go mod tidy when none of gomodTidy and gomodUpdateImportPaths are set', async () => { fs.readLocalFile.mockResolvedValueOnce('Current go.sum'); - fs.readLocalFile.mockResolvedValueOnce(null); // vendor modules filename + // TODO: #7154 can be null + fs.readLocalFile.mockResolvedValueOnce(null as never); // vendor modules filename const execSnapshots = mockExecAll(exec); git.getRepoStatus.mockResolvedValueOnce({ modified: ['go.sum', 'main.go'], @@ -766,7 +784,8 @@ describe('modules/manager/gomod/artifacts', () => { it('updates import paths with specific tool version from constraint', async () => { fs.readLocalFile.mockResolvedValueOnce('Current go.sum'); - fs.readLocalFile.mockResolvedValueOnce(null); // vendor modules filename + // TODO: #7154 can be null + fs.readLocalFile.mockResolvedValueOnce(null as never); // vendor modules filename const execSnapshots = mockExecAll(exec); git.getRepoStatus.mockResolvedValueOnce({ modified: ['go.sum', 'main.go'], @@ -800,7 +819,8 @@ describe('modules/manager/gomod/artifacts', () => { it('updates import paths with latest tool version on invalid version constraint', async () => { fs.readLocalFile.mockResolvedValueOnce('Current go.sum'); - fs.readLocalFile.mockResolvedValueOnce(null); // vendor modules filename + // TODO: #7154 can be null + fs.readLocalFile.mockResolvedValueOnce(null as never); // vendor modules filename const execSnapshots = mockExecAll(exec); git.getRepoStatus.mockResolvedValueOnce({ modified: ['go.sum', 'main.go'], @@ -834,7 +854,8 @@ describe('modules/manager/gomod/artifacts', () => { it('skips updating import paths for gopkg.in dependencies', async () => { fs.readLocalFile.mockResolvedValueOnce('Current go.sum'); - fs.readLocalFile.mockResolvedValueOnce(null); // vendor modules filename + // TODO: #7154 can be null + fs.readLocalFile.mockResolvedValueOnce(null as never); // vendor modules filename const execSnapshots = mockExecAll(exec); git.getRepoStatus.mockResolvedValueOnce({ modified: ['go.sum'], diff --git a/lib/modules/manager/gomod/extract.spec.ts b/lib/modules/manager/gomod/extract.spec.ts index 42d332dfe50c4f..9b5f274e510edd 100644 --- a/lib/modules/manager/gomod/extract.spec.ts +++ b/lib/modules/manager/gomod/extract.spec.ts @@ -1,5 +1,5 @@ import { Fixtures } from '../../../../test/fixtures'; -import { extractPackageFile } from './extract'; +import { extractPackageFile } from '.'; const gomod1 = Fixtures.get('1/go.mod'); const gomod2 = Fixtures.get('2/go.mod'); @@ -12,24 +12,24 @@ describe('modules/manager/gomod/extract', () => { }); it('extracts single-line requires', () => { - const res = extractPackageFile(gomod1).deps; + const res = extractPackageFile(gomod1)?.deps; expect(res).toMatchSnapshot(); expect(res).toHaveLength(8); - expect(res.filter((e) => e.skipReason)).toHaveLength(1); - expect(res.filter((e) => e.depType === 'replace')).toHaveLength(1); + expect(res?.filter((e) => e.skipReason)).toHaveLength(1); + expect(res?.filter((e) => e.depType === 'replace')).toHaveLength(1); }); it('extracts constraints', () => { const res = extractPackageFile(gomod3); expect(res).toMatchSnapshot(); - expect(res.constraints.go).toBe('^1.13'); + expect(res?.constraints?.go).toBe('^1.13'); }); it('extracts multi-line requires', () => { - const res = extractPackageFile(gomod2).deps; + const res = extractPackageFile(gomod2)?.deps; expect(res).toMatchSnapshot(); expect(res).toHaveLength(58); - expect(res.filter((e) => e.skipReason)).toHaveLength(0); + expect(res?.filter((e) => e.skipReason)).toHaveLength(0); }); }); }); diff --git a/lib/modules/manager/gomod/update.spec.ts b/lib/modules/manager/gomod/update.spec.ts index 0142d85ee990a6..fcb98a41470ca5 100644 --- a/lib/modules/manager/gomod/update.spec.ts +++ b/lib/modules/manager/gomod/update.spec.ts @@ -1,6 +1,6 @@ import { Fixtures } from '../../../../test/fixtures'; import type { UpdateType } from '../../../config/types'; -import { updateDependency } from './update'; +import { updateDependency } from '.'; const gomod1 = Fixtures.get('1/go.mod'); const gomod2 = Fixtures.get('2/go.mod'); @@ -30,6 +30,7 @@ describe('modules/manager/gomod/update', () => { fileContent: gomod1, upgrade: upgrade1, }); + expect(res1).toBeString(); expect(res1).not.toEqual(gomod1); expect(res1).toContain(upgrade1.newValue); const upgrade2 = { @@ -39,7 +40,8 @@ describe('modules/manager/gomod/update', () => { depType: 'require', }; const res2 = updateDependency({ - fileContent: res1, + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + fileContent: res1!, upgrade: upgrade2, }); expect(res2).not.toEqual(res1); @@ -113,7 +115,11 @@ describe('modules/manager/gomod/update', () => { }); it('returns null if error', () => { - const res = updateDependency({ fileContent: null, upgrade: null }); + // TODO: #7154 bad test, uses invalid null to throwing nullref error + const res = updateDependency({ + fileContent: null as never, + upgrade: null as never, + }); expect(res).toBeNull(); }); @@ -302,7 +308,7 @@ describe('modules/manager/gomod/update', () => { it('should return null for replacement', () => { const res = updateDependency({ - fileContent: undefined, + fileContent: '', upgrade: { updateType: 'replacement' }, }); expect(res).toBeNull(); diff --git a/lib/modules/manager/gradle-wrapper/artifacts-real.spec.ts b/lib/modules/manager/gradle-wrapper/artifacts-real.spec.ts index 342cb73c06065a..7f065643807a3a 100644 --- a/lib/modules/manager/gradle-wrapper/artifacts-real.spec.ts +++ b/lib/modules/manager/gradle-wrapper/artifacts-real.spec.ts @@ -111,7 +111,7 @@ describe('modules/manager/gradle-wrapper/artifacts-real', () => { }); expect(result).toHaveLength(1); - expect(result[0].artifactError).toBeUndefined(); + expect(result?.[0].artifactError).toBeUndefined(); await compareFile( 'gradle/wrapper/gradle-wrapper.properties', @@ -120,9 +120,11 @@ describe('modules/manager/gradle-wrapper/artifacts-real', () => { }); it('up to date', async () => { - git.getRepoStatus.mockResolvedValue({ - modified: [], - } as StatusResult); + git.getRepoStatus.mockResolvedValue( + partial({ + modified: [], + }) + ); const res = await gradleWrapper.updateArtifacts({ packageFileName: 'gradle/wrapper/gradle-wrapper.properties', @@ -157,10 +159,10 @@ describe('modules/manager/gradle-wrapper/artifacts-real', () => { config, }); - expect(res[0].artifactError.lockFile).toBe( + expect(res?.[0].artifactError?.lockFile).toBe( 'gradle/wrapper/gradle-wrapper.properties' ); - expect(res[0].artifactError.stderr).toBe('failed'); + expect(res?.[0].artifactError?.stderr).toBe('failed'); // 5.6.4 => 5.6.4 (updates execs) - unexpected behavior (looks like a bug in Gradle) for (const file of ['gradle/wrapper/gradle-wrapper.properties']) { @@ -184,11 +186,11 @@ describe('modules/manager/gradle-wrapper/artifacts-real', () => { config, }); - expect(res[0].artifactError.lockFile).toBe( + expect(res?.[0].artifactError?.lockFile).toBe( 'gradle/wrapper/gradle-wrapper.properties' ); - expect(res[0].artifactError.stderr).not.toBeNull(); - expect(res[0].artifactError.stderr).not.toBe(''); + expect(res?.[0].artifactError?.stderr).not.toBeNull(); + expect(res?.[0].artifactError?.stderr).not.toBe(''); // 5.6.4 => 5.6.4 (updates execs) - unexpected behavior (looks like a bug in Gradle) for (const file of ['gradle/wrapper/gradle-wrapper.properties']) { @@ -201,7 +203,7 @@ describe('modules/manager/gradle-wrapper/artifacts-real', () => { const res = await gradleWrapper.updateArtifacts({ packageFileName: 'gradle-wrapper.properties', updatedDeps: [], - newPackageFileContent: undefined, + newPackageFileContent: undefined as never, // TODO #7154 config: {}, }); @@ -240,11 +242,13 @@ describe('modules/manager/gradle-wrapper/artifacts-real', () => { }); expect(result).toHaveLength(1); - expect(result[0].artifactError).toBeUndefined(); + expect(result?.[0].artifactError).toBeUndefined(); expect( await readString( - adminConfig.localDir, + // TODO #7154 + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + adminConfig.localDir!, `gradle/wrapper/gradle-wrapper.properties` ) ).toEqual(newContent); diff --git a/lib/modules/manager/gradle-wrapper/artifacts.spec.ts b/lib/modules/manager/gradle-wrapper/artifacts.spec.ts index 0ae93581286648..9551f9d27e6ffd 100644 --- a/lib/modules/manager/gradle-wrapper/artifacts.spec.ts +++ b/lib/modules/manager/gradle-wrapper/artifacts.spec.ts @@ -102,7 +102,7 @@ describe('modules/manager/gradle-wrapper/artifacts', () => { const res = await gradleWrapper.updateArtifacts({ packageFileName: 'gradle-wrapper.properties', updatedDeps: [], - newPackageFileContent: undefined, + newPackageFileContent: '', config: {}, }); @@ -155,7 +155,7 @@ describe('modules/manager/gradle-wrapper/artifacts', () => { }); expect(result).toHaveLength(1); - expect(result[0].artifactError).toBeUndefined(); + expect(result?.[0].artifactError).toBeUndefined(); expect(execSnapshots).toMatchSnapshot(); }); diff --git a/lib/modules/manager/gradle-wrapper/extract.spec.ts b/lib/modules/manager/gradle-wrapper/extract.spec.ts index 7d249adef8b695..6d642f77dc3612 100644 --- a/lib/modules/manager/gradle-wrapper/extract.spec.ts +++ b/lib/modules/manager/gradle-wrapper/extract.spec.ts @@ -1,5 +1,5 @@ import { loadFixture } from '../../../../test/util'; -import { extractPackageFile } from './extract'; +import { extractPackageFile } from '.'; const typeBinFileContent = loadFixture('gradle-wrapper-bin.properties'); const typeAllFileContent = loadFixture('gradle-wrapper-all.properties'); @@ -32,7 +32,7 @@ describe('modules/manager/gradle-wrapper/extract', () => { it('extracts version for property file with distribution type "bin" in distributionUrl', () => { const res = extractPackageFile(typeBinFileContent); - expect(res.deps).toEqual([ + expect(res?.deps).toEqual([ { currentValue: '4.8', replaceString: @@ -46,7 +46,7 @@ describe('modules/manager/gradle-wrapper/extract', () => { it('extracts version for property file with distribution type "all" in distributionUrl', () => { const res = extractPackageFile(typeAllFileContent); - expect(res.deps).toEqual([ + expect(res?.deps).toEqual([ { currentValue: '4.10.3', replaceString: @@ -60,7 +60,7 @@ describe('modules/manager/gradle-wrapper/extract', () => { it('extracts version for property file with prerelease version in distributionUrl', () => { const res = extractPackageFile(prereleaseVersionFileContent); - expect(res.deps).toEqual([ + expect(res?.deps).toEqual([ { currentValue: '7.0-milestone-1', replaceString: @@ -74,7 +74,7 @@ describe('modules/manager/gradle-wrapper/extract', () => { it('extracts version for property file with unnecessary whitespace in distributionUrl', () => { const res = extractPackageFile(whitespacePropertiesFile); - expect(res.deps).toEqual([ + expect(res?.deps).toEqual([ { currentValue: '4.10.3', replaceString: @@ -88,7 +88,7 @@ describe('modules/manager/gradle-wrapper/extract', () => { it('extracts version for property file with custom distribution of type "bin" in distributionUrl', () => { const res = extractPackageFile(customTypeBinFileContent); - expect(res.deps).toEqual([ + expect(res?.deps).toEqual([ { currentValue: '1.3.7', replaceString: @@ -102,7 +102,7 @@ describe('modules/manager/gradle-wrapper/extract', () => { it('extracts version for property file with custom distribution of type "all" in distributionUrl', () => { const res = extractPackageFile(customTypeAllFileContent); - expect(res.deps).toEqual([ + expect(res?.deps).toEqual([ { currentValue: '6.6.6', replaceString: diff --git a/lib/modules/manager/gradle-wrapper/util.spec.ts b/lib/modules/manager/gradle-wrapper/util.spec.ts index abdda4ab6e4dac..108d2dde6f7101 100644 --- a/lib/modules/manager/gradle-wrapper/util.spec.ts +++ b/lib/modules/manager/gradle-wrapper/util.spec.ts @@ -4,12 +4,12 @@ import { extractGradleVersion, getJavaContraint } from './utils'; describe('modules/manager/gradle-wrapper/util', () => { describe('getJavaContraint()', () => { it('return null for global mode', () => { - expect(getJavaContraint(undefined)).toBeNull(); + expect(getJavaContraint('6')).toBeNull(); }); it('return ^11.0.0 for docker mode and undefined gradle', () => { GlobalConfig.set({ binarySource: 'docker' }); - expect(getJavaContraint(undefined)).toBe('^11.0.0'); + expect(getJavaContraint('')).toBe('^11.0.0'); }); it('return ^8.0.0 for docker gradle < 5', () => { @@ -30,7 +30,8 @@ describe('modules/manager/gradle-wrapper/util', () => { describe('extractGradleVersion()', () => { it('works for undefined', () => { - expect(extractGradleVersion(undefined)).toBeNull(); + // TODO #7154 + expect(extractGradleVersion(undefined as never)).toBeNull(); }); }); }); diff --git a/lib/modules/manager/gradle/extract.spec.ts b/lib/modules/manager/gradle/extract.spec.ts index 22f0f566302412..88ad473a74ccd3 100644 --- a/lib/modules/manager/gradle/extract.spec.ts +++ b/lib/modules/manager/gradle/extract.spec.ts @@ -85,7 +85,7 @@ describe('modules/manager/gradle/extract', () => { mockFs({ 'gradle.properties': 'baz=1.2.3', 'build.gradle': 'url "https://example.com"; "foo:bar:$baz@zip"', - 'settings.gradle': null, + 'settings.gradle': null as never, // TODO: #7154 }); const res = await extractAllPackageFiles({} as ExtractConfig, [ diff --git a/lib/modules/manager/gradle/parser.spec.ts b/lib/modules/manager/gradle/parser.spec.ts index 156b5f8de93ac9..e518d26c857188 100644 --- a/lib/modules/manager/gradle/parser.spec.ts +++ b/lib/modules/manager/gradle/parser.spec.ts @@ -140,7 +140,9 @@ describe('modules/manager/gradle/parser', () => { const { deps } = parseGradle(content); const [res] = deps; const idx = content - .slice(res.managerData.fileReplacePosition) + // TODO #7154 + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + .slice(res.managerData!.fileReplacePosition) .indexOf('1.2.3'); expect(idx).toBe(0); }); @@ -149,7 +151,9 @@ describe('modules/manager/gradle/parser', () => { const content = Fixtures.get('build.gradle.example1'); const { deps } = parseGradle(content, {}, 'build.gradle'); const replacementIndices = deps.map(({ managerData, currentValue }) => - content.slice(managerData.fileReplacePosition).indexOf(currentValue) + // TODO #7154 + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + content.slice(managerData!.fileReplacePosition).indexOf(currentValue!) ); expect(replacementIndices.every((idx) => idx === 0)).toBeTrue(); expect(deps).toMatchSnapshot(); diff --git a/lib/modules/manager/gradle/tokenizer.spec.ts b/lib/modules/manager/gradle/tokenizer.spec.ts index ff5cd3519aab5c..1095e7f6596083 100644 --- a/lib/modules/manager/gradle/tokenizer.spec.ts +++ b/lib/modules/manager/gradle/tokenizer.spec.ts @@ -1,7 +1,7 @@ import { TokenType } from './common'; import { extractRawTokens, tokenize } from './tokenizer'; -function tokenTypes(input): string[] { +function tokenTypes(input: string): string[] { return extractRawTokens(input).map((token) => token.type); } diff --git a/lib/modules/manager/gradle/update.spec.ts b/lib/modules/manager/gradle/update.spec.ts index 7a652f40f1dc26..37433305245e62 100644 --- a/lib/modules/manager/gradle/update.spec.ts +++ b/lib/modules/manager/gradle/update.spec.ts @@ -78,7 +78,7 @@ describe('modules/manager/gradle/update', () => { it('should return null for replacement', () => { const res = updateDependency({ - fileContent: undefined, + fileContent: '', upgrade: { updateType: 'replacement' }, }); expect(res).toBeNull(); diff --git a/lib/modules/manager/gradle/utils.spec.ts b/lib/modules/manager/gradle/utils.spec.ts index 54be14d032618d..fb67a13b482e6e 100644 --- a/lib/modules/manager/gradle/utils.spec.ts +++ b/lib/modules/manager/gradle/utils.spec.ts @@ -1,4 +1,5 @@ import { TokenType } from './common'; +import type { VariableRegistry } from './types'; import { getVars, interpolateString, @@ -176,7 +177,7 @@ describe('modules/manager/gradle/utils', () => { }); it('getVars', () => { - const registry = { + const registry: VariableRegistry = { [toAbsolutePath('/foo')]: { foo: { key: 'foo', value: 'FOO' } as never, bar: { key: 'bar', value: 'BAR' } as never, diff --git a/lib/modules/manager/gradle/utils.ts b/lib/modules/manager/gradle/utils.ts index a3c1febfae35c1..bcaad4c15ecef4 100644 --- a/lib/modules/manager/gradle/utils.ts +++ b/lib/modules/manager/gradle/utils.ts @@ -17,7 +17,9 @@ const versionLikeRegex = regEx('^(?[-.\\[\\](),a-zA-Z0-9+]+)'); // Extracts version-like and range-like strings // from the beginning of input -export function versionLikeSubstring(input: string): string | null { +export function versionLikeSubstring( + input: string | null | undefined +): string | null { const match = input ? versionLikeRegex.exec(input) : null; return match?.groups?.version ?? null; } diff --git a/lib/modules/manager/helm-requirements/extract.spec.ts b/lib/modules/manager/helm-requirements/extract.spec.ts index ad90c0c4387e09..ebb9748a1916e4 100644 --- a/lib/modules/manager/helm-requirements/extract.spec.ts +++ b/lib/modules/manager/helm-requirements/extract.spec.ts @@ -1,5 +1,5 @@ import { fs } from '../../../../test/util'; -import { extractPackageFile } from './extract'; +import { extractPackageFile } from '.'; jest.mock('../../../util/fs'); @@ -31,9 +31,9 @@ describe('modules/manager/helm-requirements/extract', () => { }, }); expect(result).not.toBeNull(); - expect(typeof result.deps[0]?.currentValue).toBe('string'); + expect(result?.deps[0]?.currentValue).toBeString(); expect(result).toMatchSnapshot(); - expect(result.deps.every((dep) => dep.skipReason)).toBe(true); + expect(result?.deps.every((dep) => dep.skipReason)).toBe(true); }); it('skips invalid registry urls', () => { @@ -63,7 +63,7 @@ describe('modules/manager/helm-requirements/extract', () => { }); expect(result).not.toBeNull(); expect(result).toMatchSnapshot(); - expect(result.deps.every((dep) => dep.skipReason)).toBe(true); + expect(result?.deps.every((dep) => dep.skipReason)).toBe(true); }); it('parses simple requirements.yaml correctly', () => { @@ -140,7 +140,7 @@ describe('modules/manager/helm-requirements/extract', () => { }); expect(result).not.toBeNull(); expect(result).toMatchSnapshot(); - expect(result.deps.every((dep) => dep.skipReason)).toBe(false); + expect(result?.deps.every((dep) => dep.skipReason)).toBe(false); }); it('skips local dependencies', () => { diff --git a/lib/modules/manager/helm-values/extract.spec.ts b/lib/modules/manager/helm-values/extract.spec.ts index 9ab2ef5afc872e..9ba7962e3bb05b 100644 --- a/lib/modules/manager/helm-values/extract.spec.ts +++ b/lib/modules/manager/helm-values/extract.spec.ts @@ -1,5 +1,5 @@ import { loadFixture } from '../../../../test/util'; -import { extractPackageFile } from './extract'; +import { extractPackageFile } from '.'; const helmDefaultChartInitValues = loadFixture( 'default_chart_init_values.yaml' @@ -25,11 +25,6 @@ describe('modules/manager/helm-values/extract', () => { expect(result).toBeNull(); }); - it('returns null for no file content', () => { - const result = extractPackageFile(null); - expect(result).toBeNull(); - }); - it('extracts from values.yaml correctly with same structure as "helm create"', () => { const result = extractPackageFile(helmDefaultChartInitValues); expect(result).toMatchSnapshot({ @@ -45,7 +40,7 @@ describe('modules/manager/helm-values/extract', () => { it('extracts from complex values file correctly"', () => { const result = extractPackageFile(helmMultiAndNestedImageValues); expect(result).toMatchSnapshot(); - expect(result.deps).toHaveLength(5); + expect(result?.deps).toHaveLength(5); }); }); }); diff --git a/lib/modules/manager/helmfile/extract.spec.ts b/lib/modules/manager/helmfile/extract.spec.ts index 89f4560a2b546e..e304e919d5bef7 100644 --- a/lib/modules/manager/helmfile/extract.spec.ts +++ b/lib/modules/manager/helmfile/extract.spec.ts @@ -57,7 +57,7 @@ describe('modules/manager/helmfile/extract', () => { }); expect(result).not.toBeNull(); expect(result).toMatchSnapshot(); - expect(result.deps.every((dep) => dep.skipReason)).toBeTruthy(); + expect(result?.deps.every((dep) => dep.skipReason)).toBeTruthy(); }); it('skip templetized release with invalid characters', () => { @@ -112,7 +112,7 @@ describe('modules/manager/helmfile/extract', () => { }); expect(result).not.toBeNull(); expect(result).toMatchSnapshot(); - expect(result.deps.every((dep) => dep.skipReason)).toBeTruthy(); + expect(result?.deps.every((dep) => dep.skipReason)).toBeTruthy(); }); it('skip chart with unknown repository', () => { @@ -133,7 +133,7 @@ describe('modules/manager/helmfile/extract', () => { }); expect(result).not.toBeNull(); expect(result).toMatchSnapshot(); - expect(result.deps.every((dep) => dep.skipReason)).toBeTruthy(); + expect(result?.deps.every((dep) => dep.skipReason)).toBeTruthy(); }); it('skip chart with special character in the name', () => { @@ -157,7 +157,7 @@ describe('modules/manager/helmfile/extract', () => { }); expect(result).not.toBeNull(); expect(result).toMatchSnapshot(); - expect(result.deps.every((dep) => dep.skipReason)).toBeTruthy(); + expect(result?.deps.every((dep) => dep.skipReason)).toBeTruthy(); }); it('skip chart that does not have specified version', () => { @@ -177,7 +177,7 @@ describe('modules/manager/helmfile/extract', () => { }); expect(result).not.toBeNull(); expect(result).toMatchSnapshot(); - expect(result.deps.every((dep) => dep.skipReason)).toBeTruthy(); + expect(result?.deps.every((dep) => dep.skipReason)).toBeTruthy(); }); it('parses multidoc yaml', () => { diff --git a/lib/modules/manager/helmsman/extract.spec.ts b/lib/modules/manager/helmsman/extract.spec.ts index 26bc93fa0bc093..b291909823df18 100644 --- a/lib/modules/manager/helmsman/extract.spec.ts +++ b/lib/modules/manager/helmsman/extract.spec.ts @@ -24,8 +24,8 @@ describe('modules/manager/helmsman/extract', () => { const fileName = 'helmsman.yaml'; const result = extractPackageFile(multiDepFile, fileName, {}); expect(result).not.toBeNull(); - expect(result.deps).toHaveLength(10); - expect(result.deps.filter((value) => value.skipReason)).toHaveLength(5); + expect(result?.deps).toHaveLength(10); + expect(result?.deps.filter((value) => value.skipReason)).toHaveLength(5); expect(result).toMatchSnapshot(); }); }); diff --git a/lib/modules/manager/helmv3/artifacts.spec.ts b/lib/modules/manager/helmv3/artifacts.spec.ts index f23943b10bcb86..2d6fb9fa72ba9a 100644 --- a/lib/modules/manager/helmv3/artifacts.spec.ts +++ b/lib/modules/manager/helmv3/artifacts.spec.ts @@ -8,7 +8,7 @@ import * as docker from '../../../util/exec/docker'; import * as hostRules from '../../../util/host-rules'; import * as _datasource from '../../datasource'; import type { UpdateArtifactsConfig } from '../types'; -import * as helmv3 from './artifacts'; +import * as helmv3 from '.'; jest.mock('child_process'); jest.mock('../../datasource'); diff --git a/lib/modules/manager/helmv3/extract.spec.ts b/lib/modules/manager/helmv3/extract.spec.ts index f97a2fd37142ce..cc9d2d2025ad1f 100644 --- a/lib/modules/manager/helmv3/extract.spec.ts +++ b/lib/modules/manager/helmv3/extract.spec.ts @@ -1,6 +1,6 @@ import { fs } from '../../../../test/util'; import { DockerDatasource } from '../../datasource/docker'; -import { extractPackageFile } from './extract'; +import { extractPackageFile } from '.'; jest.mock('../../../util/fs'); @@ -36,7 +36,7 @@ describe('modules/manager/helmv3/extract', () => { }); expect(result).not.toBeNull(); expect(result).toMatchSnapshot(); - expect(result.deps.every((dep) => dep.skipReason)).toBe(true); + expect(result?.deps.every((dep) => dep.skipReason)).toBe(true); }); it('parses simple Chart.yaml correctly', async () => { @@ -135,7 +135,7 @@ describe('modules/manager/helmv3/extract', () => { }); expect(result).not.toBeNull(); expect(result).toMatchSnapshot(); - expect(result.deps.every((dep) => dep.skipReason)).toBe(false); + expect(result?.deps.every((dep) => dep.skipReason)).toBe(false); }); it("doesn't fail if Chart.yaml is invalid", async () => { diff --git a/lib/modules/manager/helmv3/update.spec.ts b/lib/modules/manager/helmv3/update.spec.ts index 1dc8f0d72767cb..c768f853de1fc6 100644 --- a/lib/modules/manager/helmv3/update.spec.ts +++ b/lib/modules/manager/helmv3/update.spec.ts @@ -1,5 +1,5 @@ import { dump } from 'js-yaml'; -import * as helmv3Updater from './update'; +import * as helmv3Updater from '.'; describe('modules/manager/helmv3/update', () => { describe('.bumpPackageVersion()', () => { diff --git a/lib/modules/manager/helmv3/utils.spec.ts b/lib/modules/manager/helmv3/utils.spec.ts index f10244e72dc2a6..05297684081945 100644 --- a/lib/modules/manager/helmv3/utils.spec.ts +++ b/lib/modules/manager/helmv3/utils.spec.ts @@ -41,14 +41,16 @@ describe('modules/manager/helmv3/utils', () => { }); it('return repository parameter if repository is null', () => { - const repository = resolveAlias(null, { + // TODO #7154 + const repository = resolveAlias(null as never, { anotherRepository: 'https://charts.helm.sh/stable', }); expect(repository).toBeNull(); }); it('return repository parameter if repository is undefined', () => { - const repository = resolveAlias(undefined, { + // TODO #7154 + const repository = resolveAlias(undefined as never, { anotherRepository: 'https://charts.helm.sh/stable', }); expect(repository).toBeUndefined(); @@ -57,12 +59,14 @@ describe('modules/manager/helmv3/utils', () => { describe('.isAlias()', () => { it('return false if repository is null', () => { - const repository = isAlias(null); + // TODO #7154 + const repository = isAlias(null as never); expect(repository).toBeFalse(); }); it('return false if repository is undefined', () => { - const repository = isAlias(undefined); + // TODO #7154 + const repository = isAlias(undefined as never); expect(repository).toBeFalse(); }); }); diff --git a/lib/modules/manager/homebrew/extract.spec.ts b/lib/modules/manager/homebrew/extract.spec.ts index 6922488ff9b018..b2ed7d15672884 100644 --- a/lib/modules/manager/homebrew/extract.spec.ts +++ b/lib/modules/manager/homebrew/extract.spec.ts @@ -1,5 +1,5 @@ import { loadFixture } from '../../../../test/util'; -import { extractPackageFile } from './extract'; +import { extractPackageFile } from '.'; const aalib = loadFixture('aalib.rb'); const aap = loadFixture('aap.rb'); @@ -12,35 +12,35 @@ describe('modules/manager/homebrew/extract', () => { it('skips sourceforge dependency 1', () => { const res = extractPackageFile(aalib); expect(res).not.toBeNull(); - expect(res.deps[0].skipReason).toBe('unsupported-url'); + expect(res?.deps[0].skipReason).toBe('unsupported-url'); expect(res).toMatchSnapshot(); }); it('skips sourceforge dependency 2', () => { const res = extractPackageFile(aap); expect(res).not.toBeNull(); - expect(res.deps[0].skipReason).toBe('unsupported-url'); + expect(res?.deps[0].skipReason).toBe('unsupported-url'); expect(res).toMatchSnapshot(); }); it('skips github dependency with wrong format', () => { const res = extractPackageFile(acmetool); expect(res).not.toBeNull(); - expect(res.deps[0].skipReason).toBe('unsupported-url'); + expect(res?.deps[0].skipReason).toBe('unsupported-url'); expect(res).toMatchSnapshot(); }); it('extracts "releases" github dependency', () => { const res = extractPackageFile(aide); expect(res).not.toBeNull(); - expect(res.deps[0].skipReason).toBeUndefined(); + expect(res?.deps[0].skipReason).toBeUndefined(); expect(res).toMatchSnapshot(); }); it('extracts "archive" github dependency', () => { const res = extractPackageFile(ibazel); expect(res).not.toBeNull(); - expect(res.deps[0].skipReason).toBeUndefined(); + expect(res?.deps[0].skipReason).toBeUndefined(); expect(res).toMatchSnapshot(); }); @@ -54,7 +54,7 @@ describe('modules/manager/homebrew/extract', () => { `; const res = extractPackageFile(content); expect(res).not.toBeNull(); - expect(res.deps[0].skipReason).toBeUndefined(); + expect(res?.deps[0].skipReason).toBeUndefined(); expect(res).toMatchSnapshot(); }); @@ -93,7 +93,7 @@ describe('modules/manager/homebrew/extract', () => { `; const res = extractPackageFile(content); expect(res).not.toBeNull(); - expect(res.deps[0].skipReason).toBe('unsupported-url'); + expect(res?.deps[0].skipReason).toBe('unsupported-url'); expect(res).toMatchSnapshot(); }); @@ -138,7 +138,7 @@ describe('modules/manager/homebrew/extract', () => { `; const res = extractPackageFile(content); expect(res).not.toBeNull(); - expect(res.deps[0].skipReason).toBe('invalid-sha256'); + expect(res?.deps[0].skipReason).toBe('invalid-sha256'); expect(res).toMatchSnapshot(); }); @@ -153,7 +153,7 @@ describe('modules/manager/homebrew/extract', () => { `; const res = extractPackageFile(content); expect(res).not.toBeNull(); - expect(res.deps[0].skipReason).toBe('invalid-sha256'); + expect(res?.deps[0].skipReason).toBe('invalid-sha256'); expect(res).toMatchSnapshot(); }); }); diff --git a/lib/modules/manager/homebrew/update.spec.ts b/lib/modules/manager/homebrew/update.spec.ts index a7f8a88ae2a971..55ca50f1def746 100644 --- a/lib/modules/manager/homebrew/update.spec.ts +++ b/lib/modules/manager/homebrew/update.spec.ts @@ -1,7 +1,7 @@ import { Readable } from 'stream'; import * as httpMock from '../../../../test/http-mock'; import { loadFixture } from '../../../../test/util'; -import { updateDependency } from './update'; +import { updateDependency } from '.'; const aide = loadFixture('aide.rb'); const ibazel = loadFixture('ibazel.rb'); diff --git a/lib/modules/manager/index.spec.ts b/lib/modules/manager/index.spec.ts index 1c646ff8f237ba..914b2288e082c0 100644 --- a/lib/modules/manager/index.spec.ts +++ b/lib/modules/manager/index.spec.ts @@ -18,7 +18,8 @@ describe('modules/manager/index', () => { it(`has valid supportedDatasources for ${m}`, () => { expect(supportedDatasources).toBeNonEmptyArray(); - supportedDatasources.every((d) => { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + supportedDatasources!.every((d) => { expect(datasources.includes(d)).toBeTrue(); }); }); @@ -62,7 +63,7 @@ describe('modules/manager/index', () => { expect(Array.from(mgrs.keys())).toEqual(Object.keys(loadedMgr)); for (const name of mgrs.keys()) { - const mgr = mgrs.get(name); + const mgr = mgrs.get(name)!; expect(validate(mgr)).toBeTrue(); } }); @@ -110,10 +111,10 @@ describe('modules/manager/index', () => { supportedDatasources: [], }); expect( - manager.extractPackageFile('unknown', null, 'filename', {}) + manager.extractPackageFile('unknown', '', 'filename', {}) ).toBeNull(); expect( - manager.extractPackageFile('dummy', null, 'filename', {}) + manager.extractPackageFile('dummy', '', 'filename', {}) ).toBeNull(); }); @@ -125,7 +126,7 @@ describe('modules/manager/index', () => { }); expect( - manager.extractPackageFile('dummy', null, 'filename', {}) + manager.extractPackageFile('dummy', '', 'filename', {}) ).not.toBeNull(); }); diff --git a/lib/modules/manager/jenkins/extract.spec.ts b/lib/modules/manager/jenkins/extract.spec.ts index 117bb71e90d666..165bc1b101e61f 100644 --- a/lib/modules/manager/jenkins/extract.spec.ts +++ b/lib/modules/manager/jenkins/extract.spec.ts @@ -1,5 +1,5 @@ import { loadFixture } from '../../../../test/util'; -import { extractPackageFile } from './extract'; +import { extractPackageFile } from '.'; const invalidYamlFile = loadFixture('invalid.yaml'); @@ -28,14 +28,14 @@ describe('modules/manager/jenkins/extract', () => { it('extracts multiple image lines in text format', () => { const res = extractPackageFile(pluginsTextFile, 'path/file.txt'); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(6); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(6); }); it('extracts multiple image lines in yaml format', () => { const res = extractPackageFile(pluginsYamlFile, 'path/file.yml'); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(8); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(8); }); }); }); diff --git a/lib/modules/manager/jsonnet-bundler/artifacts.spec.ts b/lib/modules/manager/jsonnet-bundler/artifacts.spec.ts index e58a5dcc90352f..c6c42160087efd 100644 --- a/lib/modules/manager/jsonnet-bundler/artifacts.spec.ts +++ b/lib/modules/manager/jsonnet-bundler/artifacts.spec.ts @@ -1,6 +1,6 @@ import { join } from 'upath'; import { envMock, exec, mockExecAll } from '../../../../test/exec-util'; -import { env, fs, git } from '../../../../test/util'; +import { env, fs, git, partial } from '../../../../test/util'; import { GlobalConfig } from '../../../config/global'; import type { RepoGlobalConfig } from '../../../config/types'; import type { StatusResult } from '../../../util/git/types'; @@ -27,7 +27,7 @@ describe('modules/manager/jsonnet-bundler/artifacts', () => { }); it('returns null if jsonnetfile.lock does not exist', async () => { - fs.readLocalFile.mockResolvedValueOnce(null); + fs.readLocalFile.mockResolvedValueOnce(''); expect( await updateArtifacts({ packageFileName: 'jsonnetfile.json', @@ -41,14 +41,16 @@ describe('modules/manager/jsonnet-bundler/artifacts', () => { it('returns null if there are no changes', async () => { fs.readLocalFile.mockResolvedValueOnce('Current jsonnetfile.lock.json'); const execSnapshots = mockExecAll(exec); - git.getRepoStatus.mockResolvedValueOnce({ - modified: [], - not_added: [], - deleted: [], - isClean(): boolean { - return true; - }, - } as StatusResult); + git.getRepoStatus.mockResolvedValueOnce( + partial({ + modified: [], + not_added: [], + deleted: [], + isClean(): boolean { + return true; + }, + }) + ); expect( await updateArtifacts({ packageFileName: 'jsonnetfile.json', diff --git a/lib/modules/manager/jsonnet-bundler/extract.spec.ts b/lib/modules/manager/jsonnet-bundler/extract.spec.ts index 3c0145c2f0578f..43d69003d5530b 100644 --- a/lib/modules/manager/jsonnet-bundler/extract.spec.ts +++ b/lib/modules/manager/jsonnet-bundler/extract.spec.ts @@ -1,12 +1,12 @@ -import { loadFixture } from '../../../../test/util'; +import { Fixtures } from '../../../../test/fixtures'; import { extractPackageFile } from '.'; -const jsonnetfile = loadFixture('jsonnetfile.json'); -const jsonnetfileWithName = loadFixture('jsonnetfile-with-name.json'); -const jsonnetfileNoDependencies = loadFixture( +const jsonnetfile = Fixtures.get('jsonnetfile.json'); +const jsonnetfileWithName = Fixtures.get('jsonnetfile-with-name.json'); +const jsonnetfileNoDependencies = Fixtures.get( 'jsonnetfile-no-dependencies.json' ); -const jsonnetfileLocalDependencies = loadFixture( +const jsonnetfileLocalDependencies = Fixtures.get( 'jsonnetfile-local-dependencies.json' ); diff --git a/lib/modules/manager/kubernetes/extract.spec.ts b/lib/modules/manager/kubernetes/extract.spec.ts index 2f4117fc14bef6..6d2231e3e8a586 100644 --- a/lib/modules/manager/kubernetes/extract.spec.ts +++ b/lib/modules/manager/kubernetes/extract.spec.ts @@ -1,10 +1,10 @@ -import { loadFixture } from '../../../../test/util'; -import { extractPackageFile } from './extract'; +import { Fixtures } from '../../../../test/fixtures'; +import { extractPackageFile } from '.'; -const kubernetesImagesFile = loadFixture('kubernetes.yaml'); -const kubernetesConfigMapFile = loadFixture('configmap.yaml'); -const kubernetesArraySyntaxFile = loadFixture('array-syntax.yaml'); -const otherYamlFile = loadFixture('gitlab-ci.yaml'); +const kubernetesImagesFile = Fixtures.get('kubernetes.yaml'); +const kubernetesConfigMapFile = Fixtures.get('configmap.yaml'); +const kubernetesArraySyntaxFile = Fixtures.get('array-syntax.yaml'); +const otherYamlFile = Fixtures.get('gitlab-ci.yaml'); describe('modules/manager/kubernetes/extract', () => { describe('extractPackageFile()', () => { @@ -14,14 +14,14 @@ describe('modules/manager/kubernetes/extract', () => { it('extracts multiple image lines', () => { const res = extractPackageFile(kubernetesImagesFile); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(2); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(2); }); it('extracts image line in a YAML array', () => { const res = extractPackageFile(kubernetesArraySyntaxFile); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(1); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(1); }); it('ignores non-Kubernetes YAML files', () => { diff --git a/lib/modules/manager/kustomize/extract.spec.ts b/lib/modules/manager/kustomize/extract.spec.ts index 320adaefe815e9..5e9932aa33840f 100644 --- a/lib/modules/manager/kustomize/extract.spec.ts +++ b/lib/modules/manager/kustomize/extract.spec.ts @@ -1,4 +1,4 @@ -import { loadFixture } from '../../../../test/util'; +import { Fixtures } from '../../../../test/fixtures'; import { DockerDatasource } from '../../datasource/docker'; import { GitTagsDatasource } from '../../datasource/git-tags'; import { GithubTagsDatasource } from '../../datasource/github-tags'; @@ -11,19 +11,19 @@ import { parseKustomize, } from './extract'; -const kustomizeGitSSHBase = loadFixture('gitSshBase.yaml'); -const kustomizeEmpty = loadFixture('kustomizeEmpty.yaml'); -const kustomizeGitSSHSubdir = loadFixture('gitSubdir.yaml'); -const kustomizeHTTP = loadFixture('kustomizeHttp.yaml'); -const kustomizeWithLocal = loadFixture('kustomizeWithLocal.yaml'); -const nonKustomize = loadFixture('service.yaml'); -const gitImages = loadFixture('gitImages.yaml'); -const kustomizeDepsInResources = loadFixture('depsInResources.yaml'); -const kustomizeComponent = loadFixture('component.yaml'); -const newTag = loadFixture('newTag.yaml'); -const newName = loadFixture('newName.yaml'); -const digest = loadFixture('digest.yaml'); -const kustomizeHelmChart = loadFixture('kustomizeHelmChart.yaml'); +const kustomizeGitSSHBase = Fixtures.get('gitSshBase.yaml'); +const kustomizeEmpty = Fixtures.get('kustomizeEmpty.yaml'); +const kustomizeGitSSHSubdir = Fixtures.get('gitSubdir.yaml'); +const kustomizeHTTP = Fixtures.get('kustomizeHttp.yaml'); +const kustomizeWithLocal = Fixtures.get('kustomizeWithLocal.yaml'); +const nonKustomize = Fixtures.get('service.yaml'); +const gitImages = Fixtures.get('gitImages.yaml'); +const kustomizeDepsInResources = Fixtures.get('depsInResources.yaml'); +const kustomizeComponent = Fixtures.get('component.yaml'); +const newTag = Fixtures.get('newTag.yaml'); +const newName = Fixtures.get('newName.yaml'); +const digest = Fixtures.get('digest.yaml'); +const kustomizeHelmChart = Fixtures.get('kustomizeHelmChart.yaml'); describe('modules/manager/kustomize/extract', () => { it('should successfully parse a valid kustomize file', () => { @@ -51,7 +51,7 @@ describe('modules/manager/kustomize/extract', () => { - github.com/fluxcd/flux/deploy?ref=1.19.0 `); expect(file).not.toBeNull(); - expect(file.kind).toBe('Kustomization'); + expect(file?.kind).toBe('Kustomization'); }); describe('extractBase', () => { @@ -152,9 +152,9 @@ describe('modules/manager/kustomize/extract', () => { describe('extractHelmChart', () => { it('should return null on a null input', () => { const pkg = extractHelmChart({ - name: null, - repo: null, - version: null, + name: '', + repo: '', + version: '', }); expect(pkg).toBeNull(); }); @@ -179,8 +179,8 @@ describe('modules/manager/kustomize/extract', () => { describe('image extraction', () => { it('should return null on a null input', () => { const pkg = extractImage({ - name: null, - newTag: null, + name: '', + newTag: '', }); expect(pkg).toBeNull(); }); @@ -268,38 +268,38 @@ describe('modules/manager/kustomize/extract', () => { it('extracts multiple image lines', () => { const res = extractPackageFile(kustomizeWithLocal); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(2); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(2); }); it('extracts ssh dependency', () => { const res = extractPackageFile(kustomizeGitSSHBase); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(1); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(1); }); it('extracts ssh dependency with a subdir', () => { const res = extractPackageFile(kustomizeGitSSHSubdir); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(1); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(1); }); it('extracts http dependency', () => { const res = extractPackageFile(kustomizeHTTP); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(2); - expect(res.deps[0].currentValue).toBe('v0.0.1'); - expect(res.deps[1].currentValue).toBe('1.19.0'); - expect(res.deps[1].depName).toBe('fluxcd/flux'); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(2); + expect(res?.deps[0].currentValue).toBe('v0.0.1'); + expect(res?.deps[1].currentValue).toBe('1.19.0'); + expect(res?.deps[1].depName).toBe('fluxcd/flux'); }); it('should extract out image versions', () => { const res = extractPackageFile(gitImages); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(6); - expect(res.deps[0].currentValue).toBe('v0.1.0'); - expect(res.deps[1].currentValue).toBe('v0.0.1'); - expect(res.deps[5].skipReason).toBe('invalid-value'); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(6); + expect(res?.deps[0].currentValue).toBe('v0.1.0'); + expect(res?.deps[1].currentValue).toBe('v0.0.1'); + expect(res?.deps[5].skipReason).toBe('invalid-value'); }); it('ignores non-Kubernetes empty files', () => { @@ -313,33 +313,33 @@ describe('modules/manager/kustomize/extract', () => { it('should extract bases resources and components from their respective blocks', () => { const res = extractPackageFile(kustomizeDepsInResources); expect(res).not.toBeNull(); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(3); - expect(res.deps[0].currentValue).toBe('v0.0.1'); - expect(res.deps[1].currentValue).toBe('1.19.0'); - expect(res.deps[2].currentValue).toBe('1.18.0'); - expect(res.deps[0].depName).toBe('moredhel/remote-kustomize'); - expect(res.deps[1].depName).toBe('fluxcd/flux'); - expect(res.deps[2].depName).toBe('fluxcd/flux'); - expect(res.deps[0].depType).toBe('Kustomization'); - expect(res.deps[1].depType).toBe('Kustomization'); - expect(res.deps[2].depType).toBe('Kustomization'); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(3); + expect(res?.deps[0].currentValue).toBe('v0.0.1'); + expect(res?.deps[1].currentValue).toBe('1.19.0'); + expect(res?.deps[2].currentValue).toBe('1.18.0'); + expect(res?.deps[0].depName).toBe('moredhel/remote-kustomize'); + expect(res?.deps[1].depName).toBe('fluxcd/flux'); + expect(res?.deps[2].depName).toBe('fluxcd/flux'); + expect(res?.deps[0].depType).toBe('Kustomization'); + expect(res?.deps[1].depType).toBe('Kustomization'); + expect(res?.deps[2].depType).toBe('Kustomization'); }); it('should extract dependencies when kind is Component', () => { const res = extractPackageFile(kustomizeComponent); expect(res).not.toBeNull(); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(3); - expect(res.deps[0].currentValue).toBe('1.19.0'); - expect(res.deps[1].currentValue).toBe('1.18.0'); - expect(res.deps[2].currentValue).toBe('v0.1.0'); - expect(res.deps[0].depName).toBe('fluxcd/flux'); - expect(res.deps[1].depName).toBe('fluxcd/flux'); - expect(res.deps[2].depName).toBe('node'); - expect(res.deps[0].depType).toBe('Component'); - expect(res.deps[1].depType).toBe('Component'); - expect(res.deps[2].depType).toBe('Component'); + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(3); + expect(res?.deps[0].currentValue).toBe('1.19.0'); + expect(res?.deps[1].currentValue).toBe('1.18.0'); + expect(res?.deps[2].currentValue).toBe('v0.1.0'); + expect(res?.deps[0].depName).toBe('fluxcd/flux'); + expect(res?.deps[1].depName).toBe('fluxcd/flux'); + expect(res?.deps[2].depName).toBe('node'); + expect(res?.deps[0].depType).toBe('Component'); + expect(res?.deps[1].depType).toBe('Component'); + expect(res?.deps[2].depType).toBe('Component'); }); const postgresDigest = diff --git a/lib/modules/manager/leiningen/extract.spec.ts b/lib/modules/manager/leiningen/extract.spec.ts index f4bb40db7c714f..9ef40825c6b884 100644 --- a/lib/modules/manager/leiningen/extract.spec.ts +++ b/lib/modules/manager/leiningen/extract.spec.ts @@ -1,11 +1,7 @@ import { Fixtures } from '../../../../test/fixtures'; import { ClojureDatasource } from '../../datasource/clojure'; -import { - extractFromVectors, - extractPackageFile, - extractVariables, - trimAtKey, -} from './extract'; +import { extractFromVectors, extractVariables, trimAtKey } from './extract'; +import { extractPackageFile } from '.'; const leinProjectClj = Fixtures.get(`project.clj`); diff --git a/lib/modules/manager/maven/extract.spec.ts b/lib/modules/manager/maven/extract.spec.ts index 5d26683b3d014c..28b22bd0adfa5c 100644 --- a/lib/modules/manager/maven/extract.spec.ts +++ b/lib/modules/manager/maven/extract.spec.ts @@ -11,7 +11,7 @@ const complexSettingsContent = Fixtures.get(`complex.settings.xml`); describe('modules/manager/maven/extract', () => { describe('extractDependencies', () => { it('returns null for invalid XML', () => { - expect(extractPackage(undefined)).toBeNull(); + expect(extractPackage('')).toBeNull(); expect(extractPackage('invalid xml content')).toBeNull(); expect(extractPackage('')).toBeNull(); expect(extractPackage('')).toBeNull(); @@ -143,7 +143,7 @@ describe('modules/manager/maven/extract', () => { describe('extractRegistries', () => { it('returns null for invalid XML', () => { - expect(extractRegistries(undefined)).toBeEmptyArray(); + expect(extractRegistries('')).toBeEmptyArray(); expect(extractRegistries('invalid xml content')).toBeEmptyArray(); expect(extractRegistries('')).toBeEmptyArray(); expect(extractRegistries('')).toBeEmptyArray(); diff --git a/lib/modules/manager/maven/index.spec.ts b/lib/modules/manager/maven/index.spec.ts index 592c74da21bb8e..f397c0594f4dfc 100644 --- a/lib/modules/manager/maven/index.spec.ts +++ b/lib/modules/manager/maven/index.spec.ts @@ -1,15 +1,18 @@ -import { fs, loadFixture } from '../../../../test/util'; +// TODO #7154 +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ +import { Fixtures } from '../../../../test/fixtures'; +import { fs } from '../../../../test/util'; import type { PackageDependency, PackageFile } from '../types'; import { extractPackage, resolveParents } from './extract'; import { extractAllPackageFiles, updateDependency } from '.'; jest.mock('../../../util/fs'); -const pomContent = loadFixture('simple.pom.xml'); -const pomParent = loadFixture('parent.pom.xml'); -const pomChild = loadFixture('child.pom.xml'); -const origContent = loadFixture('grouping.pom.xml'); -const settingsContent = loadFixture('mirror.settings.xml'); +const pomContent = Fixtures.get('simple.pom.xml'); +const pomParent = Fixtures.get('parent.pom.xml'); +const pomChild = Fixtures.get('child.pom.xml'); +const origContent = Fixtures.get('grouping.pom.xml'); +const settingsContent = Fixtures.get('mirror.settings.xml'); function selectDep(deps: PackageDependency[], name = 'org.example:quuz') { return deps.find((dep) => dep.depName === name); @@ -18,7 +21,7 @@ function selectDep(deps: PackageDependency[], name = 'org.example:quuz') { describe('modules/manager/maven/index', () => { describe('extractAllPackageFiles', () => { it('should return empty if package has no content', async () => { - fs.readLocalFile.mockResolvedValueOnce(null); + fs.readLocalFile.mockResolvedValueOnce(''); const res = await extractAllPackageFiles({}, ['random.pom.xml']); expect(res).toBeEmptyArray(); }); @@ -44,7 +47,7 @@ describe('modules/manager/maven/index', () => { ]; for (const pkg of packages) { for (const dep of pkg.deps) { - const depUrls = [...dep.registryUrls]; + const depUrls = [...dep.registryUrls!]; expect(depUrls).toEqual(urls); } } @@ -137,16 +140,16 @@ describe('modules/manager/maven/index', () => { it('should update an existing dependency', () => { const newValue = '9.9.9.9-final'; - const { deps } = extractPackage(pomContent); + const { deps } = extractPackage(pomContent)!; const dep = selectDep(deps); const upgrade = { ...dep, newValue }; const updatedContent = updateDependency({ fileContent: pomContent, upgrade, - }); - const updatedDep = selectDep(extractPackage(updatedContent).deps); + })!; + const updatedDep = selectDep(extractPackage(updatedContent)!.deps); - expect(updatedDep.currentValue).toEqual(newValue); + expect(updatedDep?.currentValue).toEqual(newValue); }); it('should update existing dependency defined via properties', () => { @@ -155,8 +158,8 @@ describe('modules/manager/maven/index', () => { const newValue = '9.9.9.9-final'; const packages = resolveParents([ - extractPackage(pomParent, 'parent.pom.xml'), - extractPackage(pomChild, 'child.pom.xml'), + extractPackage(pomParent, 'parent.pom.xml')!, + extractPackage(pomChild, 'child.pom.xml')!, ]); const [{ deps }] = packages; const dep = deps.find(finder); @@ -164,20 +167,20 @@ describe('modules/manager/maven/index', () => { const updatedContent = updateDependency({ fileContent: pomParent, upgrade, - }); + })!; const [updatedPkg] = resolveParents([ - extractPackage(updatedContent, 'parent.pom.xml'), - extractPackage(pomChild, 'child.pom.xml'), + extractPackage(updatedContent, 'parent.pom.xml')!, + extractPackage(pomChild, 'child.pom.xml')!, ]); const updatedDep = updatedPkg.deps.find(finder); - expect(updatedDep.registryUrls).toContain('http://example.com/'); - expect(updatedDep.currentValue).toEqual(newValue); + expect(updatedDep?.registryUrls).toContain('http://example.com/'); + expect(updatedDep?.currentValue).toEqual(newValue); }); it('should apply props recursively', () => { const [{ deps }] = resolveParents([ - extractPackage(loadFixture('recursive_props.pom.xml')), + extractPackage(Fixtures.get('recursive_props.pom.xml'))!, ]); expect(deps).toMatchObject([ { @@ -189,7 +192,7 @@ describe('modules/manager/maven/index', () => { it('should detect props infinitely recursing props', () => { const [{ deps }] = resolveParents([ - extractPackage(loadFixture('infinite_recursive_props.pom.xml')), + extractPackage(Fixtures.get('infinite_recursive_props.pom.xml'))!, ]); expect(deps).toMatchObject([ { @@ -220,7 +223,7 @@ describe('modules/manager/maven/index', () => { ]); packages.forEach(({ deps }) => { deps.forEach(({ registryUrls }) => { - const depUrls = new Set([...registryUrls]); + const depUrls = new Set([...registryUrls!]); expect(depUrls).toEqual(urls); }); }); @@ -230,7 +233,7 @@ describe('modules/manager/maven/index', () => { it('should not touch content if new and old versions are equal', () => { const newValue = '1.2.3'; - const { deps } = extractPackage(pomContent); + const { deps } = extractPackage(pomContent)!; const dep = selectDep(deps); const upgrade = { ...dep, newValue }; const updatedContent = updateDependency({ @@ -266,7 +269,7 @@ describe('modules/manager/maven/index', () => { const updatedByPrevious = updateDependency({ fileContent: origContent, upgrade: upgrade1, - }); + })!; expect( updateDependency({ @@ -301,7 +304,7 @@ describe('modules/manager/maven/index', () => { const currentValue = '1.2.2'; const newValue = '1.2.4'; - const { deps } = extractPackage(pomContent); + const { deps } = extractPackage(pomContent)!; const dep = selectDep(deps); const upgrade = { ...dep, currentValue, newValue }; const updatedContent = updateDependency({ @@ -317,13 +320,13 @@ describe('modules/manager/maven/index', () => { const select = (depSet: PackageFile) => selectDep(depSet.deps, 'org.example:hard-range'); const oldContent = extractPackage(pomContent); - const dep = select(oldContent); + const dep = select(oldContent!); const upgrade = { ...dep, newValue }; const newContent = extractPackage( - updateDependency({ fileContent: pomContent, upgrade }) + updateDependency({ fileContent: pomContent, upgrade })! ); - const newDep = select(newContent); - expect(newDep.currentValue).toEqual(newValue); + const newDep = select(newContent!); + expect(newDep?.currentValue).toEqual(newValue); }); it('should preserve ranges', () => { @@ -331,7 +334,7 @@ describe('modules/manager/maven/index', () => { const select = (depSet: PackageFile) => depSet?.deps ? selectDep(depSet.deps, 'org.example:hard-range') : null; const oldContent = extractPackage(pomContent); - const dep = select(oldContent); + const dep = select(oldContent!); expect(dep).not.toBeNull(); const upgrade = { ...dep, newValue }; expect(updateDependency({ fileContent: pomContent, upgrade })).toEqual( @@ -341,7 +344,7 @@ describe('modules/manager/maven/index', () => { it('should return null for replacement', () => { const res = updateDependency({ - fileContent: undefined, + fileContent: '', upgrade: { updateType: 'replacement' }, }); expect(res).toBeNull(); diff --git a/lib/modules/manager/maven/update.spec.ts b/lib/modules/manager/maven/update.spec.ts index 44ffb59aba614c..247b41d617587c 100644 --- a/lib/modules/manager/maven/update.spec.ts +++ b/lib/modules/manager/maven/update.spec.ts @@ -1,6 +1,8 @@ +// TODO #7154 +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { XmlDocument } from 'xmldoc'; import { Fixtures } from '../../../../test/fixtures'; -import * as pomUpdater from './update'; +import * as pomUpdater from '.'; const simpleContent = Fixtures.get(`simple.pom.xml`); const minimumContent = Fixtures.get(`minimum.pom.xml`); @@ -14,7 +16,7 @@ describe('modules/manager/maven/update', () => { 'patch' ); - const project = new XmlDocument(bumpedContent); + const project = new XmlDocument(bumpedContent!); expect(project.valueWithPath('version')).toBe('0.0.2'); }); @@ -25,7 +27,7 @@ describe('modules/manager/maven/update', () => { 'patch' ); const { bumpedContent: bumpedContent2 } = pomUpdater.bumpPackageVersion( - bumpedContent, + bumpedContent!, '0.0.1', 'patch' ); @@ -40,7 +42,7 @@ describe('modules/manager/maven/update', () => { 'patch' ); - const project = new XmlDocument(bumpedContent); + const project = new XmlDocument(bumpedContent!); expect(project.valueWithPath('version')).toBe('1'); }); diff --git a/lib/modules/manager/metadata.spec.ts b/lib/modules/manager/metadata.spec.ts index 50b9e369356c1a..71a66590d8e9b2 100644 --- a/lib/modules/manager/metadata.spec.ts +++ b/lib/modules/manager/metadata.spec.ts @@ -9,14 +9,15 @@ describe('modules/manager/metadata', () => { .sort(); test.each(managerList)('%s has readme with no h1 or h2', async (manager) => { - let readme: string; + let readme: string | undefined; try { readme = await fs.readFile(`${__dirname}/${manager}/readme.md`, 'utf8'); } catch (err) { // do nothing } expect(readme).toBeDefined(); - const lines = readme.split('\n'); + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + const lines = readme!.split('\n'); let isCode = false; const res: string[] = []; diff --git a/lib/modules/manager/meteor/extract.spec.ts b/lib/modules/manager/meteor/extract.spec.ts index 608e15e9fe449e..cc7b0e01f6f892 100644 --- a/lib/modules/manager/meteor/extract.spec.ts +++ b/lib/modules/manager/meteor/extract.spec.ts @@ -1,5 +1,5 @@ import { Fixtures } from '../../../../test/fixtures'; -import { extractPackageFile } from './extract'; +import { extractPackageFile } from '.'; const input01Content = Fixtures.get('package-1.js'); @@ -13,7 +13,7 @@ describe('modules/manager/meteor/extract', () => { it('returns results', () => { const res = extractPackageFile(input01Content); expect(res).toMatchSnapshot(); - expect(res.deps).toHaveLength(6); + expect(res?.deps).toHaveLength(6); }); }); }); diff --git a/lib/modules/manager/mix/artifacts.spec.ts b/lib/modules/manager/mix/artifacts.spec.ts index c8e890856b9642..27f7dd88747aef 100644 --- a/lib/modules/manager/mix/artifacts.spec.ts +++ b/lib/modules/manager/mix/artifacts.spec.ts @@ -131,7 +131,9 @@ describe('modules/manager/mix/artifacts', () => { expect(result).toMatchSnapshot(); expect(execSnapshots).toMatchSnapshot(); - const [updateResult] = result; + // TODO #7154 + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + const [updateResult] = result!; expect(updateResult).toEqual({ file: { type: 'addition', path: 'mix.lock', contents: 'New mix.lock' }, }); diff --git a/lib/modules/manager/mix/extract.spec.ts b/lib/modules/manager/mix/extract.spec.ts index c2a99b1c04a21c..530b2267aa358a 100644 --- a/lib/modules/manager/mix/extract.spec.ts +++ b/lib/modules/manager/mix/extract.spec.ts @@ -9,8 +9,8 @@ describe('modules/manager/mix/extract', () => { describe('extractPackageFile()', () => { it('returns empty for invalid dependency file', async () => { - const { deps } = await extractPackageFile('nothing here', 'mix.exs'); - expect(deps).toBeEmpty(); + const res = await extractPackageFile('nothing here', 'mix.exs'); + expect(res?.deps).toBeEmpty(); }); it('extracts all dependencies', async () => { diff --git a/lib/modules/manager/npm/extract/pnpm.spec.ts b/lib/modules/manager/npm/extract/pnpm.spec.ts index ff034ea3ad6e34..f391cd7aaaea38 100644 --- a/lib/modules/manager/npm/extract/pnpm.spec.ts +++ b/lib/modules/manager/npm/extract/pnpm.spec.ts @@ -191,7 +191,7 @@ describe('modules/manager/npm/extract/pnpm', () => { packageFiles.find( (packageFile) => packageFile.packageFile === 'not-matching/b/package.json' - ).pnpmShrinkwrap + )?.pnpmShrinkwrap ).toBeUndefined(); }); }); diff --git a/lib/modules/manager/npm/utils.spec.ts b/lib/modules/manager/npm/utils.spec.ts index c5c7d813368abd..e7d8af6ec13169 100644 --- a/lib/modules/manager/npm/utils.spec.ts +++ b/lib/modules/manager/npm/utils.spec.ts @@ -1,11 +1,11 @@ -import { loadFixture } from '../../../../test/util'; +import { Fixtures } from '../../../../test/fixtures'; import type { LockFile } from './types'; import { composeLockFile, parseLockFile } from './utils'; describe('modules/manager/npm/utils', () => { describe('parseLockFile', () => { it('parses lockfile string into an object', () => { - const lockFile = loadFixture('lockfile-parsing/package-lock.json'); + const lockFile = Fixtures.get('lockfile-parsing/package-lock.json'); const parseLockFileResult = parseLockFile(lockFile); expect(parseLockFileResult).toStrictEqual({ detectedIndent: ' ', @@ -55,9 +55,11 @@ describe('modules/manager/npm/utils', () => { }); it('adds trailing newline to match npms behaviour and avoid diffs', () => { - const lockFile = loadFixture('lockfile-parsing/package-lock.json'); + const lockFile = Fixtures.get('lockfile-parsing/package-lock.json'); const { detectedIndent, lockFileParsed } = parseLockFile(lockFile); - const lockFileComposed = composeLockFile(lockFileParsed, detectedIndent); + // TODO #7154 + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + const lockFileComposed = composeLockFile(lockFileParsed!, detectedIndent); expect(lockFileComposed).toBe(lockFile); }); }); diff --git a/lib/modules/manager/nuget/extract.spec.ts b/lib/modules/manager/nuget/extract.spec.ts index 95089eab3c341d..5c666ccda637f6 100644 --- a/lib/modules/manager/nuget/extract.spec.ts +++ b/lib/modules/manager/nuget/extract.spec.ts @@ -1,5 +1,5 @@ import upath from 'upath'; -import { loadFixture } from '../../../../test/util'; +import { Fixtures } from '../../../../test/fixtures'; import { GlobalConfig } from '../../../config/global'; import type { RepoGlobalConfig } from '../../../config/types'; import type { ExtractConfig } from '../types'; @@ -30,7 +30,7 @@ describe('modules/manager/nuget/extract', () => { it('extracts package version dependency', async () => { const packageFile = 'with-centralized-package-versions/Directory.Packages.props'; - const sample = loadFixture(packageFile); + const sample = Fixtures.get(packageFile); const res = await extractPackageFile(sample, packageFile, config); expect(res?.deps).toMatchSnapshot(); expect(res?.deps).toHaveLength(1); @@ -38,7 +38,7 @@ describe('modules/manager/nuget/extract', () => { it('extracts all dependencies', async () => { const packageFile = 'sample.csproj'; - const sample = loadFixture(packageFile); + const sample = Fixtures.get(packageFile); const res = await extractPackageFile(sample, packageFile, config); expect(res?.deps).toMatchSnapshot(); expect(res?.deps).toHaveLength(17); @@ -46,7 +46,7 @@ describe('modules/manager/nuget/extract', () => { it('extracts all dependencies from global packages file', async () => { const packageFile = 'packages.props'; - const sample = loadFixture(packageFile); + const sample = Fixtures.get(packageFile); const res = await extractPackageFile(sample, packageFile, config); expect(res?.deps).toMatchSnapshot(); expect(res?.deps).toHaveLength(17); @@ -54,7 +54,7 @@ describe('modules/manager/nuget/extract', () => { it('considers NuGet.config', async () => { const packageFile = 'with-config-file/with-config-file.csproj'; - const contents = loadFixture(packageFile); + const contents = Fixtures.get(packageFile); expect(await extractPackageFile(contents, packageFile, config)).toEqual({ deps: [ { @@ -74,7 +74,7 @@ describe('modules/manager/nuget/extract', () => { it('considers lower-case nuget.config', async () => { const packageFile = 'with-lower-case-config-file/with-lower-case-config-file.csproj'; - const contents = loadFixture(packageFile); + const contents = Fixtures.get(packageFile); expect(await extractPackageFile(contents, packageFile, config)).toEqual({ deps: [ { @@ -94,7 +94,7 @@ describe('modules/manager/nuget/extract', () => { it('considers pascal-case NuGet.Config', async () => { const packageFile = 'with-pascal-case-config-file/with-pascal-case-config-file.csproj'; - const contents = loadFixture(packageFile); + const contents = Fixtures.get(packageFile); expect(await extractPackageFile(contents, packageFile, config)).toEqual({ deps: [ { @@ -114,7 +114,7 @@ describe('modules/manager/nuget/extract', () => { it('handles malformed NuGet.config', async () => { const packageFile = 'with-malformed-config-file/with-malformed-config-file.csproj'; - const contents = loadFixture(packageFile); + const contents = Fixtures.get(packageFile); expect(await extractPackageFile(contents, packageFile, config)).toEqual({ deps: [ { @@ -130,7 +130,7 @@ describe('modules/manager/nuget/extract', () => { it('handles NuGet.config without package sources', async () => { const packageFile = 'without-package-sources/without-package-sources.csproj'; - const contents = loadFixture(packageFile); + const contents = Fixtures.get(packageFile); expect(await extractPackageFile(contents, packageFile, config)).toEqual({ deps: [ { @@ -145,7 +145,7 @@ describe('modules/manager/nuget/extract', () => { it('handles NuGet.config with whitespaces in package source keys', async () => { const packageFile = 'with-whitespaces/with-whitespaces.csproj'; - const contents = loadFixture(packageFile); + const contents = Fixtures.get(packageFile); expect(await extractPackageFile(contents, packageFile, config)).toEqual({ deps: [ { @@ -165,7 +165,7 @@ describe('modules/manager/nuget/extract', () => { it('ignores local feed in NuGet.config', async () => { const packageFile = 'with-local-feed-in-config-file/with-local-feed-in-config-file.csproj'; - const contents = loadFixture(packageFile); + const contents = Fixtures.get(packageFile); expect(await extractPackageFile(contents, packageFile, config)).toEqual({ deps: [ { @@ -181,9 +181,9 @@ describe('modules/manager/nuget/extract', () => { it('extracts registry URLs independently', async () => { const packageFile = 'multiple-package-files/one/one.csproj'; - const contents = loadFixture(packageFile); + const contents = Fixtures.get(packageFile); const otherPackageFile = 'multiple-package-files/two/two.csproj'; - const otherContents = loadFixture(otherPackageFile); + const otherContents = Fixtures.get(otherPackageFile); expect(await extractPackageFile(contents, packageFile, config)).toEqual({ deps: [ { @@ -218,7 +218,7 @@ describe('modules/manager/nuget/extract', () => { it('extracts msbuild-sdks from global.json', async () => { const packageFile = 'msbuild-sdk-files/global.json'; - const contents = loadFixture(packageFile); + const contents = Fixtures.get(packageFile); expect( await extractPackageFile(contents, packageFile, config) ).toMatchObject({ @@ -241,7 +241,7 @@ describe('modules/manager/nuget/extract', () => { it('extracts dotnet-sdk from global.json', async () => { const packageFile = 'msbuild-sdk-files/global.1.json'; - const contents = loadFixture(packageFile); + const contents = Fixtures.get(packageFile); expect( await extractPackageFile(contents, 'global.json', config) ).toMatchObject({ @@ -258,7 +258,7 @@ describe('modules/manager/nuget/extract', () => { it('handles malformed global.json', async () => { const packageFile = 'msbuild-sdk-files/invalid-json/global.json'; - const contents = loadFixture(packageFile); + const contents = Fixtures.get(packageFile); expect( await extractPackageFile(contents, packageFile, config) ).toBeNull(); @@ -266,7 +266,7 @@ describe('modules/manager/nuget/extract', () => { it('handles not-a-nuget global.json', async () => { const packageFile = 'msbuild-sdk-files/not-nuget/global.json'; - const contents = loadFixture(packageFile); + const contents = Fixtures.get(packageFile); expect( await extractPackageFile(contents, packageFile, config) ).toBeNull(); @@ -274,7 +274,7 @@ describe('modules/manager/nuget/extract', () => { describe('.config/dotnet-tools.json', () => { const packageFile = '.config/dotnet-tools.json'; - const contents = loadFixture('dotnet-tools.json'); + const contents = Fixtures.get('dotnet-tools.json'); it('works', async () => { expect(await extractPackageFile(contents, packageFile, config)).toEqual( diff --git a/lib/modules/manager/nvm/extract.spec.ts b/lib/modules/manager/nvm/extract.spec.ts index 2f98f18c07decd..85b94329c2bd35 100644 --- a/lib/modules/manager/nvm/extract.spec.ts +++ b/lib/modules/manager/nvm/extract.spec.ts @@ -1,4 +1,4 @@ -import { extractPackageFile } from './extract'; +import { extractPackageFile } from '.'; describe('modules/manager/nvm/extract', () => { describe('extractPackageFile()', () => { diff --git a/lib/modules/manager/pip-compile/artifacts.spec.ts b/lib/modules/manager/pip-compile/artifacts.spec.ts index a78065efb7194a..b2affb7dacdc61 100644 --- a/lib/modules/manager/pip-compile/artifacts.spec.ts +++ b/lib/modules/manager/pip-compile/artifacts.spec.ts @@ -1,17 +1,16 @@ -import { exec as _exec } from 'child_process'; import _fs from 'fs-extra'; import { join } from 'upath'; -import { envMock, mockExecAll } from '../../../../test/exec-util'; +import { envMock, exec, mockExecAll } from '../../../../test/exec-util'; import { Fixtures } from '../../../../test/fixtures'; -import { git, mocked } from '../../../../test/util'; +import { env, git } from '../../../../test/util'; import { GlobalConfig } from '../../../config/global'; import type { RepoGlobalConfig } from '../../../config/types'; import { logger } from '../../../logger'; import * as docker from '../../../util/exec/docker'; -import * as _env from '../../../util/exec/env'; import type { StatusResult } from '../../../util/git/types'; import type { UpdateArtifactsConfig } from '../types'; -import * as pipCompile from './artifacts'; +import { constructPipCompileCmd } from './artifacts'; +import { updateArtifacts } from '.'; jest.mock('fs-extra'); jest.mock('child_process'); @@ -21,8 +20,6 @@ jest.mock('../../../util/host-rules'); jest.mock('../../../util/http'); const fs: jest.Mocked = _fs as any; -const exec: jest.Mock = _exec as any; -const env = mocked(_env); const adminConfig: RepoGlobalConfig = { // `join` fixes Windows CI @@ -48,7 +45,7 @@ describe('modules/manager/pip-compile/artifacts', () => { it('returns if no requirements.txt found', async () => { expect( - await pipCompile.updateArtifacts({ + await updateArtifacts({ packageFileName: 'requirements.in', updatedDeps: [], newPackageFileContent: '', @@ -62,7 +59,7 @@ describe('modules/manager/pip-compile/artifacts', () => { const execSnapshots = mockExecAll(exec); fs.readFile.mockReturnValueOnce('content' as any); expect( - await pipCompile.updateArtifacts({ + await updateArtifacts({ packageFileName: 'requirements.in', updatedDeps: [], newPackageFileContent: 'some new content', @@ -80,7 +77,7 @@ describe('modules/manager/pip-compile/artifacts', () => { } as StatusResult); fs.readFile.mockReturnValueOnce('New requirements.txt' as any); expect( - await pipCompile.updateArtifacts({ + await updateArtifacts({ packageFileName: 'requirements.in', updatedDeps: [], newPackageFileContent: 'some new content', @@ -98,7 +95,7 @@ describe('modules/manager/pip-compile/artifacts', () => { } as StatusResult); fs.readFile.mockReturnValueOnce('new lock' as any); expect( - await pipCompile.updateArtifacts({ + await updateArtifacts({ packageFileName: 'requirements.in', updatedDeps: [], newPackageFileContent: 'some new content', @@ -114,7 +111,7 @@ describe('modules/manager/pip-compile/artifacts', () => { throw new Error('not found'); }); expect( - await pipCompile.updateArtifacts({ + await updateArtifacts({ packageFileName: 'requirements.in', updatedDeps: [], newPackageFileContent: '{}', @@ -135,7 +132,7 @@ describe('modules/manager/pip-compile/artifacts', () => { } as StatusResult); fs.readFile.mockReturnValueOnce('New requirements.txt' as any); expect( - await pipCompile.updateArtifacts({ + await updateArtifacts({ packageFileName: 'requirements.in', updatedDeps: [], newPackageFileContent: '{}', @@ -153,7 +150,7 @@ describe('modules/manager/pip-compile/artifacts', () => { } as StatusResult); fs.readFile.mockReturnValueOnce('new lock' as any); expect( - await pipCompile.updateArtifacts({ + await updateArtifacts({ packageFileName: 'requirements.in', updatedDeps: [], newPackageFileContent: 'some new content', @@ -166,7 +163,7 @@ describe('modules/manager/pip-compile/artifacts', () => { describe('constructPipCompileCmd()', () => { it('returns default cmd for garbage', () => { expect( - pipCompile.constructPipCompileCmd( + constructPipCompileCmd( Fixtures.get('requirementsNoHeaders.txt'), 'subdir/requirements.in', 'subdir/requirements.txt' @@ -176,7 +173,7 @@ describe('modules/manager/pip-compile/artifacts', () => { it('returns extracted common arguments (like those featured in the README)', () => { expect( - pipCompile.constructPipCompileCmd( + constructPipCompileCmd( Fixtures.get('requirementsWithHashes.txt'), 'subdir/requirements.in', 'subdir/requirements.txt' @@ -188,7 +185,7 @@ describe('modules/manager/pip-compile/artifacts', () => { it('skips unknown arguments', () => { expect( - pipCompile.constructPipCompileCmd( + constructPipCompileCmd( Fixtures.get('requirementsWithUnknownArguments.txt'), 'subdir/requirements.in', 'subdir/requirements.txt' @@ -202,7 +199,7 @@ describe('modules/manager/pip-compile/artifacts', () => { it('skips exploitable subcommands and files', () => { expect( - pipCompile.constructPipCompileCmd( + constructPipCompileCmd( Fixtures.get('requirementsWithExploitingArguments.txt'), 'subdir/requirements.in', 'subdir/requirements.txt' diff --git a/lib/modules/manager/pip_requirements/artifacts.spec.ts b/lib/modules/manager/pip_requirements/artifacts.spec.ts index e5db0d19b61055..c7e6d912b01577 100644 --- a/lib/modules/manager/pip_requirements/artifacts.spec.ts +++ b/lib/modules/manager/pip_requirements/artifacts.spec.ts @@ -1,7 +1,7 @@ import { fs } from '../../../../test/util'; import { GlobalConfig } from '../../../config/global'; import type { UpdateArtifactsConfig } from '../types'; -import { updateArtifacts } from './artifacts'; +import { updateArtifacts } from '.'; jest.mock('child_process'); jest.mock('../../../util/exec'); @@ -73,7 +73,7 @@ describe('modules/manager/pip_requirements/artifacts', () => { }); expect( await updateArtifacts({ - packageFileName: null, + packageFileName: '', updatedDeps: [{ depName: 'atomicwrites' }], newPackageFileContent, config, diff --git a/lib/modules/manager/pip_requirements/extract.spec.ts b/lib/modules/manager/pip_requirements/extract.spec.ts index 9751ce1dc157e8..42f63dc3e7256c 100644 --- a/lib/modules/manager/pip_requirements/extract.spec.ts +++ b/lib/modules/manager/pip_requirements/extract.spec.ts @@ -1,17 +1,17 @@ -import { loadFixture } from '../../../../test/util'; +import { Fixtures } from '../../../../test/fixtures'; import { GlobalConfig } from '../../../config/global'; -import { extractPackageFile } from './extract'; - -const requirements1 = loadFixture('requirements1.txt'); -const requirements2 = loadFixture('requirements2.txt'); -const requirements3 = loadFixture('requirements3.txt'); -const requirements4 = loadFixture('requirements4.txt'); -const requirements5 = loadFixture('requirements5.txt'); -const requirements6 = loadFixture('requirements6.txt'); -const requirements7 = loadFixture('requirements7.txt'); -const requirements8 = loadFixture('requirements8.txt'); -const requirementsWithEnvMarkers = loadFixture('requirements-env-markers.txt'); -const requirementsGitPackages = loadFixture('requirements-git-packages.txt'); +import { extractPackageFile } from '.'; + +const requirements1 = Fixtures.get('requirements1.txt'); +const requirements2 = Fixtures.get('requirements2.txt'); +const requirements3 = Fixtures.get('requirements3.txt'); +const requirements4 = Fixtures.get('requirements4.txt'); +const requirements5 = Fixtures.get('requirements5.txt'); +const requirements6 = Fixtures.get('requirements6.txt'); +const requirements7 = Fixtures.get('requirements7.txt'); +const requirements8 = Fixtures.get('requirements8.txt'); +const requirementsWithEnvMarkers = Fixtures.get('requirements-env-markers.txt'); +const requirementsGitPackages = Fixtures.get('requirements-git-packages.txt'); describe('modules/manager/pip_requirements/extract', () => { beforeEach(() => { @@ -43,18 +43,18 @@ describe('modules/manager/pip_requirements/extract', () => { it('extracts dependencies', () => { const res = extractPackageFile(requirements1); expect(res).toMatchSnapshot(); - expect(res.registryUrls).toEqual(['http://example.com/private-pypi/']); - expect(res.deps).toHaveLength(4); + expect(res?.registryUrls).toEqual(['http://example.com/private-pypi/']); + expect(res?.deps).toHaveLength(4); }); it('extracts multiple dependencies', () => { - const res = extractPackageFile(requirements2).deps; + const res = extractPackageFile(requirements2)?.deps; expect(res).toMatchSnapshot(); expect(res).toHaveLength(5); }); it('handles comments and commands', () => { - const res = extractPackageFile(requirements3).deps; + const res = extractPackageFile(requirements3)?.deps; expect(res).toMatchSnapshot(); expect(res).toHaveLength(5); }); @@ -62,60 +62,60 @@ describe('modules/manager/pip_requirements/extract', () => { it('handles extras and complex index url', () => { const res = extractPackageFile(requirements4); expect(res).toMatchSnapshot(); - expect(res.registryUrls).toEqual([ + expect(res?.registryUrls).toEqual([ 'https://artifactory.company.com/artifactory/api/pypi/python/simple', ]); - expect(res.deps).toHaveLength(3); + expect(res?.deps).toHaveLength(3); }); it('handles extra index url', () => { const res = extractPackageFile(requirements5); expect(res).toMatchSnapshot(); - expect(res.registryUrls).toEqual([ + expect(res?.registryUrls).toEqual([ 'https://artifactory.company.com/artifactory/api/pypi/python/simple', ]); - expect(res.additionalRegistryUrls).toEqual([ + expect(res?.additionalRegistryUrls).toEqual([ 'http://example.com/private-pypi/', ]); - expect(res.deps).toHaveLength(6); + expect(res?.deps).toHaveLength(6); }); it('handles extra index url and defaults without index to config', () => { const res = extractPackageFile(requirements6); expect(res).toMatchSnapshot(); - expect(res.additionalRegistryUrls).toEqual([ + expect(res?.additionalRegistryUrls).toEqual([ 'http://example.com/private-pypi/', ]); - expect(res.deps).toHaveLength(6); + expect(res?.deps).toHaveLength(6); }); it('handles extra index url and defaults without index to pypi', () => { const res = extractPackageFile(requirements6); expect(res).toMatchSnapshot(); - expect(res.additionalRegistryUrls).toEqual([ + expect(res?.additionalRegistryUrls).toEqual([ 'http://example.com/private-pypi/', ]); - expect(res.deps).toHaveLength(6); + expect(res?.deps).toHaveLength(6); }); it('handles extra spaces around pinned dependency equal signs', () => { const res = extractPackageFile(requirements4); expect(res).toMatchSnapshot(); - expect(res.deps[0].currentValue).toStartWith('=='); - expect(res.deps[0].currentVersion).toStartWith('2.0.12'); - expect(res.deps[1].currentValue).toStartWith('=='); - expect(res.deps[1].currentVersion).toStartWith('4.1.1'); - expect(res.deps[2].currentValue).toStartWith('=='); - expect(res.deps[2].currentVersion).toStartWith('3.2.1'); + expect(res?.deps[0].currentValue).toStartWith('=='); + expect(res?.deps[0].currentVersion).toStartWith('2.0.12'); + expect(res?.deps[1].currentValue).toStartWith('=='); + expect(res?.deps[1].currentVersion).toStartWith('4.1.1'); + expect(res?.deps[2].currentValue).toStartWith('=='); + expect(res?.deps[2].currentVersion).toStartWith('3.2.1'); - expect(res.deps).toHaveLength(3); + expect(res?.deps).toHaveLength(3); }); it('should not replace env vars in low trust mode', () => { process.env.PIP_TEST_TOKEN = 'its-a-secret'; const res = extractPackageFile(requirements7); - expect(res.additionalRegistryUrls).toEqual([ + expect(res?.additionalRegistryUrls).toEqual([ 'http://$PIP_TEST_TOKEN:example.com/private-pypi/', 'http://${PIP_TEST_TOKEN}:example.com/private-pypi/', 'http://$PIP_TEST_TOKEN:example.com/private-pypi/', @@ -127,7 +127,7 @@ describe('modules/manager/pip_requirements/extract', () => { process.env.PIP_TEST_TOKEN = 'its-a-secret'; GlobalConfig.set({ exposeAllEnv: true }); const res = extractPackageFile(requirements7); - expect(res.additionalRegistryUrls).toEqual([ + expect(res?.additionalRegistryUrls).toEqual([ 'http://its-a-secret:example.com/private-pypi/', 'http://its-a-secret:example.com/private-pypi/', 'http://its-a-secret:example.com/private-pypi/', @@ -138,7 +138,7 @@ describe('modules/manager/pip_requirements/extract', () => { it('should handle hashes', () => { const res = extractPackageFile(requirements8); expect(res).toMatchSnapshot(); - expect(res.deps).toHaveLength(3); + expect(res?.deps).toHaveLength(3); }); it('should handle dependency and ignore env markers', () => { @@ -157,7 +157,7 @@ describe('modules/manager/pip_requirements/extract', () => { it('should handle git packages', () => { const res = extractPackageFile(requirementsGitPackages); - expect(res.deps).toHaveLength(5); + expect(res?.deps).toHaveLength(5); expect(res).toEqual({ deps: [ { diff --git a/lib/modules/manager/pip_setup/extract.spec.ts b/lib/modules/manager/pip_setup/extract.spec.ts index f8a908e2c5d909..9d94f95be96486 100644 --- a/lib/modules/manager/pip_setup/extract.spec.ts +++ b/lib/modules/manager/pip_setup/extract.spec.ts @@ -1,6 +1,6 @@ import { Fixtures } from '../../../../test/fixtures'; import type { ExtractConfig } from '../types'; -import { extractPackageFile } from './extract'; +import { extractPackageFile } from '.'; const packageFile = 'setup.py'; diff --git a/lib/modules/manager/pipenv/artifacts.spec.ts b/lib/modules/manager/pipenv/artifacts.spec.ts index 5b9679d8968a98..d7989afb5decff 100644 --- a/lib/modules/manager/pipenv/artifacts.spec.ts +++ b/lib/modules/manager/pipenv/artifacts.spec.ts @@ -6,7 +6,7 @@ import type { RepoGlobalConfig } from '../../../config/types'; import * as docker from '../../../util/exec/docker'; import type { StatusResult } from '../../../util/git/types'; import type { UpdateArtifactsConfig } from '../types'; -import * as pipenv from './artifacts'; +import * as pipenv from '.'; jest.mock('child_process'); jest.mock('../../../util/exec/env'); @@ -26,7 +26,8 @@ const config: UpdateArtifactsConfig = {}; const lockMaintenanceConfig = { ...config, isLockFileMaintenance: true }; describe('modules/manager/pipenv/artifacts', () => { - let pipFileLock; + // TODO: #7154 + let pipFileLock: any; beforeEach(() => { jest.resetAllMocks(); diff --git a/lib/modules/manager/pipenv/extract.spec.ts b/lib/modules/manager/pipenv/extract.spec.ts index b8c4efb7b38c91..b9d6bdd5687266 100644 --- a/lib/modules/manager/pipenv/extract.spec.ts +++ b/lib/modules/manager/pipenv/extract.spec.ts @@ -1,13 +1,14 @@ -import { fs as fsutil, loadFixture } from '../../../../test/util'; -import { extractPackageFile } from './extract'; +import { Fixtures } from '../../../../test/fixtures'; +import { fs as fsutil } from '../../../../test/util'; +import { extractPackageFile } from '.'; jest.mock('../../../util/fs'); -const pipfile1 = loadFixture('Pipfile1'); -const pipfile2 = loadFixture('Pipfile2'); -const pipfile3 = loadFixture('Pipfile3'); -const pipfile4 = loadFixture('Pipfile4'); -const pipfile5 = loadFixture('Pipfile5'); +const pipfile1 = Fixtures.get('Pipfile1'); +const pipfile2 = Fixtures.get('Pipfile2'); +const pipfile3 = Fixtures.get('Pipfile3'); +const pipfile4 = Fixtures.get('Pipfile4'); +const pipfile5 = Fixtures.get('Pipfile5'); describe('modules/manager/pipenv/extract', () => { describe('extractPackageFile()', () => { @@ -23,48 +24,48 @@ describe('modules/manager/pipenv/extract', () => { fsutil.localPathExists.mockResolvedValueOnce(true); const res = await extractPackageFile(pipfile1, 'Pipfile'); expect(res).toMatchSnapshot(); - expect(res.deps).toHaveLength(6); - expect(res.deps.filter((dep) => !dep.skipReason)).toHaveLength(4); + expect(res?.deps).toHaveLength(6); + expect(res?.deps.filter((dep) => !dep.skipReason)).toHaveLength(4); }); it('marks packages with "extras" as skipReason === any-version', async () => { const res = await extractPackageFile(pipfile3, 'Pipfile'); - expect(res.deps.filter((r) => !r.skipReason)).toHaveLength(0); - expect(res.deps.filter((r) => r.skipReason)).toHaveLength(6); + expect(res?.deps.filter((r) => !r.skipReason)).toHaveLength(0); + expect(res?.deps.filter((r) => r.skipReason)).toHaveLength(6); }); it('extracts multiple dependencies', async () => { fsutil.localPathExists.mockResolvedValueOnce(true); const res = await extractPackageFile(pipfile2, 'Pipfile'); expect(res).toMatchSnapshot(); - expect(res.deps).toHaveLength(5); + expect(res?.deps).toHaveLength(5); }); it('ignores git dependencies', async () => { const content = '[packages]\r\nflask = {git = "https://github.com/pallets/flask.git"}\r\nwerkzeug = ">=0.14"'; const res = await extractPackageFile(content, 'Pipfile'); - expect(res.deps.filter((r) => !r.skipReason)).toHaveLength(1); + expect(res?.deps.filter((r) => !r.skipReason)).toHaveLength(1); }); it('ignores invalid package names', async () => { const content = '[packages]\r\nfoo = "==1.0.0"\r\n_invalid = "==1.0.0"'; const res = await extractPackageFile(content, 'Pipfile'); - expect(res.deps).toHaveLength(2); - expect(res.deps.filter((dep) => !dep.skipReason)).toHaveLength(1); + expect(res?.deps).toHaveLength(2); + expect(res?.deps.filter((dep) => !dep.skipReason)).toHaveLength(1); }); it('ignores relative path dependencies', async () => { const content = '[packages]\r\nfoo = "==1.0.0"\r\ntest = {path = "."}'; const res = await extractPackageFile(content, 'Pipfile'); - expect(res.deps.filter((r) => !r.skipReason)).toHaveLength(1); + expect(res?.deps.filter((r) => !r.skipReason)).toHaveLength(1); }); it('ignores invalid versions', async () => { const content = '[packages]\r\nfoo = "==1.0.0"\r\nsome-package = "==0 0"'; const res = await extractPackageFile(content, 'Pipfile'); - expect(res.deps).toHaveLength(2); - expect(res.deps.filter((dep) => !dep.skipReason)).toHaveLength(1); + expect(res?.deps).toHaveLength(2); + expect(res?.deps.filter((dep) => !dep.skipReason)).toHaveLength(1); }); it('extracts all sources', async () => { @@ -73,7 +74,7 @@ describe('modules/manager/pipenv/extract', () => { '[[source]]\r\nurl = "other-source-url"\r\n' + '[packages]\r\nfoo = "==1.0.0"\r\n'; const res = await extractPackageFile(content, 'Pipfile'); - expect(res.registryUrls).toEqual(['source-url', 'other-source-url']); + expect(res?.registryUrls).toEqual(['source-url', 'other-source-url']); }); it('extracts example pipfile', async () => { @@ -111,10 +112,10 @@ describe('modules/manager/pipenv/extract', () => { fsutil.localPathExists.mockResolvedValueOnce(true); const res = await extractPackageFile(pipfile5, 'Pipfile'); expect(res).toMatchSnapshot(); - expect(res.registryUrls).toBeDefined(); - expect(res.registryUrls).toHaveLength(2); - expect(res.deps[0].registryUrls).toBeDefined(); - expect(res.deps[0].registryUrls).toHaveLength(1); + expect(res?.registryUrls).toBeDefined(); + expect(res?.registryUrls).toHaveLength(2); + expect(res?.deps[0].registryUrls).toBeDefined(); + expect(res?.deps[0].registryUrls).toHaveLength(1); }); it('gets python constraint from python_version', async () => { @@ -122,7 +123,7 @@ describe('modules/manager/pipenv/extract', () => { '[packages]\r\nfoo = "==1.0.0"\r\n' + '[requires]\r\npython_version = "3.8"'; const res = await extractPackageFile(content, 'Pipfile'); - expect(res.constraints.python).toBe('== 3.8.*'); + expect(res?.constraints?.python).toBe('== 3.8.*'); }); it('gets python constraint from python_full_version', async () => { @@ -130,19 +131,19 @@ describe('modules/manager/pipenv/extract', () => { '[packages]\r\nfoo = "==1.0.0"\r\n' + '[requires]\r\npython_full_version = "3.8.6"'; const res = await extractPackageFile(content, 'Pipfile'); - expect(res.constraints.python).toBe('== 3.8.6'); + expect(res?.constraints?.python).toBe('== 3.8.6'); }); it('gets pipenv constraint from packages', async () => { const content = '[packages]\r\npipenv = "==2020.8.13"'; const res = await extractPackageFile(content, 'Pipfile'); - expect(res.constraints.pipenv).toBe('==2020.8.13'); + expect(res?.constraints?.pipenv).toBe('==2020.8.13'); }); it('gets pipenv constraint from dev-packages', async () => { const content = '[dev-packages]\r\npipenv = "==2020.8.13"'; const res = await extractPackageFile(content, 'Pipfile'); - expect(res.constraints.pipenv).toBe('==2020.8.13'); + expect(res?.constraints?.pipenv).toBe('==2020.8.13'); }); }); }); diff --git a/lib/modules/manager/poetry/artifacts.spec.ts b/lib/modules/manager/poetry/artifacts.spec.ts index 3f29846ba5615a..366ed95932071a 100644 --- a/lib/modules/manager/poetry/artifacts.spec.ts +++ b/lib/modules/manager/poetry/artifacts.spec.ts @@ -1,19 +1,18 @@ -import { exec as _exec } from 'child_process'; import _fs from 'fs-extra'; import { join } from 'upath'; -import { envMock, mockExecAll } from '../../../../test/exec-util'; -import { loadFixture, mocked } from '../../../../test/util'; +import { envMock, exec, mockExecAll } from '../../../../test/exec-util'; +import { Fixtures } from '../../../../test/fixtures'; +import { env, mocked } from '../../../../test/util'; import { GlobalConfig } from '../../../config/global'; import type { RepoGlobalConfig } from '../../../config/types'; import * as docker from '../../../util/exec/docker'; -import * as _env from '../../../util/exec/env'; import * as _hostRules from '../../../util/host-rules'; import * as _datasource from '../../datasource'; import type { UpdateArtifactsConfig } from '../types'; -import { updateArtifacts } from './artifacts'; +import { updateArtifacts } from '.'; -const pyproject1toml = loadFixture('pyproject.1.toml'); -const pyproject10toml = loadFixture('pyproject.10.toml'); +const pyproject1toml = Fixtures.get('pyproject.1.toml'); +const pyproject10toml = Fixtures.get('pyproject.10.toml'); jest.mock('fs-extra'); jest.mock('child_process'); @@ -22,8 +21,6 @@ jest.mock('../../datasource'); jest.mock('../../../util/host-rules'); const fs: jest.Mocked = _fs as any; -const exec: jest.Mock = _exec as any; -const env = mocked(_env); const datasource = mocked(_datasource); const hostRules = mocked(_hostRules); @@ -97,7 +94,8 @@ describe('modules/manager/poetry/artifacts', () => { }); it('passes private credential environment vars', async () => { - fs.readFile.mockResolvedValueOnce(null); + // TODO #7154 + fs.readFile.mockResolvedValueOnce(null as never); fs.readFile.mockResolvedValueOnce('[metadata]\n' as never); const execSnapshots = mockExecAll(exec); fs.readFile.mockReturnValueOnce('New poetry.lock' as any); @@ -122,7 +120,8 @@ describe('modules/manager/poetry/artifacts', () => { }); it('prioritizes pypi-scoped credentials', async () => { - fs.readFile.mockResolvedValueOnce(null); + // TODO #7154 + fs.readFile.mockResolvedValueOnce(null as never); fs.readFile.mockResolvedValueOnce(Buffer.from('[metadata]\n')); const execSnapshots = mockExecAll(exec); fs.readFile.mockResolvedValueOnce(Buffer.from('New poetry.lock')); @@ -147,7 +146,8 @@ describe('modules/manager/poetry/artifacts', () => { }); it('returns updated pyproject.lock', async () => { - fs.readFile.mockResolvedValueOnce(null); + // TODO #7154 + fs.readFile.mockResolvedValueOnce(null as never); fs.readFile.mockResolvedValueOnce('[metadata]\n' as never); const execSnapshots = mockExecAll(exec); fs.readFile.mockReturnValueOnce('New poetry.lock' as any); diff --git a/lib/modules/manager/poetry/extract.spec.ts b/lib/modules/manager/poetry/extract.spec.ts index 1a390223fdd2f7..4892799b64c39c 100644 --- a/lib/modules/manager/poetry/extract.spec.ts +++ b/lib/modules/manager/poetry/extract.spec.ts @@ -1,21 +1,22 @@ -import { fs, loadFixture } from '../../../../test/util'; -import { extractPackageFile } from './extract'; +import { Fixtures } from '../../../../test/fixtures'; +import { fs } from '../../../../test/util'; +import { extractPackageFile } from '.'; jest.mock('../../../util/fs'); -const pyproject1toml = loadFixture('pyproject.1.toml'); -const pyproject2toml = loadFixture('pyproject.2.toml'); -const pyproject3toml = loadFixture('pyproject.3.toml'); -const pyproject4toml = loadFixture('pyproject.4.toml'); -const pyproject5toml = loadFixture('pyproject.5.toml'); -const pyproject6toml = loadFixture('pyproject.6.toml'); -const pyproject7toml = loadFixture('pyproject.7.toml'); -const pyproject8toml = loadFixture('pyproject.8.toml'); -const pyproject9toml = loadFixture('pyproject.9.toml'); +const pyproject1toml = Fixtures.get('pyproject.1.toml'); +const pyproject2toml = Fixtures.get('pyproject.2.toml'); +const pyproject3toml = Fixtures.get('pyproject.3.toml'); +const pyproject4toml = Fixtures.get('pyproject.4.toml'); +const pyproject5toml = Fixtures.get('pyproject.5.toml'); +const pyproject6toml = Fixtures.get('pyproject.6.toml'); +const pyproject7toml = Fixtures.get('pyproject.7.toml'); +const pyproject8toml = Fixtures.get('pyproject.8.toml'); +const pyproject9toml = Fixtures.get('pyproject.9.toml'); // pyproject.10.toml use by artifacts -const pyproject11toml = loadFixture('pyproject.11.toml'); -const pyproject11tomlLock = loadFixture('pyproject.11.toml.lock'); +const pyproject11toml = Fixtures.get('pyproject.11.toml'); +const pyproject11tomlLock = Fixtures.get('pyproject.11.toml.lock'); describe('modules/manager/poetry/extract', () => { describe('extractPackageFile()', () => { @@ -42,9 +43,9 @@ describe('modules/manager/poetry/extract', () => { it('extracts multiple dependencies', async () => { const res = await extractPackageFile(pyproject1toml, filename); - expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(9); - expect(res.extractedConstraints).toEqual({ + expect(res?.deps).toMatchSnapshot(); + expect(res?.deps).toHaveLength(9); + expect(res?.extractedConstraints).toEqual({ python: '~2.7 || ^3.4', }); }); @@ -52,7 +53,7 @@ describe('modules/manager/poetry/extract', () => { it('extracts multiple dependencies (with dep = {version = "1.2.3"} case)', async () => { const res = await extractPackageFile(pyproject2toml, filename); expect(res).toMatchSnapshot(); - expect(res.deps).toHaveLength(7); + expect(res?.deps).toHaveLength(7); }); it('handles case with no dependencies', async () => { @@ -63,23 +64,23 @@ describe('modules/manager/poetry/extract', () => { it('handles multiple constraint dependencies', async () => { const res = await extractPackageFile(pyproject4toml, filename); expect(res).toMatchSnapshot(); - expect(res.deps).toHaveLength(1); + expect(res?.deps).toHaveLength(1); }); it('extracts registries', async () => { const res = await extractPackageFile(pyproject6toml, filename); - expect(res.registryUrls).toMatchSnapshot(); - expect(res.registryUrls).toHaveLength(3); + expect(res?.registryUrls).toMatchSnapshot(); + expect(res?.registryUrls).toHaveLength(3); }); it('can parse empty registries', async () => { const res = await extractPackageFile(pyproject7toml, filename); - expect(res.registryUrls).toBeUndefined(); + expect(res?.registryUrls).toBeUndefined(); }); it('can parse missing registries', async () => { const res = await extractPackageFile(pyproject1toml, filename); - expect(res.registryUrls).toBeUndefined(); + expect(res?.registryUrls).toBeUndefined(); }); it('dedupes registries', async () => { @@ -143,7 +144,7 @@ describe('modules/manager/poetry/extract', () => { it('skips git dependencies', async () => { const content = '[tool.poetry.dependencies]\r\nflask = {git = "https://github.com/pallets/flask.git"}\r\nwerkzeug = ">=0.14"'; - const res = (await extractPackageFile(content, filename)).deps; + const res = (await extractPackageFile(content, filename))!.deps; expect(res[0].depName).toBe('flask'); expect(res[0].currentValue).toBeEmptyString(); expect(res[0].skipReason).toBe('git-dependency'); @@ -153,7 +154,7 @@ describe('modules/manager/poetry/extract', () => { it('skips git dependencies with version', async () => { const content = '[tool.poetry.dependencies]\r\nflask = {git = "https://github.com/pallets/flask.git", version="1.2.3"}\r\nwerkzeug = ">=0.14"'; - const res = (await extractPackageFile(content, filename)).deps; + const res = (await extractPackageFile(content, filename))!.deps; expect(res[0].depName).toBe('flask'); expect(res[0].currentValue).toBe('1.2.3'); expect(res[0].skipReason).toBe('git-dependency'); @@ -163,7 +164,7 @@ describe('modules/manager/poetry/extract', () => { it('skips path dependencies', async () => { const content = '[tool.poetry.dependencies]\r\nflask = {path = "/some/path/"}\r\nwerkzeug = ">=0.14"'; - const res = (await extractPackageFile(content, filename)).deps; + const res = (await extractPackageFile(content, filename))!.deps; expect(res[0].depName).toBe('flask'); expect(res[0].currentValue).toBe(''); expect(res[0].skipReason).toBe('path-dependency'); @@ -173,7 +174,7 @@ describe('modules/manager/poetry/extract', () => { it('skips path dependencies with version', async () => { const content = '[tool.poetry.dependencies]\r\nflask = {path = "/some/path/", version = "1.2.3"}\r\nwerkzeug = ">=0.14"'; - const res = (await extractPackageFile(content, filename)).deps; + const res = (await extractPackageFile(content, filename))!.deps; expect(res[0].depName).toBe('flask'); expect(res[0].currentValue).toBe('1.2.3'); expect(res[0].skipReason).toBe('path-dependency'); diff --git a/lib/modules/manager/poetry/update-locked.spec.ts b/lib/modules/manager/poetry/update-locked.spec.ts index 2151734f477966..3118f8afe3b211 100644 --- a/lib/modules/manager/poetry/update-locked.spec.ts +++ b/lib/modules/manager/poetry/update-locked.spec.ts @@ -1,11 +1,11 @@ -import { loadFixture } from '../../../../test/util'; +import { Fixtures } from '../../../../test/fixtures'; import type { UpdateLockedConfig } from '../types'; import { updateLockedDependency } from '.'; const lockFile = 'pyproject.11.toml.lock'; const packageFile = 'pyproject.11.toml'; -const lockFileContent = loadFixture(lockFile); +const lockFileContent = Fixtures.get(lockFile); describe('modules/manager/poetry/update-locked', () => { it('detects already updated', () => { diff --git a/lib/modules/manager/pre-commit/extract.spec.ts b/lib/modules/manager/pre-commit/extract.spec.ts index 215ad73cc833e3..d7278ae7602814 100644 --- a/lib/modules/manager/pre-commit/extract.spec.ts +++ b/lib/modules/manager/pre-commit/extract.spec.ts @@ -1,21 +1,22 @@ -import { loadFixture, mocked } from '../../../../test/util'; +import { Fixtures } from '../../../../test/fixtures'; +import { mocked } from '../../../../test/util'; import * as _hostRules from '../../../util/host-rules'; -import { extractPackageFile } from './extract'; +import { extractPackageFile } from '.'; jest.mock('../../../util/host-rules'); const hostRules = mocked(_hostRules); const filename = '.pre-commit.yaml'; -const complexPrecommitConfig = loadFixture('complex.pre-commit-config.yaml'); -const examplePrecommitConfig = loadFixture('.pre-commit-config.yaml'); -const emptyReposPrecommitConfig = loadFixture( +const complexPrecommitConfig = Fixtures.get('complex.pre-commit-config.yaml'); +const examplePrecommitConfig = Fixtures.get('.pre-commit-config.yaml'); +const emptyReposPrecommitConfig = Fixtures.get( 'empty_repos.pre-commit-config.yaml' ); -const noReposPrecommitConfig = loadFixture('no_repos.pre-commit-config.yaml'); -const invalidRepoPrecommitConfig = loadFixture( +const noReposPrecommitConfig = Fixtures.get('no_repos.pre-commit-config.yaml'); +const invalidRepoPrecommitConfig = Fixtures.get( 'invalid_repo.pre-commit-config.yaml' ); -const enterpriseGitPrecommitConfig = loadFixture( +const enterpriseGitPrecommitConfig = Fixtures.get( 'enterprise.pre-commit-config.yaml' ); @@ -36,7 +37,8 @@ describe('modules/manager/pre-commit/extract', () => { }); it('returns null for no file content', () => { - const result = extractPackageFile(null, filename); + // TODO #7154 + const result = extractPackageFile(null as never, filename); expect(result).toBeNull(); }); diff --git a/lib/modules/manager/pyenv/extract.spec.ts b/lib/modules/manager/pyenv/extract.spec.ts index 4608069ae7eaca..cd9183318b84e8 100644 --- a/lib/modules/manager/pyenv/extract.spec.ts +++ b/lib/modules/manager/pyenv/extract.spec.ts @@ -1,4 +1,4 @@ -import { extractPackageFile } from './extract'; +import { extractPackageFile } from '.'; describe('modules/manager/pyenv/extract', () => { describe('extractPackageFile()', () => { diff --git a/lib/modules/manager/regex/index.spec.ts b/lib/modules/manager/regex/index.spec.ts index 88ab4d4c463ee4..3437cec7fa26d3 100644 --- a/lib/modules/manager/regex/index.spec.ts +++ b/lib/modules/manager/regex/index.spec.ts @@ -1,12 +1,12 @@ -import { loadFixture } from '../../../../test/util'; +import { Fixtures } from '../../../../test/fixtures'; import { logger } from '../../../logger'; import type { CustomExtractConfig } from '../types'; import { defaultConfig, extractPackageFile } from '.'; -const dockerfileContent = loadFixture(`Dockerfile`); -const ansibleYamlContent = loadFixture(`ansible.yml`); -const exampleJsonContent = loadFixture(`example.json`); -const exampleGitlabCiYml = loadFixture(`gitlab-ci.yml`); +const dockerfileContent = Fixtures.get(`Dockerfile`); +const ansibleYamlContent = Fixtures.get(`ansible.yml`); +const exampleJsonContent = Fixtures.get(`example.json`); +const exampleGitlabCiYml = Fixtures.get(`gitlab-ci.yml`); describe('modules/manager/regex/index', () => { it('has default config', () => { @@ -30,14 +30,14 @@ describe('modules/manager/regex/index', () => { config ); expect(res).toMatchSnapshot(); - expect(res.deps).toHaveLength(8); - expect(res.deps.find((dep) => dep.depName === 'yarn').versioning).toBe( + expect(res?.deps).toHaveLength(8); + expect(res?.deps.find((dep) => dep.depName === 'yarn')?.versioning).toBe( 'semver' ); - expect(res.deps.find((dep) => dep.depName === 'gradle').versioning).toBe( + expect(res?.deps.find((dep) => dep.depName === 'gradle')?.versioning).toBe( 'maven' ); - expect(res.deps.filter((dep) => dep.depType === 'final')).toHaveLength(8); + expect(res?.deps.filter((dep) => dep.depType === 'final')).toHaveLength(8); }); it('returns null if no dependencies found', async () => { @@ -79,11 +79,11 @@ describe('modules/manager/regex/index', () => { config ); expect(res).toMatchSnapshot(); - expect(res.deps).toHaveLength(1); + expect(res?.deps).toHaveLength(1); expect( - res.deps.find( + res?.deps.find( (dep) => dep.depName === 'openresty/headers-more-nginx-module' - ).extractVersion + )?.extractVersion ).toBe('^v(?.*)$'); }); @@ -136,9 +136,9 @@ describe('modules/manager/regex/index', () => { config ); expect(res).toMatchSnapshot(); - expect(res.deps).toHaveLength(1); + expect(res?.deps).toHaveLength(1); expect( - res.deps.find((dep) => dep.depName === 'gradle').registryUrls + res?.deps.find((dep) => dep.depName === 'gradle')?.registryUrls ).toEqual(['http://registry.gradle.com/']); }); @@ -186,11 +186,11 @@ describe('modules/manager/regex/index', () => { config ); expect(res).toMatchSnapshot(); - expect(res.deps).toHaveLength(2); + expect(res?.deps).toHaveLength(2); expect( - res.deps.find((dep) => dep.depName === 'nodejs/node').versioning + res?.deps.find((dep) => dep.depName === 'nodejs/node')?.versioning ).toBe('node'); - expect(res.deps.find((dep) => dep.depName === 'gradle').versioning).toBe( + expect(res?.deps.find((dep) => dep.depName === 'gradle')?.versioning).toBe( 'maven' ); }); @@ -210,7 +210,7 @@ describe('modules/manager/regex/index', () => { config ); expect(res).toMatchSnapshot(); - expect(res.deps).toHaveLength(1); + expect(res?.deps).toHaveLength(1); }); it('extracts with combination strategy', async () => { @@ -228,7 +228,7 @@ describe('modules/manager/regex/index', () => { config ); expect(res).toMatchSnapshot(); - expect(res.deps).toHaveLength(1); + expect(res?.deps).toHaveLength(1); }); it('extracts with combination strategy and non standard capture groups', async () => { @@ -248,8 +248,8 @@ describe('modules/manager/regex/index', () => { 'ansible.yml', config ); - expect(res.deps).toHaveLength(1); - expect(res.deps[0].depName).toBe('docker.io/prom/prometheus'); + expect(res?.deps).toHaveLength(1); + expect(res?.deps[0].depName).toBe('docker.io/prom/prometheus'); expect(res).toMatchSnapshot(); }); @@ -268,7 +268,7 @@ describe('modules/manager/regex/index', () => { config ); expect(res).toMatchSnapshot(); - expect(res.deps).toHaveLength(1); + expect(res?.deps).toHaveLength(1); }); it('extracts with combination strategy and registry url', async () => { @@ -287,7 +287,7 @@ describe('modules/manager/regex/index', () => { config ); expect(res).toMatchSnapshot(); - expect(res.deps).toHaveLength(1); + expect(res?.deps).toHaveLength(1); }); it('extracts with combination strategy and templates', async () => { @@ -306,7 +306,7 @@ describe('modules/manager/regex/index', () => { config ); expect(res).toMatchSnapshot(); - expect(res.deps).toHaveLength(1); + expect(res?.deps).toHaveLength(1); }); it('extracts with combination strategy and empty file', async () => { @@ -337,7 +337,7 @@ describe('modules/manager/regex/index', () => { config ); expect(res).toMatchSnapshot(); - expect(res.deps).toHaveLength(1); + expect(res?.deps).toHaveLength(1); }); it('extracts with recursive strategy and multiple matches', async () => { @@ -354,7 +354,7 @@ describe('modules/manager/regex/index', () => { config ); expect(res).toMatchSnapshot(); - expect(res.deps).toHaveLength(2); + expect(res?.deps).toHaveLength(2); }); it('extracts with recursive strategy and multiple layers ', async () => { @@ -372,7 +372,7 @@ describe('modules/manager/regex/index', () => { config ); expect(res).toMatchSnapshot(); - expect(res.deps).toHaveLength(1); + expect(res?.deps).toHaveLength(1); }); it('extracts with recursive strategy and fail because of not sufficient regexes', async () => { @@ -417,6 +417,6 @@ describe('modules/manager/regex/index', () => { config ); expect(res).toMatchSnapshot(); - expect(res.deps).toHaveLength(4); + expect(res?.deps).toHaveLength(4); }); }); diff --git a/lib/modules/manager/ruby-version/extract.spec.ts b/lib/modules/manager/ruby-version/extract.spec.ts index f75ecece6316c3..ceb1c62d6b3522 100644 --- a/lib/modules/manager/ruby-version/extract.spec.ts +++ b/lib/modules/manager/ruby-version/extract.spec.ts @@ -1,4 +1,4 @@ -import { extractPackageFile } from './extract'; +import { extractPackageFile } from '.'; describe('modules/manager/ruby-version/extract', () => { describe('extractPackageFile()', () => { diff --git a/lib/modules/manager/sbt/extract.spec.ts b/lib/modules/manager/sbt/extract.spec.ts index 8a38f2f0984751..1cbae8b5ea0a45 100644 --- a/lib/modules/manager/sbt/extract.spec.ts +++ b/lib/modules/manager/sbt/extract.spec.ts @@ -1,5 +1,5 @@ import { Fixtures } from '../../../../test/fixtures'; -import { extractPackageFile } from './extract'; +import { extractPackageFile } from '.'; const sbt = Fixtures.get(`sample.sbt`); const sbtScalaVersionVariable = Fixtures.get(`scala-version-variable.sbt`); @@ -12,7 +12,7 @@ const sbtPrivateVariableDependencyFile = Fixtures.get( describe('modules/manager/sbt/extract', () => { describe('extractPackageFile()', () => { it('returns null for empty', () => { - expect(extractPackageFile(null)).toBeNull(); + expect(extractPackageFile('')).toBeNull(); expect(extractPackageFile('non-sense')).toBeNull(); expect( extractPackageFile('libraryDependencies += "foo" % "bar" % ???') diff --git a/lib/modules/manager/sbt/update.spec.ts b/lib/modules/manager/sbt/update.spec.ts index 96423b065edac0..b3336b956c6e56 100644 --- a/lib/modules/manager/sbt/update.spec.ts +++ b/lib/modules/manager/sbt/update.spec.ts @@ -1,4 +1,4 @@ -import * as sbtUpdater from './update'; +import * as sbtUpdater from '.'; describe('modules/manager/sbt/update', () => { describe('.bumpPackageVersion()', () => { diff --git a/lib/modules/manager/setup-cfg/extract.spec.ts b/lib/modules/manager/setup-cfg/extract.spec.ts index 3c5fa453b0ee9d..c369d075955985 100644 --- a/lib/modules/manager/setup-cfg/extract.spec.ts +++ b/lib/modules/manager/setup-cfg/extract.spec.ts @@ -1,5 +1,5 @@ import { Fixtures } from '../../../../test/fixtures'; -import { extractPackageFile } from './extract'; +import { extractPackageFile } from '.'; describe('modules/manager/setup-cfg/extract', () => { describe('extractPackageFile()', () => { diff --git a/lib/modules/manager/swift/index.spec.ts b/lib/modules/manager/swift/index.spec.ts index 0f0e0ce483d89e..c2f1e6d748c543 100644 --- a/lib/modules/manager/swift/index.spec.ts +++ b/lib/modules/manager/swift/index.spec.ts @@ -1,10 +1,9 @@ import { Fixtures } from '../../../../test/fixtures'; -import { extractPackageFile } from './extract'; +import { extractPackageFile } from '.'; describe('modules/manager/swift/index', () => { describe('extractPackageFile()', () => { it('returns null for empty content', () => { - expect(extractPackageFile(null)).toBeNull(); expect(extractPackageFile(``)).toBeNull(); expect(extractPackageFile(`dependencies:[]`)).toBeNull(); expect(extractPackageFile(`dependencies:["foobar"]`)).toBeNull(); diff --git a/lib/modules/manager/terraform-version/extract.spec.ts b/lib/modules/manager/terraform-version/extract.spec.ts index f80423d46a0f07..65374c10959ff8 100644 --- a/lib/modules/manager/terraform-version/extract.spec.ts +++ b/lib/modules/manager/terraform-version/extract.spec.ts @@ -1,4 +1,4 @@ -import { extractPackageFile } from './extract'; +import { extractPackageFile } from '.'; describe('modules/manager/terraform-version/extract', () => { describe('extractPackageFile()', () => { diff --git a/lib/modules/manager/terraform/extract.spec.ts b/lib/modules/manager/terraform/extract.spec.ts index cc82364c0cbdd0..dd6a3f311ea6dc 100644 --- a/lib/modules/manager/terraform/extract.spec.ts +++ b/lib/modules/manager/terraform/extract.spec.ts @@ -5,22 +5,22 @@ import { GlobalConfig } from '../../../config/global'; import type { RepoGlobalConfig } from '../../../config/types'; import { extractPackageFile } from '.'; -const modules = Fixtures.get('modules.tf'); -const bitbucketModules = Fixtures.get('bitbucketModules.tf'); -const azureDevOpsModules = Fixtures.get('azureDevOpsModules.tf'); -const providers = Fixtures.get('providers.tf'); -const docker = Fixtures.get('docker.tf'); -const kubernetes = Fixtures.get('kubernetes.tf'); +const modules = Fixtures?.get('modules.tf'); +const bitbucketModules = Fixtures?.get('bitbucketModules.tf'); +const azureDevOpsModules = Fixtures?.get('azureDevOpsModules.tf'); +const providers = Fixtures?.get('providers.tf'); +const docker = Fixtures?.get('docker.tf'); +const kubernetes = Fixtures?.get('kubernetes.tf'); const tf2 = `module "relative" { source = "../fe" } `; -const helm = Fixtures.get('helm.tf'); -const lockedVersion = Fixtures.get('lockedVersion.tf'); -const lockedVersionLockfile = Fixtures.get('rangeStrategy.hcl'); -const terraformBlock = Fixtures.get('terraformBlock.tf'); -const tfeWorkspaceBlock = Fixtures.get('tfeWorkspace.tf'); +const helm = Fixtures?.get('helm.tf'); +const lockedVersion = Fixtures?.get('lockedVersion.tf'); +const lockedVersionLockfile = Fixtures?.get('rangeStrategy.hcl'); +const terraformBlock = Fixtures?.get('terraformBlock.tf'); +const tfeWorkspaceBlock = Fixtures?.get('tfeWorkspace.tf'); const adminConfig: RepoGlobalConfig = { // `join` fixes Windows CI @@ -43,15 +43,15 @@ describe('modules/manager/terraform/extract', () => { it('extracts modules', async () => { const res = await extractPackageFile(modules, 'modules.tf', {}); - expect(res.deps).toHaveLength(18); - expect(res.deps.filter((dep) => dep.skipReason)).toHaveLength(2); + expect(res?.deps).toHaveLength(18); + expect(res?.deps.filter((dep) => dep.skipReason)).toHaveLength(2); expect(res).toMatchSnapshot(); }); it('extracts bitbucket modules', async () => { const res = await extractPackageFile(bitbucketModules, 'modules.tf', {}); - expect(res.deps).toHaveLength(11); - expect(res.deps.filter((dep) => dep.skipReason)).toHaveLength(0); + expect(res?.deps).toHaveLength(11); + expect(res?.deps.filter((dep) => dep.skipReason)).toHaveLength(0); expect(res).toMatchSnapshot(); }); @@ -93,23 +93,23 @@ describe('modules/manager/terraform/extract', () => { it('extracts providers', async () => { const res = await extractPackageFile(providers, 'providers.tf', {}); - expect(res.deps).toHaveLength(14); - expect(res.deps.filter((dep) => dep.skipReason)).toHaveLength(2); + expect(res?.deps).toHaveLength(14); + expect(res?.deps.filter((dep) => dep.skipReason)).toHaveLength(2); expect(res).toMatchSnapshot(); }); it('extracts docker resources', async () => { const res = await extractPackageFile(docker, 'docker.tf', {}); - expect(res.deps).toHaveLength(8); - expect(res.deps.filter((dep) => dep.skipReason)).toHaveLength(5); + expect(res?.deps).toHaveLength(8); + expect(res?.deps.filter((dep) => dep.skipReason)).toHaveLength(5); expect(res).toMatchSnapshot(); }); it('extracts kubernetes resources', async () => { const res = await extractPackageFile(kubernetes, 'kubernetes.tf', {}); - expect(res.deps).toHaveLength(18); - expect(res.deps.filter((dep) => dep.skipReason)).toHaveLength(1); - expect(res.deps).toMatchObject([ + expect(res?.deps).toHaveLength(18); + expect(res?.deps.filter((dep) => dep.skipReason)).toHaveLength(1); + expect(res?.deps).toMatchObject([ { depName: 'gcr.io/kaniko-project/executor', currentValue: 'v1.7.0', @@ -210,8 +210,8 @@ describe('modules/manager/terraform/extract', () => { it('extract helm releases', async () => { const res = await extractPackageFile(helm, 'helm.tf', {}); expect(res).toMatchSnapshot(); - expect(res.deps).toHaveLength(6); - expect(res.deps.filter((dep) => dep.skipReason)).toHaveLength(2); + expect(res?.deps).toHaveLength(6); + expect(res?.deps.filter((dep) => dep.skipReason)).toHaveLength(2); }); it('update lockfile constraints with range strategy update-lockfile', async () => { @@ -224,8 +224,8 @@ describe('modules/manager/terraform/extract', () => { {} ); expect(res).toMatchSnapshot(); - expect(res.deps).toHaveLength(3); - expect(res.deps.filter((dep) => dep.skipReason)).toHaveLength(0); + expect(res?.deps).toHaveLength(3); + expect(res?.deps.filter((dep) => dep.skipReason)).toHaveLength(0); }); it('test terraform block with only requirement_terraform_version', async () => { @@ -234,8 +234,8 @@ describe('modules/manager/terraform/extract', () => { 'terraformBlock.tf', {} ); - expect(res.deps).toHaveLength(1); - expect(res.deps.filter((dep) => dep.skipReason)).toHaveLength(0); + expect(res?.deps).toHaveLength(1); + expect(res?.deps.filter((dep) => dep.skipReason)).toHaveLength(0); expect(res).toMatchSnapshot(); }); @@ -246,8 +246,8 @@ describe('modules/manager/terraform/extract', () => { {} ); expect(res).toMatchSnapshot(); - expect(res.deps).toHaveLength(3); - expect(res.deps.filter((dep) => dep.skipReason)).toHaveLength(1); + expect(res?.deps).toHaveLength(3); + expect(res?.deps.filter((dep) => dep.skipReason)).toHaveLength(1); }); }); }); diff --git a/lib/modules/manager/terraform/lockfile/index.spec.ts b/lib/modules/manager/terraform/lockfile/index.spec.ts index 350666da081dde..a99f29835c3c93 100644 --- a/lib/modules/manager/terraform/lockfile/index.spec.ts +++ b/lib/modules/manager/terraform/lockfile/index.spec.ts @@ -1,5 +1,6 @@ import { join } from 'upath'; -import { fs, loadFixture, mocked } from '../../../../../test/util'; +import { Fixtures } from '../../../../../test/fixtures'; +import { fs, mocked } from '../../../../../test/util'; import { GlobalConfig } from '../../../../config/global'; import { getPkgReleases } from '../../../datasource'; import type { UpdateArtifactsConfig } from '../../types'; @@ -21,8 +22,8 @@ const adminConfig = { cacheDir: join('/tmp/renovate/cache'), }; -const validLockfile = loadFixture('validLockfile.hcl'); -const validLockfile2 = loadFixture('validLockfile2.hcl'); +const validLockfile = Fixtures.get('validLockfile.hcl'); +const validLockfile2 = Fixtures.get('validLockfile2.hcl'); const mockHash = mocked(TerraformProviderHash).createHashes; const mockGetPkgReleases = getPkgReleases as jest.MockedFunction< @@ -37,7 +38,7 @@ describe('modules/manager/terraform/lockfile/index', () => { }); it('returns null if no .terraform.lock.hcl found', async () => { - fs.readLocalFile.mockResolvedValueOnce(null); + fs.readLocalFile.mockResolvedValueOnce(''); expect( await updateArtifacts({ @@ -50,7 +51,7 @@ describe('modules/manager/terraform/lockfile/index', () => { }); it('returns null if .terraform.lock.hcl is empty', async () => { - fs.readLocalFile.mockResolvedValueOnce('empty' as any); + fs.readLocalFile.mockResolvedValueOnce('empty'); expect( await updateArtifacts({ @@ -63,7 +64,7 @@ describe('modules/manager/terraform/lockfile/index', () => { }); it('update single dependency with exact constraint and depType provider', async () => { - fs.readLocalFile.mockResolvedValueOnce(validLockfile as any); + fs.readLocalFile.mockResolvedValueOnce(validLockfile); fs.getSiblingFileName.mockReturnValueOnce('.terraform.lock.hcl'); mockHash.mockResolvedValueOnce([ @@ -87,15 +88,15 @@ describe('modules/manager/terraform/lockfile/index', () => { }); expect(result).not.toBeNull(); expect(result).toBeArrayOfSize(1); - expect(result[0].file).not.toBeNull(); - expect(result[0].file).toMatchSnapshot(); + expect(result?.[0].file).not.toBeNull(); + expect(result?.[0].file).toMatchSnapshot(); expect(mockHash.mock.calls).toBeArrayOfSize(1); expect(mockHash.mock.calls).toMatchSnapshot(); }); it('update single dependency with exact constraint and and depType required_provider', async () => { - fs.readLocalFile.mockResolvedValueOnce(validLockfile as any); + fs.readLocalFile.mockResolvedValueOnce(validLockfile); fs.getSiblingFileName.mockReturnValueOnce('.terraform.lock.hcl'); mockHash.mockResolvedValueOnce([ @@ -119,8 +120,8 @@ describe('modules/manager/terraform/lockfile/index', () => { }); expect(result).not.toBeNull(); expect(result).toBeArrayOfSize(1); - expect(result[0].file).not.toBeNull(); - expect(result[0].file).toMatchSnapshot(); + expect(result?.[0].file).not.toBeNull(); + expect(result?.[0].file).toMatchSnapshot(); expect(mockHash.mock.calls).toBeArrayOfSize(1); expect(mockHash.mock.calls).toMatchSnapshot(); @@ -145,7 +146,7 @@ describe('modules/manager/terraform/lockfile/index', () => { }); it('update single dependency with range constraint and minor update from private registry', async () => { - fs.readLocalFile.mockResolvedValueOnce(validLockfile as any); + fs.readLocalFile.mockResolvedValueOnce(validLockfile); fs.getSiblingFileName.mockReturnValueOnce('.terraform.lock.hcl'); mockHash.mockResolvedValueOnce([ @@ -170,15 +171,15 @@ describe('modules/manager/terraform/lockfile/index', () => { }); expect(result).not.toBeNull(); expect(result).toBeArrayOfSize(1); - expect(result[0].file).not.toBeNull(); - expect(result[0].file).toMatchSnapshot(); + expect(result?.[0].file).not.toBeNull(); + expect(result?.[0].file).toMatchSnapshot(); expect(mockHash.mock.calls).toBeArrayOfSize(1); expect(mockHash.mock.calls).toMatchSnapshot(); }); it('update single dependency with range constraint and major update', async () => { - fs.readLocalFile.mockResolvedValueOnce(validLockfile as any); + fs.readLocalFile.mockResolvedValueOnce(validLockfile); fs.getSiblingFileName.mockReturnValueOnce('.terraform.lock.hcl'); mockHash.mockResolvedValueOnce([ @@ -202,15 +203,15 @@ describe('modules/manager/terraform/lockfile/index', () => { }); expect(result).not.toBeNull(); expect(result).toBeArrayOfSize(1); - expect(result[0].file).not.toBeNull(); - expect(result[0].file).toMatchSnapshot(); + expect(result?.[0].file).not.toBeNull(); + expect(result?.[0].file).toMatchSnapshot(); expect(mockHash.mock.calls).toBeArrayOfSize(1); expect(mockHash.mock.calls).toMatchSnapshot(); }); it('update single dependency in subfolder', async () => { - fs.readLocalFile.mockResolvedValueOnce(validLockfile as any); + fs.readLocalFile.mockResolvedValueOnce(validLockfile); fs.getSiblingFileName.mockReturnValueOnce('test/.terraform.lock.hcl'); mockHash.mockResolvedValueOnce([ @@ -234,15 +235,15 @@ describe('modules/manager/terraform/lockfile/index', () => { }); expect(result).not.toBeNull(); expect(result).toBeArrayOfSize(1); - expect(result[0].file).not.toBeNull(); - expect(result[0].file).toMatchSnapshot(); + expect(result?.[0].file).not.toBeNull(); + expect(result?.[0].file).toMatchSnapshot(); expect(mockHash.mock.calls).toBeArrayOfSize(1); expect(mockHash.mock.calls).toMatchSnapshot(); }); it('update multiple dependencies which are not ordered', async () => { - fs.readLocalFile.mockResolvedValue(validLockfile2 as any); + fs.readLocalFile.mockResolvedValue(validLockfile2); fs.getSiblingFileName.mockReturnValue('test/.terraform.lock.hcl'); mockHash.mockResolvedValue([ @@ -287,15 +288,15 @@ describe('modules/manager/terraform/lockfile/index', () => { }); expect(result).not.toBeNull(); expect(result).toBeArrayOfSize(1); - expect(result[0].file).not.toBeNull(); - expect(result[0].file).toMatchSnapshot(); + expect(result?.[0].file).not.toBeNull(); + expect(result?.[0].file).toMatchSnapshot(); expect(mockHash.mock.calls).toBeArrayOfSize(4); expect(mockHash.mock.calls).toMatchSnapshot(); }); it('do full lock file maintenance', async () => { - fs.readLocalFile.mockResolvedValueOnce(validLockfile as any); + fs.readLocalFile.mockResolvedValueOnce(validLockfile); fs.getSiblingFileName.mockReturnValueOnce('.terraform.lock.hcl'); mockGetPkgReleases @@ -360,15 +361,15 @@ describe('modules/manager/terraform/lockfile/index', () => { expect(result).not.toBeNull(); expect(result).toBeArrayOfSize(1); - result.forEach((value) => expect(value.file).not.toBeNull()); - result.forEach((value) => expect(value.file).toMatchSnapshot()); + result?.forEach((value) => expect(value.file).not.toBeNull()); + result?.forEach((value) => expect(value.file).toMatchSnapshot()); expect(mockHash.mock.calls).toBeArrayOfSize(2); expect(mockHash.mock.calls).toMatchSnapshot(); }); it('do full lock file maintenance with lockfile in subfolder', async () => { - fs.readLocalFile.mockResolvedValueOnce(validLockfile as any); + fs.readLocalFile.mockResolvedValueOnce(validLockfile); fs.getSiblingFileName.mockReturnValueOnce('subfolder/.terraform.lock.hcl'); mockGetPkgReleases @@ -433,15 +434,15 @@ describe('modules/manager/terraform/lockfile/index', () => { expect(result).not.toBeNull(); expect(result).toBeArrayOfSize(1); - result.forEach((value) => expect(value.file).not.toBeNull()); - result.forEach((value) => expect(value.file).toMatchSnapshot()); + result?.forEach((value) => expect(value.file).not.toBeNull()); + result?.forEach((value) => expect(value.file).toMatchSnapshot()); expect(mockHash.mock.calls).toBeArrayOfSize(2); expect(mockHash.mock.calls).toMatchSnapshot(); }); it('do full lock file maintenance without necessary changes', async () => { - fs.readLocalFile.mockResolvedValueOnce(validLockfile as any); + fs.readLocalFile.mockResolvedValueOnce(validLockfile); mockGetPkgReleases .mockResolvedValueOnce({ @@ -493,7 +494,7 @@ describe('modules/manager/terraform/lockfile/index', () => { }); it('return null if hashing fails', async () => { - fs.readLocalFile.mockResolvedValueOnce(validLockfile as any); + fs.readLocalFile.mockResolvedValueOnce(validLockfile); mockGetPkgReleases .mockResolvedValueOnce({ diff --git a/lib/modules/manager/terraform/modules.spec.ts b/lib/modules/manager/terraform/modules.spec.ts index 2978022009938c..6e7c6bb26549e2 100644 --- a/lib/modules/manager/terraform/modules.spec.ts +++ b/lib/modules/manager/terraform/modules.spec.ts @@ -8,18 +8,23 @@ import { describe('modules/manager/terraform/modules', () => { describe('githubRefMatchRegex', () => { it('should split project and tag from source', () => { - const { project, tag } = githubRefMatchRegex.exec( + const groups = githubRefMatchRegex.exec( 'github.com/hashicorp/example?ref=v1.0.0' - ).groups; - expect(project).toBe('hashicorp/example'); - expect(tag).toBe('v1.0.0'); + )?.groups; + expect(groups).toEqual({ + project: 'hashicorp/example', + tag: 'v1.0.0', + }); }); it('should parse alpha-numeric characters as well as dots, underscores, and dashes in repo names', () => { - const { project } = githubRefMatchRegex.exec( + const groups = githubRefMatchRegex.exec( 'github.com/hashicorp/example.repo-123?ref=v1.0.0' - ).groups; - expect(project).toBe('hashicorp/example.repo-123'); + )?.groups; + expect(groups).toEqual({ + project: 'hashicorp/example.repo-123', + tag: 'v1.0.0', + }); }); }); @@ -27,50 +32,59 @@ describe('modules/manager/terraform/modules', () => { it('should split project and tag from source', () => { const http = gitTagsRefMatchRegex.exec( 'http://github.com/hashicorp/example?ref=v1.0.0' - ).groups; + )?.groups; const https = gitTagsRefMatchRegex.exec( 'https://github.com/hashicorp/example?ref=v1.0.0' - ).groups; + )?.groups; const ssh = gitTagsRefMatchRegex.exec( 'ssh://github.com/hashicorp/example?ref=v1.0.0' - ).groups; - - expect(http.project).toBe('hashicorp/example'); - expect(http.tag).toBe('v1.0.0'); - - expect(https.project).toBe('hashicorp/example'); - expect(https.tag).toBe('v1.0.0'); + )?.groups; - expect(ssh.project).toBe('hashicorp/example'); - expect(ssh.tag).toBe('v1.0.0'); + expect(http).toMatchObject({ + project: 'hashicorp/example', + tag: 'v1.0.0', + }); + expect(https).toMatchObject({ + project: 'hashicorp/example', + tag: 'v1.0.0', + }); + expect(ssh).toMatchObject({ + project: 'hashicorp/example', + tag: 'v1.0.0', + }); }); it('should parse alpha-numeric characters as well as dots, underscores, and dashes in repo names', () => { const http = gitTagsRefMatchRegex.exec( 'http://github.com/hashicorp/example.repo-123?ref=v1.0.0' - ).groups; + )?.groups; const https = gitTagsRefMatchRegex.exec( 'https://github.com/hashicorp/example.repo-123?ref=v1.0.0' - ).groups; + )?.groups; const ssh = gitTagsRefMatchRegex.exec( 'ssh://github.com/hashicorp/example.repo-123?ref=v1.0.0' - ).groups; + )?.groups; const withoutSshHttpHttps = gitTagsRefMatchRegex.exec( 'git@my-gitlab-instance.local:devops/terraform/instance.git?ref=v5.0.0' - ).groups; - - expect(http.project).toBe('hashicorp/example.repo-123'); - expect(http.tag).toBe('v1.0.0'); - - expect(https.project).toBe('hashicorp/example.repo-123'); - expect(https.tag).toBe('v1.0.0'); - - expect(ssh.project).toBe('hashicorp/example.repo-123'); - expect(ssh.tag).toBe('v1.0.0'); + )?.groups; - expect(withoutSshHttpHttps.project).toBe('terraform/instance.git'); - expect(withoutSshHttpHttps.tag).toBe('v5.0.0'); + expect(http).toMatchObject({ + project: 'hashicorp/example.repo-123', + tag: 'v1.0.0', + }); + expect(https).toMatchObject({ + project: 'hashicorp/example.repo-123', + tag: 'v1.0.0', + }); + expect(ssh).toMatchObject({ + project: 'hashicorp/example.repo-123', + tag: 'v1.0.0', + }); + expect(withoutSshHttpHttps).toMatchObject({ + project: 'terraform/instance.git', + tag: 'v5.0.0', + }); }); }); @@ -78,49 +92,57 @@ describe('modules/manager/terraform/modules', () => { it('should split workspace, project and tag from source', () => { const ssh = bitbucketRefMatchRegex.exec( 'git::ssh://git@bitbucket.org/hashicorp/example.git?ref=v1.0.0' - ).groups; + )?.groups; const https = bitbucketRefMatchRegex.exec( 'git::https://git@bitbucket.org/hashicorp/example.git?ref=v1.0.0' - ).groups; + )?.groups; const plain = bitbucketRefMatchRegex.exec( 'bitbucket.org/hashicorp/example.git?ref=v1.0.0' - ).groups; + )?.groups; const subfolder = bitbucketRefMatchRegex.exec( 'bitbucket.org/hashicorp/example.git/terraform?ref=v1.0.0' - ).groups; + )?.groups; const subfolderWithDoubleSlash = bitbucketRefMatchRegex.exec( 'bitbucket.org/hashicorp/example.git//terraform?ref=v1.0.0' - ).groups; - - expect(ssh.workspace).toBe('hashicorp'); - expect(ssh.project).toBe('example'); - expect(ssh.tag).toBe('v1.0.0'); - - expect(https.workspace).toBe('hashicorp'); - expect(https.project).toBe('example'); - expect(https.tag).toBe('v1.0.0'); - - expect(plain.workspace).toBe('hashicorp'); - expect(plain.project).toBe('example'); - expect(plain.tag).toBe('v1.0.0'); - - expect(subfolder.workspace).toBe('hashicorp'); - expect(subfolder.project).toBe('example'); - expect(subfolder.tag).toBe('v1.0.0'); + )?.groups; - expect(subfolderWithDoubleSlash.workspace).toBe('hashicorp'); - expect(subfolderWithDoubleSlash.project).toBe('example'); - expect(subfolderWithDoubleSlash.tag).toBe('v1.0.0'); + expect(ssh).toMatchObject({ + workspace: 'hashicorp', + project: 'example', + tag: 'v1.0.0', + }); + expect(https).toMatchObject({ + workspace: 'hashicorp', + project: 'example', + tag: 'v1.0.0', + }); + expect(plain).toMatchObject({ + workspace: 'hashicorp', + project: 'example', + tag: 'v1.0.0', + }); + expect(subfolder).toMatchObject({ + workspace: 'hashicorp', + project: 'example', + tag: 'v1.0.0', + }); + expect(subfolderWithDoubleSlash).toMatchObject({ + workspace: 'hashicorp', + project: 'example', + tag: 'v1.0.0', + }); }); it('should parse alpha-numeric characters as well as dots, underscores, and dashes in repo names', () => { const dots = bitbucketRefMatchRegex.exec( 'bitbucket.org/hashicorp/example.repo-123.git?ref=v1.0.0' - ).groups; + )?.groups; - expect(dots.workspace).toBe('hashicorp'); - expect(dots.project).toBe('example.repo-123'); - expect(dots.tag).toBe('v1.0.0'); + expect(dots).toMatchObject({ + workspace: 'hashicorp', + project: 'example.repo-123', + tag: 'v1.0.0', + }); }); }); diff --git a/lib/modules/manager/terragrunt-version/extract.spec.ts b/lib/modules/manager/terragrunt-version/extract.spec.ts index 21d781325d0a7f..b1bb775d663d6d 100644 --- a/lib/modules/manager/terragrunt-version/extract.spec.ts +++ b/lib/modules/manager/terragrunt-version/extract.spec.ts @@ -1,4 +1,4 @@ -import { extractPackageFile } from './extract'; +import { extractPackageFile } from '.'; describe('modules/manager/terragrunt-version/extract', () => { describe('extractPackageFile()', () => { diff --git a/lib/modules/manager/terragrunt/extract.spec.ts b/lib/modules/manager/terragrunt/extract.spec.ts index 1d81feda462d7b..9d9a201e1e9681 100644 --- a/lib/modules/manager/terragrunt/extract.spec.ts +++ b/lib/modules/manager/terragrunt/extract.spec.ts @@ -1,5 +1,5 @@ import { Fixtures } from '../../../../test/fixtures'; -import { extractPackageFile } from './extract'; +import { extractPackageFile } from '.'; describe('modules/manager/terragrunt/extract', () => { describe('extractPackageFile()', () => { @@ -8,10 +8,10 @@ describe('modules/manager/terragrunt/extract', () => { }); it('extracts terragrunt sources', () => { - const res = extractPackageFile(Fixtures.get('2.hcl')); + const res = extractPackageFile(Fixtures?.get('2.hcl')); expect(res).toMatchSnapshot(); - expect(res.deps).toHaveLength(30); - expect(res.deps.filter((dep) => dep.skipReason)).toHaveLength(5); + expect(res?.deps).toHaveLength(30); + expect(res?.deps.filter((dep) => dep.skipReason)).toHaveLength(5); }); it('returns null if only local terragrunt deps', () => { diff --git a/lib/modules/manager/terragrunt/modules.spec.ts b/lib/modules/manager/terragrunt/modules.spec.ts index ac03f9763d135e..35f8fc625ca3e5 100644 --- a/lib/modules/manager/terragrunt/modules.spec.ts +++ b/lib/modules/manager/terragrunt/modules.spec.ts @@ -3,18 +3,23 @@ import { gitTagsRefMatchRegex, githubRefMatchRegex } from './modules'; describe('modules/manager/terragrunt/modules', () => { describe('githubRefMatchRegex', () => { it('should split project and tag from source', () => { - const { project, tag } = githubRefMatchRegex.exec( + const groups = githubRefMatchRegex.exec( 'github.com/hashicorp/example?ref=v1.0.0' - ).groups; - expect(project).toBe('hashicorp/example'); - expect(tag).toBe('v1.0.0'); + )?.groups; + expect(groups).toEqual({ + project: 'hashicorp/example', + tag: 'v1.0.0', + }); }); it('should parse alpha-numeric characters as well as dots, underscores, and dashes in repo names', () => { - const { project } = githubRefMatchRegex.exec( + const groups = githubRefMatchRegex.exec( 'github.com/hashicorp/example.repo-123?ref=v1.0.0' - ).groups; - expect(project).toBe('hashicorp/example.repo-123'); + )?.groups; + expect(groups).toEqual({ + project: 'hashicorp/example.repo-123', + tag: 'v1.0.0', + }); }); }); @@ -22,43 +27,51 @@ describe('modules/manager/terragrunt/modules', () => { it('should split project and tag from source', () => { const http = gitTagsRefMatchRegex.exec( 'http://github.com/hashicorp/example?ref=v1.0.0' - ).groups; + )?.groups; const https = gitTagsRefMatchRegex.exec( 'https://github.com/hashicorp/example?ref=v1.0.0' - ).groups; + )?.groups; const ssh = gitTagsRefMatchRegex.exec( 'ssh://github.com/hashicorp/example?ref=v1.0.0' - ).groups; + )?.groups; - expect(http.project).toBe('hashicorp/example'); - expect(http.tag).toBe('v1.0.0'); - - expect(https.project).toBe('hashicorp/example'); - expect(https.tag).toBe('v1.0.0'); - - expect(ssh.project).toBe('hashicorp/example'); - expect(ssh.tag).toBe('v1.0.0'); + expect(http).toMatchObject({ + project: 'hashicorp/example', + tag: 'v1.0.0', + }); + expect(https).toMatchObject({ + project: 'hashicorp/example', + tag: 'v1.0.0', + }); + expect(ssh).toMatchObject({ + project: 'hashicorp/example', + tag: 'v1.0.0', + }); }); it('should parse alpha-numeric characters as well as dots, underscores, and dashes in repo names', () => { const http = gitTagsRefMatchRegex.exec( 'http://github.com/hashicorp/example.repo-123?ref=v1.0.0' - ).groups; + )?.groups; const https = gitTagsRefMatchRegex.exec( 'https://github.com/hashicorp/example.repo-123?ref=v1.0.0' - ).groups; + )?.groups; const ssh = gitTagsRefMatchRegex.exec( 'ssh://github.com/hashicorp/example.repo-123?ref=v1.0.0' - ).groups; - - expect(http.project).toBe('hashicorp/example.repo-123'); - expect(http.tag).toBe('v1.0.0'); - - expect(https.project).toBe('hashicorp/example.repo-123'); - expect(https.tag).toBe('v1.0.0'); + )?.groups; - expect(ssh.project).toBe('hashicorp/example.repo-123'); - expect(ssh.tag).toBe('v1.0.0'); + expect(http).toMatchObject({ + project: 'hashicorp/example.repo-123', + tag: 'v1.0.0', + }); + expect(https).toMatchObject({ + project: 'hashicorp/example.repo-123', + tag: 'v1.0.0', + }); + expect(ssh).toMatchObject({ + project: 'hashicorp/example.repo-123', + tag: 'v1.0.0', + }); }); }); }); diff --git a/lib/modules/manager/travis/extract.spec.ts b/lib/modules/manager/travis/extract.spec.ts index a91f3e371384f6..4445302c5cbcd2 100644 --- a/lib/modules/manager/travis/extract.spec.ts +++ b/lib/modules/manager/travis/extract.spec.ts @@ -1,12 +1,12 @@ -import { loadFixture } from '../../../../test/util'; +import { Fixtures } from '../../../../test/fixtures'; import { extractPackageFile } from '.'; -const invalidYAML = loadFixture('invalid.yml'); -const matrixYAMLwithNodeSyntaxString = loadFixture('matrix_jobs.yml'); -const matrixYAMLwithNodeSyntaxArray = loadFixture('matrix_jobs_array.yml'); -const matrixYAMLwithNodeSyntaxArray2 = loadFixture('matrix_jobs_array2.yml'); -const matrixYAMLwithNodeSyntaxAlias = loadFixture('matrix_alias.yml'); -const invalidMatrixYAML = loadFixture('matrix_invalid.yml'); +const invalidYAML = Fixtures.get('invalid.yml'); +const matrixYAMLwithNodeSyntaxString = Fixtures.get('matrix_jobs.yml'); +const matrixYAMLwithNodeSyntaxArray = Fixtures.get('matrix_jobs_array.yml'); +const matrixYAMLwithNodeSyntaxArray2 = Fixtures.get('matrix_jobs_array2.yml'); +const matrixYAMLwithNodeSyntaxAlias = Fixtures.get('matrix_alias.yml'); +const invalidMatrixYAML = Fixtures.get('matrix_invalid.yml'); describe('modules/manager/travis/extract', () => { describe('extractPackageFile()', () => { @@ -18,7 +18,7 @@ describe('modules/manager/travis/extract', () => { it('returns results', () => { const res = extractPackageFile('node_js:\n - 6\n - 8\n'); expect(res).toMatchSnapshot(); - expect(res.deps).toHaveLength(2); + expect(res?.deps).toHaveLength(2); }); it('should handle invalid YAML', () => { diff --git a/lib/modules/manager/velaci/extract.spec.ts b/lib/modules/manager/velaci/extract.spec.ts index 50be1f0ad08fdd..ed32315b792836 100644 --- a/lib/modules/manager/velaci/extract.spec.ts +++ b/lib/modules/manager/velaci/extract.spec.ts @@ -14,8 +14,8 @@ describe('modules/manager/velaci/extract', () => { }); it('extracts multiple step pipeline image lines', () => { - const res = extractPackageFile(Fixtures.get('.vela-steps.yml')); - expect(res.deps).toMatchObject([ + const res = extractPackageFile(Fixtures?.get('.vela-steps.yml')); + expect(res?.deps).toMatchObject([ { currentValue: '1.13', depName: 'golang', @@ -28,8 +28,8 @@ describe('modules/manager/velaci/extract', () => { }); it('extracts multiple services pipeline image lines', () => { - const res = extractPackageFile(Fixtures.get('.vela-services.yml')); - expect(res.deps).toMatchObject([ + const res = extractPackageFile(Fixtures?.get('.vela-services.yml')); + expect(res?.deps).toMatchObject([ { currentValue: '10.0.0', depName: 'node', @@ -46,8 +46,8 @@ describe('modules/manager/velaci/extract', () => { }); it('extracts multiple stages pipeline image lines', () => { - const res = extractPackageFile(Fixtures.get('.vela-stages.yaml')); - expect(res.deps).toMatchObject([ + const res = extractPackageFile(Fixtures?.get('.vela-stages.yaml')); + expect(res?.deps).toMatchObject([ { currentValue: '1.13', depName: 'golang', @@ -60,8 +60,8 @@ describe('modules/manager/velaci/extract', () => { }); it('extracts multiple secrets pipeline image lines', () => { - const res = extractPackageFile(Fixtures.get('.vela-secrets.yml')); - expect(res.deps).toMatchObject([ + const res = extractPackageFile(Fixtures?.get('.vela-secrets.yml')); + expect(res?.deps).toMatchObject([ { currentValue: '10.0.0', depName: 'node', diff --git a/tsconfig.strict.json b/tsconfig.strict.json index 7ecbdc242979bf..31ed5c1aaa64c6 100644 --- a/tsconfig.strict.json +++ b/tsconfig.strict.json @@ -15,7 +15,6 @@ "tmp", // TODO: fixme "lib/workers/**/*.spec.ts", - "lib/modules/manager/**/*.spec.ts", "lib/renovate.spec.ts" ] } From 0a582d31c7bc72414cebb75471aea9f7489d0acd Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Mon, 20 Jun 2022 18:15:40 +0200 Subject: [PATCH 151/240] refactor: fix nullable types (#16156) * refactor: fix nullable types * chore: revert changes * chore: fix lint comments * chore: revert changes --- lib/modules/manager/batect/extract.ts | 4 ++- lib/modules/manager/bundler/artifacts.spec.ts | 14 ++++---- lib/modules/manager/flux/extract.ts | 6 ++-- lib/modules/manager/gomod/artifacts.ts | 3 +- lib/modules/manager/gradle/extract.ts | 5 +-- .../manager/jsonnet-bundler/artifacts.ts | 12 +++++-- lib/modules/manager/mix/artifacts.ts | 2 +- lib/modules/manager/npm/extract/index.ts | 7 ++-- lib/modules/manager/npm/extract/npm.ts | 3 +- lib/modules/manager/npm/extract/pnpm.ts | 3 +- lib/modules/manager/npm/extract/yarn.ts | 3 +- lib/modules/manager/npm/post-update/index.ts | 34 ++++++++++++------- .../manager/npm/post-update/node-version.ts | 7 ++-- lib/modules/manager/npm/post-update/npm.ts | 6 +++- lib/modules/manager/nuget/package-tree.ts | 4 ++- lib/modules/manager/nuget/util.ts | 3 +- lib/modules/manager/poetry/artifacts.ts | 4 +-- lib/modules/manager/poetry/extract.ts | 5 +-- .../manager/terraform/lockfile/util.ts | 2 +- lib/util/fs/index.ts | 5 ++- lib/util/git/types.ts | 2 +- .../config-migration/branch/migrated-data.ts | 4 ++- lib/workers/repository/init/merge.ts | 16 +++++---- .../repository/onboarding/branch/check.ts | 3 +- .../branch/execute-post-upgrade-commands.ts | 5 +-- .../repository/update/branch/get-updated.ts | 6 ++-- 26 files changed, 107 insertions(+), 61 deletions(-) diff --git a/lib/modules/manager/batect/extract.ts b/lib/modules/manager/batect/extract.ts index 7e2e587aa15718..4b957d12ead904 100644 --- a/lib/modules/manager/batect/extract.ts +++ b/lib/modules/manager/batect/extract.ts @@ -160,7 +160,9 @@ export async function extractAllPackageFiles( filesAlreadyExamined.add(packageFile); const content = await readLocalFile(packageFile, 'utf8'); - const result = extractPackageFile(content, packageFile); + // TODO #7154 + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + const result = extractPackageFile(content!, packageFile); if (result !== null) { result.referencedConfigFiles.forEach((f) => { diff --git a/lib/modules/manager/bundler/artifacts.spec.ts b/lib/modules/manager/bundler/artifacts.spec.ts index 1e37781a2cc999..47807c32bb1b7f 100644 --- a/lib/modules/manager/bundler/artifacts.spec.ts +++ b/lib/modules/manager/bundler/artifacts.spec.ts @@ -70,7 +70,7 @@ describe('modules/manager/bundler/artifacts', () => { it('returns null if Gemfile.lock was not changed', async () => { fs.readLocalFile.mockResolvedValueOnce('Current Gemfile.lock'); - fs.writeLocalFile.mockResolvedValueOnce(null as never); + fs.writeLocalFile.mockResolvedValueOnce(); const execSnapshots = mockExecAll(exec); git.getRepoStatus.mockResolvedValueOnce({ modified: [] as string[], @@ -89,13 +89,13 @@ describe('modules/manager/bundler/artifacts', () => { it('works for default binarySource', async () => { fs.readLocalFile.mockResolvedValueOnce('Current Gemfile.lock'); - fs.writeLocalFile.mockResolvedValueOnce(null as never); - fs.readLocalFile.mockResolvedValueOnce(null as never); + fs.writeLocalFile.mockResolvedValueOnce(); + fs.readLocalFile.mockResolvedValueOnce(null); const execSnapshots = mockExecAll(exec); git.getRepoStatus.mockResolvedValueOnce({ modified: ['Gemfile.lock'], } as StatusResult); - fs.readLocalFile.mockResolvedValueOnce('Updated Gemfile.lock' as any); + fs.readLocalFile.mockResolvedValueOnce('Updated Gemfile.lock'); expect( await updateArtifacts({ packageFileName: 'Gemfile', @@ -110,13 +110,13 @@ describe('modules/manager/bundler/artifacts', () => { it('works explicit global binarySource', async () => { GlobalConfig.set({ ...adminConfig, binarySource: 'global' }); fs.readLocalFile.mockResolvedValueOnce('Current Gemfile.lock'); - fs.writeLocalFile.mockResolvedValueOnce(null as never); - fs.readLocalFile.mockResolvedValueOnce(null as never); + fs.writeLocalFile.mockResolvedValueOnce(); + fs.readLocalFile.mockResolvedValueOnce(null); const execSnapshots = mockExecAll(exec); git.getRepoStatus.mockResolvedValueOnce({ modified: ['Gemfile.lock'], } as StatusResult); - fs.readLocalFile.mockResolvedValueOnce('Updated Gemfile.lock' as any); + fs.readLocalFile.mockResolvedValueOnce('Updated Gemfile.lock'); expect( await updateArtifacts({ packageFileName: 'Gemfile', diff --git a/lib/modules/manager/flux/extract.ts b/lib/modules/manager/flux/extract.ts index 8c2bee74947a70..52f0ec7eb3e3d1 100644 --- a/lib/modules/manager/flux/extract.ts +++ b/lib/modules/manager/flux/extract.ts @@ -102,7 +102,7 @@ function resolveManifest( rep.kind === release.spec.chart.spec.sourceRef?.kind && rep.metadata.name === release.spec.chart.spec.sourceRef.name && rep.metadata.namespace === - (release.spec.chart.spec.sourceRef.namespace || + (release.spec.chart.spec.sourceRef.namespace ?? release.metadata?.namespace) ); if (matchingRepositories.length) { @@ -140,7 +140,9 @@ export async function extractAllPackageFiles( for (const file of packageFiles) { const content = await readLocalFile(file, 'utf8'); - const manifest = readManifest(content, file); + // TODO #7154 + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + const manifest = readManifest(content!, file); if (manifest) { manifests.push(manifest); } diff --git a/lib/modules/manager/gomod/artifacts.ts b/lib/modules/manager/gomod/artifacts.ts index f75349ef612430..c1dd715184eef9 100644 --- a/lib/modules/manager/gomod/artifacts.ts +++ b/lib/modules/manager/gomod/artifacts.ts @@ -351,7 +351,8 @@ export async function updateArtifacts({ } } - const finalGoModContent = (await readLocalFile(goModFileName, 'utf8')) + // TODO #7154 + const finalGoModContent = (await readLocalFile(goModFileName, 'utf8'))! .replace(regEx(/\/\/ renovate-replace /g), '') .replace(regEx(/renovate-replace-bracket/g), ')'); if (finalGoModContent !== newGoModContent) { diff --git a/lib/modules/manager/gradle/extract.ts b/lib/modules/manager/gradle/extract.ts index 68822666dccafa..5078b6af867be6 100644 --- a/lib/modules/manager/gradle/extract.ts +++ b/lib/modules/manager/gradle/extract.ts @@ -52,7 +52,8 @@ export async function extractAllPackageFiles( }; try { - const content = await readLocalFile(packageFile, 'utf8'); + // TODO #7154 + const content = (await readLocalFile(packageFile, 'utf8'))!; const dir = upath.dirname(toAbsolutePath(packageFile)); const updateVars = (newVars: PackageVariables): void => { @@ -106,7 +107,7 @@ export async function extractAllPackageFiles( registryUrls: [ ...new Set([ ...defaultRegistryUrls, - ...(dep.registryUrls || []), + ...(dep.registryUrls ?? []), ...registryUrls, ]), ], diff --git a/lib/modules/manager/jsonnet-bundler/artifacts.ts b/lib/modules/manager/jsonnet-bundler/artifacts.ts index 8a7346cd7ec132..703347bba2d46f 100644 --- a/lib/modules/manager/jsonnet-bundler/artifacts.ts +++ b/lib/modules/manager/jsonnet-bundler/artifacts.ts @@ -71,12 +71,20 @@ export async function updateArtifacts( for (const f of status.modified ?? []) { res.push({ - file: { type: 'addition', path: f, contents: await readLocalFile(f) }, + file: { + type: 'addition', + path: f, + contents: await readLocalFile(f), + }, }); } for (const f of status.not_added ?? []) { res.push({ - file: { type: 'addition', path: f, contents: await readLocalFile(f) }, + file: { + type: 'addition', + path: f, + contents: await readLocalFile(f), + }, }); } for (const f of status.deleted ?? []) { diff --git a/lib/modules/manager/mix/artifacts.ts b/lib/modules/manager/mix/artifacts.ts index 9e5298130d874a..0eb2e6d303ad41 100644 --- a/lib/modules/manager/mix/artifacts.ts +++ b/lib/modules/manager/mix/artifacts.ts @@ -27,7 +27,7 @@ export async function updateArtifacts({ } const lockFileName = - (await findLocalSiblingOrParent(packageFileName, 'mix.lock')) || 'mix.lock'; + (await findLocalSiblingOrParent(packageFileName, 'mix.lock')) ?? 'mix.lock'; try { await writeLocalFile(packageFileName, newPackageFileContent); } catch (err) { diff --git a/lib/modules/manager/npm/extract/index.ts b/lib/modules/manager/npm/extract/index.ts index d7e4dc835fd5f6..cd15aebd610ae0 100644 --- a/lib/modules/manager/npm/extract/index.ts +++ b/lib/modules/manager/npm/extract/index.ts @@ -95,7 +95,7 @@ export async function extractPackageFile( lockFiles[key] = undefined; } } - lockFiles.npmLock = lockFiles.packageLock || lockFiles.shrinkwrapJson; + lockFiles.npmLock = lockFiles.packageLock ?? lockFiles.shrinkwrapJson; delete lockFiles.packageLock; delete lockFiles.shrinkwrapJson; @@ -109,7 +109,7 @@ export async function extractPackageFile( 'Repo .npmrc file is ignored due to config.npmrc with config.npmrcMerge=false' ); } else { - npmrc = config.npmrc || ''; + npmrc = config.npmrc ?? ''; if (npmrc.length) { if (!npmrc.endsWith('\n')) { npmrc += '\n'; @@ -152,7 +152,8 @@ export async function extractPackageFile( | undefined; try { lernaJsonFile = getSiblingFileName(fileName, 'lerna.json'); - lernaJson = JSON.parse(await readLocalFile(lernaJsonFile, 'utf8')); + // TODO #7154 + lernaJson = JSON.parse((await readLocalFile(lernaJsonFile, 'utf8'))!); } catch (err) /* istanbul ignore next */ { logger.warn({ err }, 'Could not parse lerna.json'); } diff --git a/lib/modules/manager/npm/extract/npm.ts b/lib/modules/manager/npm/extract/npm.ts index 0cb729bd0cde4f..7a756734b92ef3 100644 --- a/lib/modules/manager/npm/extract/npm.ts +++ b/lib/modules/manager/npm/extract/npm.ts @@ -3,7 +3,8 @@ import { readLocalFile } from '../../../../util/fs'; import type { LockFile, LockFileEntry } from './types'; export async function getNpmLock(filePath: string): Promise { - const lockRaw = await readLocalFile(filePath, 'utf8'); + // TODO #7154 + const lockRaw = (await readLocalFile(filePath, 'utf8'))!; try { const lockParsed = JSON.parse(lockRaw); const lockedVersions: Record = {}; diff --git a/lib/modules/manager/npm/extract/pnpm.ts b/lib/modules/manager/npm/extract/pnpm.ts index 93136088f595d2..844c405bb3eacb 100644 --- a/lib/modules/manager/npm/extract/pnpm.ts +++ b/lib/modules/manager/npm/extract/pnpm.ts @@ -17,7 +17,8 @@ export async function extractPnpmFilters( fileName: string ): Promise { try { - const contents = load(await readLocalFile(fileName, 'utf8'), { + // TODO #7154 + const contents = load((await readLocalFile(fileName, 'utf8'))!, { json: true, }) as PnpmWorkspaceFile; if ( diff --git a/lib/modules/manager/npm/extract/yarn.ts b/lib/modules/manager/npm/extract/yarn.ts index f45e2378b5ad07..b9c5c0f0af9730 100644 --- a/lib/modules/manager/npm/extract/yarn.ts +++ b/lib/modules/manager/npm/extract/yarn.ts @@ -10,7 +10,8 @@ import { import type { LockFile } from './types'; export async function getYarnLock(filePath: string): Promise { - const yarnLockRaw = await readLocalFile(filePath, 'utf8'); + // TODO #7154 + const yarnLockRaw = (await readLocalFile(filePath, 'utf8'))!; try { const parsed = parseSyml(yarnLockRaw); const lockedVersions: Record = {}; diff --git a/lib/modules/manager/npm/post-update/index.ts b/lib/modules/manager/npm/post-update/index.ts index 41181e50a473a7..51db6b2a29bb44 100644 --- a/lib/modules/manager/npm/post-update/index.ts +++ b/lib/modules/manager/npm/post-update/index.ts @@ -141,7 +141,7 @@ export async function writeExistingFiles( const basedir = // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion upath.dirname(packageFile.packageFile!); - const npmrc: string = packageFile.npmrc || config.npmrc; + const npmrc: string = packageFile.npmrc ?? config.npmrc; const npmrcFilename = upath.join(basedir, '.npmrc'); if (is.string(npmrc)) { try { @@ -257,7 +257,9 @@ export async function writeUpdatedPackageFiles( supportedLockFiles.some((fileName) => packageFile.path.endsWith(fileName)) ) { logger.debug(`Writing lock file: ${packageFile.path}`); - await writeLocalFile(packageFile.path, packageFile.contents); + // TODO #7154 + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + await writeLocalFile(packageFile.path, packageFile.contents!); continue; } if (!packageFile.path.endsWith('package.json')) { @@ -265,8 +267,13 @@ export async function writeUpdatedPackageFiles( } logger.debug(`Writing ${packageFile.path}`); const detectedIndent = - detectIndent(packageFile.contents.toString()).indent || ' '; - const massagedFile = JSON.parse(packageFile.contents.toString()); + // TODO #7154 + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + detectIndent(packageFile.contents!.toString()).indent || ' '; + + // TODO #7154 + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + const massagedFile = JSON.parse(packageFile.contents!.toString()); try { const { token } = hostRules.find({ hostType: 'github', @@ -406,8 +413,8 @@ async function updateYarnOffline( export async function updateYarnBinary( lockFileDir: string, updatedArtifacts: FileChange[], - existingYarnrcYmlContent: string | undefined -): Promise { + existingYarnrcYmlContent: string | undefined | null +): Promise { let yarnrcYml = existingYarnrcYmlContent; try { const yarnrcYmlFilename = upath.join(lockFileDir, '.yarnrc.yml'); @@ -465,7 +472,7 @@ export async function getAdditionalFiles( !config.updatedPackageFiles?.length && config.transitiveRemediation && config.upgrades?.every( - (upgrade) => upgrade.isRemediation || upgrade.isVulnerabilityAlert + (upgrade) => upgrade.isRemediation ?? upgrade.isVulnerabilityAlert ) ) { logger.debug('Skipping lock file generation for remediations'); @@ -581,7 +588,7 @@ export async function getAdditionalFiles( const npmrcContent = await getNpmrcContent(lockFileDir); await updateNpmrcContent(lockFileDir, npmrcContent, additionalNpmrcContent); let yarnRcYmlFilename: string | undefined; - let existingYarnrcYmlContent: string | undefined; + let existingYarnrcYmlContent: string | undefined | null; // istanbul ignore if: needs test if (additionalYarnRcYml) { yarnRcYmlFilename = getSiblingFileName(yarnLock, '.yarnrc.yml'); @@ -635,6 +642,8 @@ export async function getAdditionalFiles( } artifactErrors.push({ lockFile: yarnLock, + // TODO #7154 + stderr: res.stderr || res.stdout, }); } else { @@ -706,6 +715,7 @@ export async function getAdditionalFiles( } artifactErrors.push({ lockFile: pnpmShrinkwrap, + // TODO #7154 stderr: res.stderr || res.stdout, }); } else { @@ -742,9 +752,9 @@ export async function getAdditionalFiles( throw new Error('lerna-no-lockfile'); } if (lernaPackageFile.lernaClient === 'npm') { - lockFile = config.npmLock || 'package-lock.json'; + lockFile = config.npmLock ?? 'package-lock.json'; } else { - lockFile = config.yarnLock || 'yarn.lock'; + lockFile = config.yarnLock ?? 'yarn.lock'; } const skipInstalls = lockFile === 'npm-shrinkwrap.json' ? false : config.skipInstalls; @@ -811,8 +821,8 @@ export async function getAdditionalFiles( }); } else { for (const packageFile of packageFiles.npm) { - const filename = packageFile.npmLock || packageFile.yarnLock; - logger.trace('Checking for ' + filename); + const filename = packageFile.npmLock ?? packageFile.yarnLock; + logger.trace(`Checking for ${filename}`); const existingContent = await getFile( // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion filename!, diff --git a/lib/modules/manager/npm/post-update/node-version.ts b/lib/modules/manager/npm/post-update/node-version.ts index f35cbaab40721a..b856a416512e6e 100644 --- a/lib/modules/manager/npm/post-update/node-version.ts +++ b/lib/modules/manager/npm/post-update/node-version.ts @@ -6,7 +6,8 @@ import type { PostUpdateConfig, Upgrade } from '../../types'; async function getNodeFile(filename: string): Promise { try { - const constraint = (await readLocalFile(filename, 'utf8')) + // TODO #7154 + const constraint = (await readLocalFile(filename, 'utf8'))! .split(newlineRegex)[0] .replace(regEx(/^v/), ''); if (semver.validRange(constraint)) { @@ -35,8 +36,8 @@ export async function getNodeConstraint( ): Promise { const { packageFile } = config; const constraint = - (await getNodeFile(getSiblingFileName(packageFile, '.nvmrc'))) || - (await getNodeFile(getSiblingFileName(packageFile, '.node-version'))) || + (await getNodeFile(getSiblingFileName(packageFile, '.nvmrc'))) ?? + (await getNodeFile(getSiblingFileName(packageFile, '.node-version'))) ?? getPackageJsonConstraint(config); if (!constraint) { logger.debug('No node constraint found - using latest'); diff --git a/lib/modules/manager/npm/post-update/npm.ts b/lib/modules/manager/npm/post-update/npm.ts index 6bc9e8bdf8592c..d2c4eaa889e547 100644 --- a/lib/modules/manager/npm/post-update/npm.ts +++ b/lib/modules/manager/npm/post-update/npm.ts @@ -134,7 +134,11 @@ export async function generateLockFile( } // Read the result - lockFile = await readLocalFile(upath.join(lockFileDir, filename), 'utf8'); + // TODO #7154 + lockFile = (await readLocalFile( + upath.join(lockFileDir, filename), + 'utf8' + ))!; // Massage lockfile counterparts of package.json that were modified // because npm install was called with an explicit version for rangeStrategy=update-lockfile diff --git a/lib/modules/manager/nuget/package-tree.ts b/lib/modules/manager/nuget/package-tree.ts index d2510f0ebc1202..e7872f73a0c7fd 100644 --- a/lib/modules/manager/nuget/package-tree.ts +++ b/lib/modules/manager/nuget/package-tree.ts @@ -40,7 +40,9 @@ export async function getDependentPackageFiles( for (const f of packageFiles) { const packageFileContent = await readLocalFile(f, 'utf8'); - const doc = new xmldoc.XmlDocument(packageFileContent); + // TODO #7154 + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + const doc = new xmldoc.XmlDocument(packageFileContent!); const projectReferenceAttributes = doc .childrenNamed('ItemGroup') .map((ig) => ig.childrenNamed('ProjectReference')) diff --git a/lib/modules/manager/nuget/util.ts b/lib/modules/manager/nuget/util.ts index ff48cbb0dcea6f..ba0751ce1611c7 100644 --- a/lib/modules/manager/nuget/util.ts +++ b/lib/modules/manager/nuget/util.ts @@ -10,7 +10,8 @@ async function readFileAsXmlDocument( file: string ): Promise { try { - return new XmlDocument(await readLocalFile(file, 'utf8')); + // TODO #7154 + return new XmlDocument((await readLocalFile(file, 'utf8'))!); } catch (err) { logger.debug({ err }, `failed to parse '${file}' as XML document`); return undefined; diff --git a/lib/modules/manager/poetry/artifacts.ts b/lib/modules/manager/poetry/artifacts.ts index 7793b9eb65a1f4..52aaf61aa42b3e 100644 --- a/lib/modules/manager/poetry/artifacts.ts +++ b/lib/modules/manager/poetry/artifacts.ts @@ -91,7 +91,7 @@ function getPoetrySources(content: string, fileName: string): PoetrySource[] { return []; } - const sources = pyprojectFile.tool?.poetry?.source || []; + const sources = pyprojectFile.tool?.poetry?.source ?? []; const sourceArray: PoetrySource[] = []; for (const source of sources) { if (source.name && source.url) { @@ -174,7 +174,7 @@ export async function updateArtifacts({ } const tagConstraint = getPythonConstraint(existingLockFileContent, config); const constraint = - config.constraints?.poetry || getPoetryRequirement(newPackageFileContent); + config.constraints?.poetry ?? getPoetryRequirement(newPackageFileContent); const extraEnv = getSourceCredentialVars( newPackageFileContent, packageFileName diff --git a/lib/modules/manager/poetry/extract.ts b/lib/modules/manager/poetry/extract.ts index 66c4aae4d8d5e5..c89a131b37c65c 100644 --- a/lib/modules/manager/poetry/extract.ts +++ b/lib/modules/manager/poetry/extract.ts @@ -91,7 +91,7 @@ function extractRegistries(pyprojectfile: PoetryFile): string[] | undefined { registryUrls.add(source.url); } } - registryUrls.add(process.env.PIP_INDEX_URL || 'https://pypi.org/pypi/'); + registryUrls.add(process.env.PIP_INDEX_URL ?? 'https://pypi.org/pypi/'); return Array.from(registryUrls); } @@ -115,7 +115,8 @@ export async function extractPackageFile( // handle the lockfile const lockfileName = getSiblingFileName(fileName, 'poetry.lock'); - const lockContents = await readLocalFile(lockfileName, 'utf8'); + // TODO #7154 + const lockContents = (await readLocalFile(lockfileName, 'utf8'))!; const lockfileMapping = extractLockFileEntries(lockContents); diff --git a/lib/modules/manager/terraform/lockfile/util.ts b/lib/modules/manager/terraform/lockfile/util.ts index d1f4730353f10a..a19b2aff952f4c 100644 --- a/lib/modules/manager/terraform/lockfile/util.ts +++ b/lib/modules/manager/terraform/lockfile/util.ts @@ -26,7 +26,7 @@ export function findLockFile(packageFilePath: string): string { return getSiblingFileName(packageFilePath, lockFile); } -export function readLockFile(lockFilePath: string): Promise { +export function readLockFile(lockFilePath: string): Promise { return readLocalFile(lockFilePath, 'utf8'); } diff --git a/lib/util/fs/index.ts b/lib/util/fs/index.ts index 4b224bdc13b026..ad7076bf6e50aa 100644 --- a/lib/util/fs/index.ts +++ b/lib/util/fs/index.ts @@ -23,12 +23,11 @@ export function getSiblingFileName( return upath.join(subDirectory, otherFileName); } -// TODO: can return null #7154 -export async function readLocalFile(fileName: string): Promise; +export async function readLocalFile(fileName: string): Promise; export async function readLocalFile( fileName: string, encoding: 'utf8' -): Promise; +): Promise; export async function readLocalFile( fileName: string, encoding?: string diff --git a/lib/util/git/types.ts b/lib/util/git/types.ts index 587cd5205d55bd..0c124e67268993 100644 --- a/lib/util/git/types.ts +++ b/lib/util/git/types.ts @@ -46,7 +46,7 @@ export interface FileAddition { /** * File contents */ - contents: string | Buffer; + contents: string | Buffer | null; /** * The executable bit diff --git a/lib/workers/repository/config-migration/branch/migrated-data.ts b/lib/workers/repository/config-migration/branch/migrated-data.ts index 9739d940f586ed..a120f7633c3677 100644 --- a/lib/workers/repository/config-migration/branch/migrated-data.ts +++ b/lib/workers/repository/config-migration/branch/migrated-data.ts @@ -51,7 +51,9 @@ export class MigratedDataFactory { const raw = await readLocalFile(filename, 'utf8'); // indent defaults to 2 spaces - const indent = detectIndent(raw).indent ?? ' '; + // TODO #7154 + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + const indent = detectIndent(raw!).indent ?? ' '; let content: string; if (filename.endsWith('.json5')) { diff --git a/lib/workers/repository/init/merge.ts b/lib/workers/repository/init/merge.ts index 4ad24befac8a34..c623921b5a969f 100644 --- a/lib/workers/repository/init/merge.ts +++ b/lib/workers/repository/init/merge.ts @@ -27,7 +27,7 @@ export async function detectRepoFileConfig(): Promise { const cache = getCache(); let { configFileName } = cache; if (configFileName) { - let configFileParsed = await platform.getJsonFile(configFileName); + let configFileParsed = (await platform.getJsonFile(configFileName))!; if (configFileParsed) { if (configFileName === 'package.json') { configFileParsed = configFileParsed.renovate; @@ -41,7 +41,9 @@ export async function detectRepoFileConfig(): Promise { for (const fileName of configFileNames) { if (fileName === 'package.json') { try { - const pJson = JSON.parse(await readLocalFile('package.json', 'utf8')); + const pJson = JSON.parse( + (await readLocalFile('package.json', 'utf8'))! + ); if (pJson.renovate) { logger.debug('Using package.json for global renovate config'); return 'package.json'; @@ -62,11 +64,13 @@ export async function detectRepoFileConfig(): Promise { } cache.configFileName = configFileName; logger.debug(`Found ${configFileName} config file`); - let configFileParsed; + // TODO #7154 + let configFileParsed: any; if (configFileName === 'package.json') { // We already know it parses configFileParsed = JSON.parse( - await readLocalFile('package.json', 'utf8') + // TODO #7154 + (await readLocalFile('package.json', 'utf8'))! ).renovate; if (is.string(configFileParsed)) { logger.debug('Massaging string renovate config to extends array'); @@ -194,7 +198,7 @@ export async function mergeRenovateConfig( } if (migratedConfig.warnings) { returnConfig.warnings = [ - ...(returnConfig.warnings || []), + ...(returnConfig.warnings ?? []), ...migratedConfig.warnings, ]; } @@ -231,7 +235,7 @@ export async function mergeRenovateConfig( } resolvedConfig = applySecretsToConfig( resolvedConfig, - mergeChildConfig(config.secrets || {}, resolvedConfig.secrets || {}) + mergeChildConfig(config.secrets ?? {}, resolvedConfig.secrets ?? {}) ); // istanbul ignore if if (resolvedConfig.hostRules) { diff --git a/lib/workers/repository/onboarding/branch/check.ts b/lib/workers/repository/onboarding/branch/check.ts index e61a234ccd181f..7210ce61046924 100644 --- a/lib/workers/repository/onboarding/branch/check.ts +++ b/lib/workers/repository/onboarding/branch/check.ts @@ -31,7 +31,8 @@ const configFileExists = async (): Promise => { const packageJsonConfigExists = async (): Promise => { try { - const pJson = JSON.parse(await readLocalFile('package.json', 'utf8')); + // TODO #7154 + const pJson = JSON.parse((await readLocalFile('package.json', 'utf8'))!); if (pJson.renovate) { return true; } diff --git a/lib/workers/repository/update/branch/execute-post-upgrade-commands.ts b/lib/workers/repository/update/branch/execute-post-upgrade-commands.ts index f1a30887792b20..dca6b59b34c94d 100644 --- a/lib/workers/repository/update/branch/execute-post-upgrade-commands.ts +++ b/lib/workers/repository/update/branch/execute-post-upgrade-commands.ts @@ -47,13 +47,14 @@ export async function postUpgradeCommandsExecutor( for (const file of config.updatedPackageFiles!.concat(updatedArtifacts)) { const canWriteFile = await localPathIsFile(file.path); if (file.type === 'addition' && canWriteFile) { - let contents; + let contents: Buffer | null; if (typeof file.contents === 'string') { contents = Buffer.from(file.contents); } else { contents = file.contents; } - await writeLocalFile(file.path, contents); + // TODO #7154 + await writeLocalFile(file.path, contents!); } } diff --git a/lib/workers/repository/update/branch/get-updated.ts b/lib/workers/repository/update/branch/get-updated.ts index c287fe0c7a8b2d..497369ec8e5c76 100644 --- a/lib/workers/repository/update/branch/get-updated.ts +++ b/lib/workers/repository/update/branch/get-updated.ts @@ -248,7 +248,8 @@ export async function getUpdatedPackageFiles( const results = await updateArtifacts({ packageFileName: packageFile.path, updatedDeps, - newPackageFileContent: packageFile.contents.toString(), + // TODO #7154 + newPackageFileContent: packageFile.contents!.toString(), config, }); if (is.nonEmptyArray(results)) { @@ -278,7 +279,8 @@ export async function getUpdatedPackageFiles( const results = await updateArtifacts({ packageFileName: packageFile.path, updatedDeps, - newPackageFileContent: packageFile.contents.toString(), + // TODO #7154 + newPackageFileContent: packageFile.contents!.toString(), config, }); if (is.nonEmptyArray(results)) { From 7f48897e75b3e41ec17192567f91f43f6726a2e2 Mon Sep 17 00:00:00 2001 From: Maron <98313426+MaronHatoum@users.noreply.github.com> Date: Tue, 21 Jun 2022 12:23:58 +0300 Subject: [PATCH 152/240] feat(go): add support for GOINSECURE (#15944) --- docs/usage/configuration-options.md | 2 +- .../datasource/go/releases-goproxy.spec.ts | 1 + .../__snapshots__/artifacts.spec.ts.snap | 41 +++++++++++++++++-- lib/modules/manager/gomod/artifacts.spec.ts | 1 + lib/modules/manager/gomod/artifacts.ts | 1 + 5 files changed, 41 insertions(+), 5 deletions(-) diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index c7857be4a46835..df4b2c46e16cb5 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -863,7 +863,7 @@ Also, approval rules overriding should not be [prevented in GitLab settings](htt Configuration added here applies for all Go-related updates. The only supported package manager for Go is the native Go Modules (the `gomod` manager). -For self-hosted users, `GOPROXY`, `GONOPROXY` and `GOPRIVATE` environment variables are supported ([reference](https://go.dev/ref/mod#module-proxy)). +For self-hosted users, `GOPROXY`, `GONOPROXY`, `GOPRIVATE` and `GOINSECURE` environment variables are supported ([reference](https://go.dev/ref/mod#module-proxy)). Usage of `direct` will fallback to the Renovate-native release fetching mechanism. Also we support the `off` keyword which will stop any fetching immediately. diff --git a/lib/modules/datasource/go/releases-goproxy.spec.ts b/lib/modules/datasource/go/releases-goproxy.spec.ts index 17c181af30dcb5..7afdf286a85688 100644 --- a/lib/modules/datasource/go/releases-goproxy.spec.ts +++ b/lib/modules/datasource/go/releases-goproxy.spec.ts @@ -282,6 +282,7 @@ describe('modules/datasource/go/releases-goproxy', () => { delete process.env.GOPROXY; delete process.env.GONOPROXY; delete process.env.GOPRIVATE; + delete process.env.GOINSECURE; }); it('skips GONOPROXY and GOPRIVATE packages', async () => { diff --git a/lib/modules/manager/gomod/__snapshots__/artifacts.spec.ts.snap b/lib/modules/manager/gomod/__snapshots__/artifacts.spec.ts.snap index 6fca966c650fad..12da24004519b0 100644 --- a/lib/modules/manager/gomod/__snapshots__/artifacts.spec.ts.snap +++ b/lib/modules/manager/gomod/__snapshots__/artifacts.spec.ts.snap @@ -31,6 +31,7 @@ Array [ "env": Object { "CGO_ENABLED": "1", "GOFLAGS": "-modcacherw", + "GOINSECURE": "insecure.example.com/*", "GONOPROXY": "noproxy.example.com/*", "GONOSUMDB": "1", "GOPRIVATE": "private.example.com/*", @@ -62,6 +63,7 @@ Array [ "env": Object { "CGO_ENABLED": "1", "GOFLAGS": "-modcacherw", + "GOINSECURE": "insecure.example.com/*", "GONOPROXY": "noproxy.example.com/*", "GONOSUMDB": "1", "GOPRIVATE": "private.example.com/*", @@ -91,6 +93,7 @@ Array [ "env": Object { "CGO_ENABLED": "1", "GOFLAGS": "-modcacherw", + "GOINSECURE": "insecure.example.com/*", "GONOPROXY": "noproxy.example.com/*", "GONOSUMDB": "1", "GOPRIVATE": "private.example.com/*", @@ -139,6 +142,7 @@ Array [ "env": Object { "CGO_ENABLED": "1", "GOFLAGS": "-modcacherw", + "GOINSECURE": "insecure.example.com/*", "GONOPROXY": "noproxy.example.com/*", "GONOSUMDB": "1", "GOPRIVATE": "private.example.com/*", @@ -168,6 +172,7 @@ Array [ "env": Object { "CGO_ENABLED": "1", "GOFLAGS": "-modcacherw", + "GOINSECURE": "insecure.example.com/*", "GONOPROXY": "noproxy.example.com/*", "GONOSUMDB": "1", "GOPRIVATE": "private.example.com/*", @@ -192,6 +197,7 @@ Array [ "env": Object { "CGO_ENABLED": "1", "GOFLAGS": "-modcacherw", + "GOINSECURE": "insecure.example.com/*", "GONOPROXY": "noproxy.example.com/*", "GONOSUMDB": "1", "GOPRIVATE": "private.example.com/*", @@ -216,6 +222,7 @@ Array [ "env": Object { "CGO_ENABLED": "1", "GOFLAGS": "-modcacherw", + "GOINSECURE": "insecure.example.com/*", "GONOPROXY": "noproxy.example.com/*", "GONOSUMDB": "1", "GOPRIVATE": "private.example.com/*", @@ -245,6 +252,7 @@ Array [ "env": Object { "CGO_ENABLED": "1", "GOFLAGS": "-modcacherw", + "GOINSECURE": "insecure.example.com/*", "GONOPROXY": "noproxy.example.com/*", "GONOSUMDB": "1", "GOPRIVATE": "private.example.com/*", @@ -279,7 +287,7 @@ Array [ }, }, Object { - "cmd": "docker run --rm --name=renovate_go --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -e GOPROXY -e GOPRIVATE -e GONOPROXY -e GONOSUMDB -e GOFLAGS -e CGO_ENABLED -e GIT_CONFIG_KEY_0 -e GIT_CONFIG_VALUE_0 -e GIT_CONFIG_KEY_1 -e GIT_CONFIG_VALUE_1 -e GIT_CONFIG_KEY_2 -e GIT_CONFIG_VALUE_2 -e GIT_CONFIG_COUNT -w \\"/tmp/github/some/repo\\" renovate/go:latest bash -l -c \\"go get -d -t ./...\\"", + "cmd": "docker run --rm --name=renovate_go --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -e GOPROXY -e GOPRIVATE -e GONOPROXY -e GONOSUMDB -e GOINSECURE -e GOFLAGS -e CGO_ENABLED -e GIT_CONFIG_KEY_0 -e GIT_CONFIG_VALUE_0 -e GIT_CONFIG_KEY_1 -e GIT_CONFIG_VALUE_1 -e GIT_CONFIG_KEY_2 -e GIT_CONFIG_VALUE_2 -e GIT_CONFIG_COUNT -w \\"/tmp/github/some/repo\\" renovate/go:latest bash -l -c \\"go get -d -t ./...\\"", "options": Object { "cwd": "/tmp/github/some/repo", "encoding": "utf-8", @@ -293,6 +301,7 @@ Array [ "GIT_CONFIG_VALUE_1": "git@github.com:", "GIT_CONFIG_VALUE_2": "https://github.com/", "GOFLAGS": "-modcacherw", + "GOINSECURE": "insecure.example.com/*", "GONOPROXY": "noproxy.example.com/*", "GONOSUMDB": "1", "GOPRIVATE": "private.example.com/*", @@ -327,13 +336,14 @@ Array [ }, }, Object { - "cmd": "docker run --rm --name=renovate_go --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -e GOPROXY -e GOPRIVATE -e GONOPROXY -e GONOSUMDB -e GOFLAGS -e CGO_ENABLED -w \\"/tmp/github/some/repo\\" renovate/go:latest bash -l -c \\"go get -d -t ./... && go mod tidy && go mod tidy\\"", + "cmd": "docker run --rm --name=renovate_go --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -e GOPROXY -e GOPRIVATE -e GONOPROXY -e GONOSUMDB -e GOINSECURE -e GOFLAGS -e CGO_ENABLED -w \\"/tmp/github/some/repo\\" renovate/go:latest bash -l -c \\"go get -d -t ./... && go mod tidy && go mod tidy\\"", "options": Object { "cwd": "/tmp/github/some/repo", "encoding": "utf-8", "env": Object { "CGO_ENABLED": "1", "GOFLAGS": "-modcacherw", + "GOINSECURE": "insecure.example.com/*", "GONOPROXY": "noproxy.example.com/*", "GONOSUMDB": "1", "GOPRIVATE": "private.example.com/*", @@ -368,13 +378,14 @@ Array [ }, }, Object { - "cmd": "docker run --rm --name=renovate_go --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -e GOPROXY -e GOPRIVATE -e GONOPROXY -e GONOSUMDB -e GOFLAGS -e CGO_ENABLED -w \\"/tmp/github/some/repo\\" renovate/go:latest bash -l -c \\"go get -d -t ./... && go mod tidy -compat=1.17 && go mod tidy -compat=1.17\\"", + "cmd": "docker run --rm --name=renovate_go --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -e GOPROXY -e GOPRIVATE -e GONOPROXY -e GONOSUMDB -e GOINSECURE -e GOFLAGS -e CGO_ENABLED -w \\"/tmp/github/some/repo\\" renovate/go:latest bash -l -c \\"go get -d -t ./... && go mod tidy -compat=1.17 && go mod tidy -compat=1.17\\"", "options": Object { "cwd": "/tmp/github/some/repo", "encoding": "utf-8", "env": Object { "CGO_ENABLED": "1", "GOFLAGS": "-modcacherw", + "GOINSECURE": "insecure.example.com/*", "GONOPROXY": "noproxy.example.com/*", "GONOSUMDB": "1", "GOPRIVATE": "private.example.com/*", @@ -409,13 +420,14 @@ Array [ }, }, Object { - "cmd": "docker run --rm --name=renovate_go --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -e GOPROXY -e GOPRIVATE -e GONOPROXY -e GONOSUMDB -e GOFLAGS -e CGO_ENABLED -w \\"/tmp/github/some/repo\\" renovate/go:latest bash -l -c \\"go get -d -t ./...\\"", + "cmd": "docker run --rm --name=renovate_go --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -e GOPROXY -e GOPRIVATE -e GONOPROXY -e GONOSUMDB -e GOINSECURE -e GOFLAGS -e CGO_ENABLED -w \\"/tmp/github/some/repo\\" renovate/go:latest bash -l -c \\"go get -d -t ./...\\"", "options": Object { "cwd": "/tmp/github/some/repo", "encoding": "utf-8", "env": Object { "CGO_ENABLED": "1", "GOFLAGS": "-modcacherw", + "GOINSECURE": "insecure.example.com/*", "GONOPROXY": "noproxy.example.com/*", "GONOSUMDB": "1", "GOPRIVATE": "private.example.com/*", @@ -445,6 +457,7 @@ Array [ "env": Object { "CGO_ENABLED": "1", "GOFLAGS": "-modcacherw", + "GOINSECURE": "insecure.example.com/*", "GONOPROXY": "noproxy.example.com/*", "GONOSUMDB": "1", "GOPRIVATE": "private.example.com/*", @@ -474,6 +487,7 @@ Array [ "env": Object { "CGO_ENABLED": "1", "GOFLAGS": "-modcacherw", + "GOINSECURE": "insecure.example.com/*", "GONOPROXY": "noproxy.example.com/*", "GONOSUMDB": "1", "GOPRIVATE": "private.example.com/*", @@ -498,6 +512,7 @@ Array [ "env": Object { "CGO_ENABLED": "1", "GOFLAGS": "-modcacherw", + "GOINSECURE": "insecure.example.com/*", "GONOPROXY": "noproxy.example.com/*", "GONOSUMDB": "1", "GOPRIVATE": "private.example.com/*", @@ -522,6 +537,7 @@ Array [ "env": Object { "CGO_ENABLED": "1", "GOFLAGS": "-modcacherw", + "GOINSECURE": "insecure.example.com/*", "GONOPROXY": "noproxy.example.com/*", "GONOSUMDB": "1", "GOPRIVATE": "private.example.com/*", @@ -546,6 +562,7 @@ Array [ "env": Object { "CGO_ENABLED": "1", "GOFLAGS": "-modcacherw", + "GOINSECURE": "insecure.example.com/*", "GONOPROXY": "noproxy.example.com/*", "GONOSUMDB": "1", "GOPRIVATE": "private.example.com/*", @@ -570,6 +587,7 @@ Array [ "env": Object { "CGO_ENABLED": "1", "GOFLAGS": "-modcacherw", + "GOINSECURE": "insecure.example.com/*", "GONOPROXY": "noproxy.example.com/*", "GONOSUMDB": "1", "GOPRIVATE": "private.example.com/*", @@ -599,6 +617,7 @@ Array [ "env": Object { "CGO_ENABLED": "1", "GOFLAGS": "-modcacherw", + "GOINSECURE": "insecure.example.com/*", "GONOPROXY": "noproxy.example.com/*", "GONOSUMDB": "1", "GOPRIVATE": "private.example.com/*", @@ -623,6 +642,7 @@ Array [ "env": Object { "CGO_ENABLED": "1", "GOFLAGS": "-modcacherw", + "GOINSECURE": "insecure.example.com/*", "GONOPROXY": "noproxy.example.com/*", "GONOSUMDB": "1", "GOPRIVATE": "private.example.com/*", @@ -647,6 +667,7 @@ Array [ "env": Object { "CGO_ENABLED": "1", "GOFLAGS": "-modcacherw", + "GOINSECURE": "insecure.example.com/*", "GONOPROXY": "noproxy.example.com/*", "GONOSUMDB": "1", "GOPRIVATE": "private.example.com/*", @@ -671,6 +692,7 @@ Array [ "env": Object { "CGO_ENABLED": "1", "GOFLAGS": "-modcacherw", + "GOINSECURE": "insecure.example.com/*", "GONOPROXY": "noproxy.example.com/*", "GONOSUMDB": "1", "GOPRIVATE": "private.example.com/*", @@ -695,6 +717,7 @@ Array [ "env": Object { "CGO_ENABLED": "1", "GOFLAGS": "-modcacherw", + "GOINSECURE": "insecure.example.com/*", "GONOPROXY": "noproxy.example.com/*", "GONOSUMDB": "1", "GOPRIVATE": "private.example.com/*", @@ -724,6 +747,7 @@ Array [ "env": Object { "CGO_ENABLED": "1", "GOFLAGS": "-modcacherw", + "GOINSECURE": "insecure.example.com/*", "GONOPROXY": "noproxy.example.com/*", "GONOSUMDB": "1", "GOPRIVATE": "private.example.com/*", @@ -748,6 +772,7 @@ Array [ "env": Object { "CGO_ENABLED": "1", "GOFLAGS": "-modcacherw", + "GOINSECURE": "insecure.example.com/*", "GONOPROXY": "noproxy.example.com/*", "GONOSUMDB": "1", "GOPRIVATE": "private.example.com/*", @@ -772,6 +797,7 @@ Array [ "env": Object { "CGO_ENABLED": "1", "GOFLAGS": "-modcacherw", + "GOINSECURE": "insecure.example.com/*", "GONOPROXY": "noproxy.example.com/*", "GONOSUMDB": "1", "GOPRIVATE": "private.example.com/*", @@ -796,6 +822,7 @@ Array [ "env": Object { "CGO_ENABLED": "1", "GOFLAGS": "-modcacherw", + "GOINSECURE": "insecure.example.com/*", "GONOPROXY": "noproxy.example.com/*", "GONOSUMDB": "1", "GOPRIVATE": "private.example.com/*", @@ -820,6 +847,7 @@ Array [ "env": Object { "CGO_ENABLED": "1", "GOFLAGS": "-modcacherw", + "GOINSECURE": "insecure.example.com/*", "GONOPROXY": "noproxy.example.com/*", "GONOSUMDB": "1", "GOPRIVATE": "private.example.com/*", @@ -849,6 +877,7 @@ Array [ "env": Object { "CGO_ENABLED": "1", "GOFLAGS": "-modcacherw", + "GOINSECURE": "insecure.example.com/*", "GONOPROXY": "noproxy.example.com/*", "GONOSUMDB": "1", "GOPRIVATE": "private.example.com/*", @@ -873,6 +902,7 @@ Array [ "env": Object { "CGO_ENABLED": "1", "GOFLAGS": "-modcacherw", + "GOINSECURE": "insecure.example.com/*", "GONOPROXY": "noproxy.example.com/*", "GONOSUMDB": "1", "GOPRIVATE": "private.example.com/*", @@ -897,6 +927,7 @@ Array [ "env": Object { "CGO_ENABLED": "1", "GOFLAGS": "-modcacherw", + "GOINSECURE": "insecure.example.com/*", "GONOPROXY": "noproxy.example.com/*", "GONOSUMDB": "1", "GOPRIVATE": "private.example.com/*", @@ -921,6 +952,7 @@ Array [ "env": Object { "CGO_ENABLED": "1", "GOFLAGS": "-modcacherw", + "GOINSECURE": "insecure.example.com/*", "GONOPROXY": "noproxy.example.com/*", "GONOSUMDB": "1", "GOPRIVATE": "private.example.com/*", @@ -945,6 +977,7 @@ Array [ "env": Object { "CGO_ENABLED": "1", "GOFLAGS": "-modcacherw", + "GOINSECURE": "insecure.example.com/*", "GONOPROXY": "noproxy.example.com/*", "GONOSUMDB": "1", "GOPRIVATE": "private.example.com/*", diff --git a/lib/modules/manager/gomod/artifacts.spec.ts b/lib/modules/manager/gomod/artifacts.spec.ts index e9e28f0f830d7b..4513b52e2040e1 100644 --- a/lib/modules/manager/gomod/artifacts.spec.ts +++ b/lib/modules/manager/gomod/artifacts.spec.ts @@ -56,6 +56,7 @@ const goEnv = { GOPROXY: 'proxy.example.com', GOPRIVATE: 'private.example.com/*', GONOPROXY: 'noproxy.example.com/*', + GOINSECURE: 'insecure.example.com/*', CGO_ENABLED: '1', }; diff --git a/lib/modules/manager/gomod/artifacts.ts b/lib/modules/manager/gomod/artifacts.ts index c1dd715184eef9..2b6dc742b65e1f 100644 --- a/lib/modules/manager/gomod/artifacts.ts +++ b/lib/modules/manager/gomod/artifacts.ts @@ -224,6 +224,7 @@ export async function updateArtifacts({ GONOPROXY: process.env.GONOPROXY, GONOSUMDB: process.env.GONOSUMDB, GOSUMDB: process.env.GOSUMDB, + GOINSECURE: process.env.GOINSECURE, GOFLAGS: useModcacherw(config.constraints?.go) ? '-modcacherw' : null, CGO_ENABLED: GlobalConfig.get('binarySource') === 'docker' ? '0' : null, ...getGitEnvironmentVariables(), From 03b0d2a24e72b78e77a2b0e2e383bfa8b86e1251 Mon Sep 17 00:00:00 2001 From: RahulGautamSingh Date: Tue, 21 Jun 2022 15:09:30 +0530 Subject: [PATCH 153/240] refactor(lib/workers): fix null-check for tests (#16163) Co-authored-by: Michael Kriese --- lib/config/migration.ts | 6 +- lib/workers/global/index.spec.ts | 2 +- .../config-migration/branch/index.spec.ts | 2 +- .../config-migration/branch/index.ts | 2 +- .../branch/migrated-data.spec.ts | 13 +- .../config-migration/pr/index.spec.ts | 4 +- .../repository/dependency-dashboard.spec.ts | 4 +- .../repository/errors-warnings.spec.ts | 6 +- .../repository/extract/file-match.spec.ts | 2 +- .../repository/extract/manager-files.ts | 5 +- lib/workers/repository/finalise/prune.ts | 2 +- lib/workers/repository/init/merge.spec.ts | 4 +- lib/workers/repository/init/semantic.spec.ts | 4 +- .../repository/init/vulnerability.spec.ts | 13 +- .../model/semantic-commit-message.spec.ts | 6 +- .../onboarding/branch/index.spec.ts | 10 +- .../repository/onboarding/pr/index.spec.ts | 2 +- lib/workers/repository/process/fetch.spec.ts | 2 +- lib/workers/repository/process/fetch.ts | 2 +- lib/workers/repository/process/limits.spec.ts | 3 +- lib/workers/repository/process/limits.ts | 1 + .../process/vulnerabilities.spec.ts | 4 +- .../update/branch/artifacts.spec.ts | 5 +- .../update/branch/check-existing.spec.ts | 5 +- .../repository/update/branch/commit.spec.ts | 20 ++- .../execute-post-upgrade-commands.spec.ts | 14 +- .../update/branch/get-updated.spec.ts | 26 +-- .../repository/update/branch/index.spec.ts | 160 ++++++++++-------- .../repository/update/branch/reuse.spec.ts | 2 +- .../repository/update/pr/automerge.spec.ts | 9 +- .../update/pr/body/updates-table.spec.ts | 3 +- .../update/pr/changelog/github.spec.ts | 6 +- .../update/pr/changelog/gitlab.spec.ts | 4 +- .../update/pr/changelog/index.spec.ts | 2 +- .../update/pr/changelog/release-notes.spec.ts | 13 +- .../update/pr/changelog/release-notes.ts | 1 + .../repository/update/pr/code-owners.spec.ts | 2 +- .../repository/update/pr/labels.spec.ts | 5 +- .../repository/updates/flatten.spec.ts | 3 +- .../repository/updates/generate.spec.ts | 95 ++++++----- tsconfig.strict.json | 4 +- 41 files changed, 270 insertions(+), 208 deletions(-) diff --git a/lib/config/migration.ts b/lib/config/migration.ts index ac75c9d1db6290..88cbae7d3e636b 100644 --- a/lib/config/migration.ts +++ b/lib/config/migration.ts @@ -59,7 +59,7 @@ export function migrateConfig(config: RenovateConfig): MigratedConfig { const payload = migrateConfig( packageFile as RenovateConfig ).migratedConfig; - for (const subrule of payload.packageRules || []) { + for (const subrule of payload.packageRules ?? []) { subrule.paths = [(packageFile as any).packageFile]; migratedConfig.packageRules.push(subrule); } @@ -157,7 +157,7 @@ export function migrateConfig(config: RenovateConfig): MigratedConfig { // validated non-null // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion delete migratedConfig.node!.enabled; - migratedConfig.travis = migratedConfig.travis || {}; + migratedConfig.travis = migratedConfig.travis ?? {}; migratedConfig.travis.enabled = true; // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion if (Object.keys(migratedConfig.node!).length) { @@ -259,7 +259,7 @@ export function migrateConfig(config: RenovateConfig): MigratedConfig { } if (is.nonEmptyObject(migratedConfig['gradle-lite'])) { migratedConfig.gradle = mergeChildConfig( - migratedConfig.gradle || {}, + migratedConfig.gradle ?? {}, migratedConfig['gradle-lite'] ); } diff --git a/lib/workers/global/index.spec.ts b/lib/workers/global/index.spec.ts index 348071e1c289b6..680648a2dcf93d 100644 --- a/lib/workers/global/index.spec.ts +++ b/lib/workers/global/index.spec.ts @@ -176,7 +176,7 @@ describe('workers/global/index', () => { endpoint: 'https://github.com/', writeDiscoveredRepos: '/tmp/renovate-output.json', }); - fs.writeFile.mockReturnValueOnce(null); + fs.writeFile.mockResolvedValueOnce(); expect(await globalWorker.start()).toBe(0); expect(fs.writeFile).toHaveBeenCalledTimes(1); diff --git a/lib/workers/repository/config-migration/branch/index.spec.ts b/lib/workers/repository/config-migration/branch/index.spec.ts index d7b21af6e20b8c..1fed94518bddaf 100644 --- a/lib/workers/repository/config-migration/branch/index.spec.ts +++ b/lib/workers/repository/config-migration/branch/index.spec.ts @@ -20,7 +20,7 @@ jest.mock('./rebase'); jest.mock('./create'); jest.mock('../../../../util/git'); -const migratedData: MigratedData = Fixtures.getJson('./migrated-data.json'); +const migratedData = Fixtures.getJson('./migrated-data.json'); describe('workers/repository/config-migration/branch/index', () => { describe('checkConfigMigrationBranch', () => { diff --git a/lib/workers/repository/config-migration/branch/index.ts b/lib/workers/repository/config-migration/branch/index.ts index 8e66b83e361a84..1149201eaae9c9 100644 --- a/lib/workers/repository/config-migration/branch/index.ts +++ b/lib/workers/repository/config-migration/branch/index.ts @@ -10,7 +10,7 @@ import { rebaseMigrationBranch } from './rebase'; export async function checkConfigMigrationBranch( config: RenovateConfig, - migratedConfigData: MigratedData + migratedConfigData: MigratedData | null ): Promise { logger.debug('checkConfigMigrationBranch()'); if (!migratedConfigData) { diff --git a/lib/workers/repository/config-migration/branch/migrated-data.spec.ts b/lib/workers/repository/config-migration/branch/migrated-data.spec.ts index e0aee9ab318266..0e4074c741a0c7 100644 --- a/lib/workers/repository/config-migration/branch/migrated-data.spec.ts +++ b/lib/workers/repository/config-migration/branch/migrated-data.spec.ts @@ -40,7 +40,7 @@ describe('workers/repository/config-migration/branch/migrated-data', () => { it('Calls getAsync a first when migration not needed', async () => { mockedFunction(migrateConfig).mockReturnValueOnce({ isMigrated: false, - migratedConfig: null, + migratedConfig: {}, }); await expect(MigratedDataFactory.getAsync()).resolves.toBeNull(); }); @@ -62,12 +62,12 @@ describe('workers/repository/config-migration/branch/migrated-data', () => { describe('MigratedData class', () => { it('gets the filename from the class instance', async () => { const data = await MigratedDataFactory.getAsync(); - expect(data.filename).toBe('renovate.json'); + expect(data?.filename).toBe('renovate.json'); }); it('gets the content from the class instance', async () => { const data = await MigratedDataFactory.getAsync(); - expect(data.content).toBe(migratedData.content); + expect(data?.content).toBe(migratedData.content); }); }); @@ -80,9 +80,10 @@ describe('workers/repository/config-migration/branch/migrated-data', () => { it('Resets the factory and gets a new value with default indentation', async () => { mockedFunction(detectIndent).mockReturnValueOnce({ - type: null, + type: undefined, amount: 0, - indent: null, + // TODO: incompatible types (#7154) + indent: null as never, }); MigratedDataFactory.reset(); await expect(MigratedDataFactory.getAsync()).resolves.toEqual( @@ -103,7 +104,7 @@ describe('workers/repository/config-migration/branch/migrated-data', () => { it('Returns nothing due to fs error', async () => { mockedFunction(detectRepoFileConfig).mockResolvedValueOnce({ - configFileName: null, + configFileName: undefined, }); mockedFunction(readLocalFile).mockRejectedValueOnce(null); MigratedDataFactory.reset(); diff --git a/lib/workers/repository/config-migration/pr/index.spec.ts b/lib/workers/repository/config-migration/pr/index.spec.ts index 18abc84bb32808..fd7c8691c18470 100644 --- a/lib/workers/repository/config-migration/pr/index.spec.ts +++ b/lib/workers/repository/config-migration/pr/index.spec.ts @@ -61,7 +61,7 @@ describe('workers/repository/config-migration/pr/index', () => { it('creates PR with default PR title', async () => { await ensureConfigMigrationPr( - { ...config, onboardingPrTitle: null }, + { ...config, onboardingPrTitle: '' }, migratedData ); expect(platform.getBranchPr).toHaveBeenCalledTimes(1); @@ -229,7 +229,7 @@ describe('workers/repository/config-migration/pr/index', () => { }); it('deletes branch when PR already exists but cannot find it', async () => { - err.response.body = { + response.body = { errors: [{ message: 'A pull request already exists' }], }; platform.createPr.mockRejectedValue(err); diff --git a/lib/workers/repository/dependency-dashboard.spec.ts b/lib/workers/repository/dependency-dashboard.spec.ts index 0c7d8e61c945af..9a51cecdecc3fa 100644 --- a/lib/workers/repository/dependency-dashboard.spec.ts +++ b/lib/workers/repository/dependency-dashboard.spec.ts @@ -5,6 +5,7 @@ import { RenovateConfig, getConfig, logger, + mockedFunction, platform, } from '../../../test/util'; import { GlobalConfig } from '../../config/global'; @@ -517,7 +518,8 @@ describe('workers/repository/dependency-dashboard', () => { config.dependencyDashboard = true; config.dependencyDashboardChecks = { branchName2: 'approve-branch' }; config.dependencyDashboardIssue = 1; - platform.getIssue.mockResolvedValueOnce({ + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + mockedFunction(platform.getIssue!).mockResolvedValueOnce({ title: 'Dependency Dashboard', body: `This issue contains a list of Renovate updates and their statuses. diff --git a/lib/workers/repository/errors-warnings.spec.ts b/lib/workers/repository/errors-warnings.spec.ts index b316427391e176..6442bb84775025 100644 --- a/lib/workers/repository/errors-warnings.spec.ts +++ b/lib/workers/repository/errors-warnings.spec.ts @@ -45,7 +45,7 @@ describe('workers/repository/errors-warnings', () => { packageFile: 'package.json', deps: [ { - warnings: [{ message: 'Warning 1', topic: undefined }], + warnings: [{ message: 'Warning 1', topic: '' }], }, {}, ], @@ -54,7 +54,7 @@ describe('workers/repository/errors-warnings', () => { packageFile: 'backend/package.json', deps: [ { - warnings: [{ message: 'Warning 1', topic: undefined }], + warnings: [{ message: 'Warning 1', topic: '' }], }, ], }, @@ -64,7 +64,7 @@ describe('workers/repository/errors-warnings', () => { packageFile: 'Dockerfile', deps: [ { - warnings: [{ message: 'Warning 2', topic: undefined }], + warnings: [{ message: 'Warning 2', topic: '' }], }, ], }, diff --git a/lib/workers/repository/extract/file-match.spec.ts b/lib/workers/repository/extract/file-match.spec.ts index 7137a1233feb76..40ba83eea67546 100644 --- a/lib/workers/repository/extract/file-match.spec.ts +++ b/lib/workers/repository/extract/file-match.spec.ts @@ -64,7 +64,7 @@ describe('workers/repository/extract/file-match', () => { }); it('deduplicates', () => { - config.fileMatch.push('package.json'); + config.fileMatch?.push('package.json'); const res = fileMatch.getMatchingFiles(config, fileList); expect(res).toMatchSnapshot(); expect(res).toHaveLength(2); diff --git a/lib/workers/repository/extract/manager-files.ts b/lib/workers/repository/extract/manager-files.ts index d45d06de85f270..355c7145a0956d 100644 --- a/lib/workers/repository/extract/manager-files.ts +++ b/lib/workers/repository/extract/manager-files.ts @@ -11,7 +11,7 @@ import type { WorkerExtractConfig } from '../../types'; export async function getManagerPackageFiles( config: WorkerExtractConfig -): Promise { +): Promise { const { enabled, manager, fileList } = config; logger.trace(`getPackageFiles(${manager})`); if (!enabled) { @@ -42,8 +42,7 @@ export async function getManagerPackageFiles( } } } - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion - return allPackageFiles!; + return allPackageFiles; } const packageFiles: PackageFile[] = []; for (const packageFile of fileList) { diff --git a/lib/workers/repository/finalise/prune.ts b/lib/workers/repository/finalise/prune.ts index edf6b39725c5b6..c7327e3a24f3ac 100644 --- a/lib/workers/repository/finalise/prune.ts +++ b/lib/workers/repository/finalise/prune.ts @@ -91,7 +91,7 @@ async function cleanUpBranches( export async function pruneStaleBranches( config: RenovateConfig, - branchList: string[] + branchList: string[] | null | undefined ): Promise { logger.debug('Removing any stale branches'); logger.trace({ config }, `pruneStaleBranches`); diff --git a/lib/workers/repository/init/merge.spec.ts b/lib/workers/repository/init/merge.spec.ts index c82dd31040bec5..3086a7eebbbf8c 100644 --- a/lib/workers/repository/init/merge.spec.ts +++ b/lib/workers/repository/init/merge.spec.ts @@ -186,14 +186,14 @@ describe('workers/repository/init/merge', () => { migrateAndValidate.migrateAndValidate.mockResolvedValueOnce({ errors: [{ topic: 'dep', message: 'test error' }], }); - let e: Error; + let e: Error | undefined; try { await mergeRenovateConfig(config); } catch (err) { e = err; } expect(e).toBeDefined(); - expect(e.toString()).toBe('Error: config-validation'); + expect(e?.toString()).toBe('Error: config-validation'); }); it('migrates nested config', async () => { diff --git a/lib/workers/repository/init/semantic.spec.ts b/lib/workers/repository/init/semantic.spec.ts index 0abb8dece0a77d..cb2a03ee5e1e81 100644 --- a/lib/workers/repository/init/semantic.spec.ts +++ b/lib/workers/repository/init/semantic.spec.ts @@ -20,7 +20,7 @@ describe('workers/repository/init/semantic', () => { }); it('detects false if unknown', async () => { - config.semanticCommits = null; + config.semanticCommits = undefined; git.getCommitMessages.mockResolvedValueOnce(['foo', 'bar']); git.getCommitMessages.mockResolvedValueOnce([ 'fix: foo', @@ -33,7 +33,7 @@ describe('workers/repository/init/semantic', () => { }); it('detects true if known', async () => { - config.semanticCommits = null; + config.semanticCommits = undefined; git.getCommitMessages.mockResolvedValue(['fix: foo', 'refactor: bar']); const res = await detectSemanticCommits(); expect(res).toBe('enabled'); diff --git a/lib/workers/repository/init/vulnerability.spec.ts b/lib/workers/repository/init/vulnerability.spec.ts index f1f7e627bd8909..722a012952b0fe 100644 --- a/lib/workers/repository/init/vulnerability.spec.ts +++ b/lib/workers/repository/init/vulnerability.spec.ts @@ -23,12 +23,16 @@ describe('workers/repository/init/vulnerability', () => { }); it('returns if alerts are disabled', async () => { - config.vulnerabilityAlerts.enabled = false; + // TODO #7154 + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + config.vulnerabilityAlerts!.enabled = false; expect(await detectVulnerabilityAlerts(config)).toEqual(config); }); it('returns if no alerts', async () => { - delete config.vulnerabilityAlerts.enabled; + // TODO #7154 + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + delete config.vulnerabilityAlerts!.enabled; platform.getVulnerabilityAlerts.mockResolvedValue([]); expect(await detectVulnerabilityAlerts(config)).toEqual(config); }); @@ -43,7 +47,8 @@ describe('workers/repository/init/vulnerability', () => { it('returns alerts and remediations', async () => { config.transitiveRemediation = true; - delete config.vulnerabilityAlerts.enabled; + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + delete config.vulnerabilityAlerts!.enabled; platform.getVulnerabilityAlerts.mockResolvedValue([ partial({}), { @@ -73,7 +78,7 @@ describe('workers/repository/init/vulnerability', () => { vulnerableManifestPath: 'backend/package-lock.json', securityAdvisory: { references: [], - severity: null, + severity: '', }, securityVulnerability: { package: { ecosystem: 'NPM', name: 'yargs-parser' }, diff --git a/lib/workers/repository/model/semantic-commit-message.spec.ts b/lib/workers/repository/model/semantic-commit-message.spec.ts index db76829ba5b957..ffff30f3258f54 100644 --- a/lib/workers/repository/model/semantic-commit-message.spec.ts +++ b/lib/workers/repository/model/semantic-commit-message.spec.ts @@ -29,7 +29,7 @@ describe('workers/repository/model/semantic-commit-message', () => { const instance = SemanticCommitMessage.fromString('feat: ticket 123'); expect(SemanticCommitMessage.is(instance)).toBeTrue(); - expect(instance.toJSON()).toEqual({ + expect(instance?.toJSON()).toEqual({ body: '', footer: '', scope: '', @@ -44,7 +44,7 @@ describe('workers/repository/model/semantic-commit-message', () => { ); expect(SemanticCommitMessage.is(instance)).toBeTrue(); - expect(instance.toJSON()).toEqual({ + expect(instance?.toJSON()).toEqual({ body: '', footer: '', scope: 'dashboard', @@ -57,7 +57,7 @@ describe('workers/repository/model/semantic-commit-message', () => { const instance = SemanticCommitMessage.fromString('fix(deps): '); expect(SemanticCommitMessage.is(instance)).toBeTrue(); - expect(instance.toJSON()).toEqual({ + expect(instance?.toJSON()).toEqual({ body: '', footer: '', scope: 'deps', diff --git a/lib/workers/repository/onboarding/branch/index.spec.ts b/lib/workers/repository/onboarding/branch/index.spec.ts index ad8d1074a77e37..45a73f45cd8cb9 100644 --- a/lib/workers/repository/onboarding/branch/index.spec.ts +++ b/lib/workers/repository/onboarding/branch/index.spec.ts @@ -77,9 +77,10 @@ describe('workers/repository/onboarding/branch/index', () => { fs.readLocalFile.mockResolvedValue('{}'); await checkOnboardingBranch(config); const file = git.commitFiles.mock.calls[0][0].files[0] as FileAddition; - const contents = file.contents.toString(); + const contents = file.contents?.toString(); expect(contents).toBeJsonString(); - expect(JSON.parse(contents)).toEqual({ + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + expect(JSON.parse(contents!)).toEqual({ $schema: 'https://docs.renovatebot.com/renovate-schema.json', }); }); @@ -110,9 +111,10 @@ describe('workers/repository/onboarding/branch/index', () => { configFileNames[0] ); const file = git.commitFiles.mock.calls[0][0].files[0] as FileAddition; - const contents = file.contents.toString(); + const contents = file.contents?.toString(); expect(contents).toBeJsonString(); - expect(JSON.parse(contents)).toEqual({ + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + expect(JSON.parse(contents!)).toEqual({ $schema: 'https://docs.renovatebot.com/renovate-schema.json', extends: ['some/renovate-config'], }); diff --git a/lib/workers/repository/onboarding/pr/index.spec.ts b/lib/workers/repository/onboarding/pr/index.spec.ts index e1f78727978925..97a7026040b6c1 100644 --- a/lib/workers/repository/onboarding/pr/index.spec.ts +++ b/lib/workers/repository/onboarding/pr/index.spec.ts @@ -224,7 +224,7 @@ describe('workers/repository/onboarding/pr/index', () => { }); it('deletes branch when PR already exists but cannot find it', async () => { - err.response.body = { + response.body = { errors: [{ message: 'A pull request already exists' }], }; platform.createPr.mockRejectedValueOnce(err); diff --git a/lib/workers/repository/process/fetch.spec.ts b/lib/workers/repository/process/fetch.spec.ts index 4c85f5d86e007e..284a06c42d15e0 100644 --- a/lib/workers/repository/process/fetch.spec.ts +++ b/lib/workers/repository/process/fetch.spec.ts @@ -80,7 +80,7 @@ describe('workers/repository/process/fetch', () => { { depName: 'abcd' }, { currentValue: '2.8.11', datasource: 'docker' }, { depName: ' ' }, - { depName: null }, + {}, { depName: undefined }, { depName: { oh: 'no' } as unknown as string }, ], diff --git a/lib/workers/repository/process/fetch.ts b/lib/workers/repository/process/fetch.ts index e022f19da324ad..55905525eab9fe 100644 --- a/lib/workers/repository/process/fetch.ts +++ b/lib/workers/repository/process/fetch.ts @@ -52,7 +52,7 @@ async function fetchDepUpdates( ...(await lookupUpdates(depConfig as LookupUpdateConfig)), }; } - dep.updates = dep.updates || []; + dep.updates = dep.updates ?? []; } return dep; } diff --git a/lib/workers/repository/process/limits.spec.ts b/lib/workers/repository/process/limits.spec.ts index dfccd383523986..b5592370f4b256 100644 --- a/lib/workers/repository/process/limits.spec.ts +++ b/lib/workers/repository/process/limits.spec.ts @@ -130,7 +130,8 @@ describe('workers/repository/process/limits', () => { it('returns prConcurrentLimit if errored', () => { config.branchConcurrentLimit = 2; - const res = limits.getConcurrentBranchesRemaining(config, null); + // TODO: #7154 + const res = limits.getConcurrentBranchesRemaining(config, null as never); expect(res).toBe(2); }); }); diff --git a/lib/workers/repository/process/limits.ts b/lib/workers/repository/process/limits.ts index 3557c05cf49485..c26c7d5231c982 100644 --- a/lib/workers/repository/process/limits.ts +++ b/lib/workers/repository/process/limits.ts @@ -116,6 +116,7 @@ export function getConcurrentBranchesRemaining( return concurrentRemaining; } catch (err) { + // TODO: #7154 should never throw logger.error({ err }, 'Error checking concurrent branches'); return limit; } diff --git a/lib/workers/repository/process/vulnerabilities.spec.ts b/lib/workers/repository/process/vulnerabilities.spec.ts index 428c4f86f80d3e..c87f780aee1c79 100644 --- a/lib/workers/repository/process/vulnerabilities.spec.ts +++ b/lib/workers/repository/process/vulnerabilities.spec.ts @@ -12,7 +12,9 @@ jest.mock('@jamiemagee/osv-offline', () => { return { __esModule: true, OsvOffline: class { - static create = () => createMock(); + static create() { + return createMock(); + } }, }; }); diff --git a/lib/workers/repository/update/branch/artifacts.spec.ts b/lib/workers/repository/update/branch/artifacts.spec.ts index efbff23b668b6c..2a0e942dfe4432 100644 --- a/lib/workers/repository/update/branch/artifacts.spec.ts +++ b/lib/workers/repository/update/branch/artifacts.spec.ts @@ -10,13 +10,14 @@ describe('workers/repository/update/branch/artifacts', () => { beforeEach(() => { GlobalConfig.set({}); jest.resetAllMocks(); + // TODO #7154 incompatible types config = { ...getConfig(), manager: 'some-manager', branchName: 'renovate/pin', upgrades: [], artifactErrors: [{ lockFile: 'some' }], - }; + } as BranchConfig; }); describe('setArtifactsErrorStatus', () => { @@ -41,7 +42,7 @@ describe('workers/repository/update/branch/artifacts', () => { it('skips status (no errors)', async () => { platform.getBranchStatusCheck.mockResolvedValueOnce(null); - config.artifactErrors.length = 0; + config.artifactErrors = []; await setArtifactErrorStatus(config); expect(platform.setBranchStatus).not.toHaveBeenCalled(); }); diff --git a/lib/workers/repository/update/branch/check-existing.spec.ts b/lib/workers/repository/update/branch/check-existing.spec.ts index 213fe459fd67f9..e5ff1625d439ff 100644 --- a/lib/workers/repository/update/branch/check-existing.spec.ts +++ b/lib/workers/repository/update/branch/check-existing.spec.ts @@ -10,11 +10,12 @@ describe('workers/repository/update/branch/check-existing', () => { let config: BranchConfig; beforeEach(() => { - config = partial({ + // TODO #7154 incompatible types + config = { ...defaultConfig, branchName: 'some-branch', prTitle: 'some-title', - }); + } as BranchConfig; jest.resetAllMocks(); }); diff --git a/lib/workers/repository/update/branch/commit.spec.ts b/lib/workers/repository/update/branch/commit.spec.ts index e3cf9fff0cf8a3..47df38f4bb0fc0 100644 --- a/lib/workers/repository/update/branch/commit.spec.ts +++ b/lib/workers/repository/update/branch/commit.spec.ts @@ -1,7 +1,7 @@ import { defaultConfig, git, - partial, + mockedFunction, platform, } from '../../../../../test/util'; import { GlobalConfig } from '../../../../config/global'; @@ -15,7 +15,8 @@ describe('workers/repository/update/branch/commit', () => { let config: BranchConfig; beforeEach(() => { - config = partial({ + // TODO #7154 incompatible types + config = { ...defaultConfig, branchName: 'renovate/some-branch', commitMessage: 'some commit message', @@ -24,7 +25,8 @@ describe('workers/repository/update/branch/commit', () => { semanticCommitScope: 'b', updatedPackageFiles: [], updatedArtifacts: [], - }); + upgrades: [], + } as BranchConfig; jest.resetAllMocks(); git.commitFiles.mockResolvedValueOnce('123test'); platform.commitFiles = jest.fn(); @@ -37,7 +39,7 @@ describe('workers/repository/update/branch/commit', () => { }); it('commits files', async () => { - config.updatedPackageFiles.push({ + config.updatedPackageFiles?.push({ type: 'addition', path: 'package.json', contents: 'some contents', @@ -48,7 +50,7 @@ describe('workers/repository/update/branch/commit', () => { }); it('commits via platform', async () => { - config.updatedPackageFiles.push({ + config.updatedPackageFiles?.push({ type: 'addition', path: 'package.json', contents: 'some contents', @@ -56,12 +58,16 @@ describe('workers/repository/update/branch/commit', () => { config.platformCommit = true; await commitFilesToBranch(config); expect(platform.commitFiles).toHaveBeenCalledTimes(1); - expect(platform.commitFiles.mock.calls).toMatchSnapshot(); + // TODO #7154 + expect( + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + mockedFunction(platform.commitFiles!).mock.calls + ).toMatchSnapshot(); }); it('dry runs', async () => { GlobalConfig.set({ dryRun: 'full' }); - config.updatedPackageFiles.push({ + config.updatedPackageFiles?.push({ type: 'addition', path: 'package.json', contents: 'some contents', diff --git a/lib/workers/repository/update/branch/execute-post-upgrade-commands.spec.ts b/lib/workers/repository/update/branch/execute-post-upgrade-commands.spec.ts index 00a12a45ceb598..0e29fd3e1fe562 100644 --- a/lib/workers/repository/update/branch/execute-post-upgrade-commands.spec.ts +++ b/lib/workers/repository/update/branch/execute-post-upgrade-commands.spec.ts @@ -1,4 +1,4 @@ -import { fs, git } from '../../../../../test/util'; +import { fs, git, partial } from '../../../../../test/util'; import { GlobalConfig } from '../../../../config/global'; import type { StatusResult } from '../../../../util/git/types'; import type { BranchConfig, BranchUpgradeConfig } from '../../../types'; @@ -31,11 +31,13 @@ describe('workers/repository/update/branch/execute-post-upgrade-commands', () => upgrades: [], branchName: 'main', }; - git.getRepoStatus.mockResolvedValueOnce({ - modified: [], - not_added: [], - deleted: [], - } as StatusResult); + git.getRepoStatus.mockResolvedValueOnce( + partial({ + modified: [], + not_added: [], + deleted: [], + }) + ); GlobalConfig.set({ localDir: __dirname, allowedPostUpgradeCommands: ['some-command'], diff --git a/lib/workers/repository/update/branch/get-updated.spec.ts b/lib/workers/repository/update/branch/get-updated.spec.ts index 509f510004a12b..3431b673537fb5 100644 --- a/lib/workers/repository/update/branch/get-updated.spec.ts +++ b/lib/workers/repository/update/branch/get-updated.spec.ts @@ -41,7 +41,7 @@ describe('workers/repository/update/branch/get-updated', () => { config.upgrades.push({ packageFile: 'index.html', manager: 'html', - branchName: undefined, + branchName: '', }); autoReplace.doAutoReplace.mockResolvedValueOnce('updated-file'); const res = await getUpdatedPackageFiles(config); @@ -56,7 +56,7 @@ describe('workers/repository/update/branch/get-updated', () => { config.upgrades.push({ packageFile: 'index.html', manager: 'html', - branchName: undefined, + branchName: '', }); autoReplace.doAutoReplace.mockResolvedValueOnce('existing content'); const res = await getUpdatedPackageFiles(config); @@ -69,7 +69,7 @@ describe('workers/repository/update/branch/get-updated', () => { }); it('handles autoreplace failure', async () => { - config.upgrades.push({ manager: 'html', branchName: undefined }); + config.upgrades.push({ manager: 'html', branchName: '' }); autoReplace.doAutoReplace.mockResolvedValueOnce(null); await expect(getUpdatedPackageFiles(config)).rejects.toThrow(); }); @@ -79,7 +79,7 @@ describe('workers/repository/update/branch/get-updated', () => { config.upgrades.push({ packageFile: 'index.html', manager: 'html', - branchName: undefined, + branchName: '', }); autoReplace.doAutoReplace.mockResolvedValueOnce(null); autoReplace.doAutoReplace.mockResolvedValueOnce('updated-file'); @@ -133,7 +133,7 @@ describe('workers/repository/update/branch/get-updated', () => { config.upgrades.push({ packageFile: 'composer.json', manager: 'composer', - branchName: undefined, + branchName: '', }); autoReplace.doAutoReplace.mockResolvedValueOnce('some new content'); composer.updateArtifacts.mockResolvedValueOnce([ @@ -278,7 +278,7 @@ describe('workers/repository/update/branch/get-updated', () => { config.reuseExistingBranch = true; config.upgrades.push({ manager: 'composer', - branchName: undefined, + branchName: '', }); autoReplace.doAutoReplace.mockResolvedValueOnce('some new content'); composer.updateArtifacts.mockResolvedValueOnce([ @@ -318,7 +318,7 @@ describe('workers/repository/update/branch/get-updated', () => { config.upgrades.push({ packageFile: 'composer.json', manager: 'composer', - branchName: undefined, + branchName: '', isLockfileUpdate: true, }); composer.updateLockedDependency.mockReturnValueOnce({ @@ -356,7 +356,7 @@ describe('workers/repository/update/branch/get-updated', () => { config.upgrades.push({ packageFile: 'abc.tf', manager: 'terraform', - branchName: undefined, + branchName: '', isLockfileUpdate: true, }); terraform.updateArtifacts.mockResolvedValueOnce([ @@ -392,7 +392,7 @@ describe('workers/repository/update/branch/get-updated', () => { packageFile: 'package.json', lockFiles: ['package-lock.json'], manager: 'npm', - branchName: undefined, + branchName: '', isLockfileUpdate: true, }); npm.updateLockedDependency.mockResolvedValue({ @@ -415,7 +415,7 @@ describe('workers/repository/update/branch/get-updated', () => { packageFile: 'package.json', lockFile: 'package-lock.json', manager: 'npm', - branchName: undefined, + branchName: '', isLockfileUpdate: true, }); npm.updateLockedDependency.mockResolvedValueOnce({ @@ -438,7 +438,7 @@ describe('workers/repository/update/branch/get-updated', () => { packageFile: 'package.json', lockFile: 'package-lock.json', manager: 'npm', - branchName: undefined, + branchName: '', isLockfileUpdate: true, }); git.getFile.mockResolvedValue('some content'); @@ -460,7 +460,7 @@ describe('workers/repository/update/branch/get-updated', () => { it('bumps versions in updateDependency managers', async () => { config.upgrades.push({ packageFile: 'package.json', - branchName: undefined, + branchName: '', bumpVersion: 'patch', manager: 'npm', }); @@ -481,7 +481,7 @@ describe('workers/repository/update/branch/get-updated', () => { it('bumps versions in autoReplace managers', async () => { config.upgrades.push({ packageFile: 'Chart.yaml', - branchName: undefined, + branchName: '', bumpVersion: 'patch', manager: 'helmv3', }); diff --git a/lib/workers/repository/update/branch/index.spec.ts b/lib/workers/repository/update/branch/index.spec.ts index bf65bf8d4fda55..9bce40e433bc25 100644 --- a/lib/workers/repository/update/branch/index.spec.ts +++ b/lib/workers/repository/update/branch/index.spec.ts @@ -69,9 +69,12 @@ const limits = mocked(_limits); const adminConfig: RepoGlobalConfig = { localDir: '', cacheDir: '' }; -function findFileContent(files: FileChange[], path: string): string | null { - const f = files.find((file) => file.path === path); - if (f.type === 'addition') { +function findFileContent( + files: FileChange[] | undefined, + path: string +): string | null { + const f = files?.find((file) => file.path === path); + if (f?.type === 'addition' && f.contents) { return f.contents.toString(); } return null; @@ -95,7 +98,7 @@ describe('workers/repository/update/branch/index', () => { branchName: 'renovate/some-branch', errors: [], warnings: [], - upgrades: [{ depName: 'some-dep-name' }], + upgrades: [{ depName: 'some-dep-name' }] as BranchUpgradeConfig[], } as BranchConfig; schedule.isScheduledNow.mockReturnValue(true); commit.commitFilesToBranch.mockResolvedValue('123test'); @@ -471,7 +474,7 @@ describe('workers/repository/update/branch/index', () => { } as PackageFilesResult); npmPostExtract.getAdditionalFiles.mockResolvedValueOnce({ artifactErrors: [], - updatedArtifacts: [{}], + updatedArtifacts: [partial({})], } as WriteExistingFilesResult); git.branchExists.mockReturnValue(true); commit.commitFilesToBranch.mockResolvedValueOnce(null); @@ -487,7 +490,7 @@ describe('workers/repository/update/branch/index', () => { } as PackageFilesResult); npmPostExtract.getAdditionalFiles.mockResolvedValueOnce({ artifactErrors: [], - updatedArtifacts: [{}], + updatedArtifacts: [partial({})], } as WriteExistingFilesResult); git.branchExists.mockReturnValue(false); automerge.tryBranchAutomerge.mockResolvedValueOnce('automerged'); @@ -505,7 +508,7 @@ describe('workers/repository/update/branch/index', () => { } as PackageFilesResult); npmPostExtract.getAdditionalFiles.mockResolvedValueOnce({ artifactErrors: [], - updatedArtifacts: [{}], + updatedArtifacts: [partial({})], } as WriteExistingFilesResult); git.branchExists.mockReturnValue(true); commit.commitFilesToBranch.mockResolvedValueOnce(null); @@ -523,7 +526,7 @@ describe('workers/repository/update/branch/index', () => { } as PackageFilesResult); npmPostExtract.getAdditionalFiles.mockResolvedValueOnce({ artifactErrors: [], - updatedArtifacts: [{}], + updatedArtifacts: [partial({})], } as WriteExistingFilesResult); git.branchExists.mockReturnValue(true); commit.commitFilesToBranch.mockResolvedValueOnce(null); @@ -546,7 +549,7 @@ describe('workers/repository/update/branch/index', () => { } as PackageFilesResult); npmPostExtract.getAdditionalFiles.mockResolvedValueOnce({ artifactErrors: [], - updatedArtifacts: [{}], + updatedArtifacts: [partial({})], } as WriteExistingFilesResult); git.branchExists.mockReturnValue(true); commit.commitFilesToBranch.mockResolvedValueOnce(null); @@ -569,7 +572,7 @@ describe('workers/repository/update/branch/index', () => { } as PackageFilesResult); npmPostExtract.getAdditionalFiles.mockResolvedValueOnce({ artifactErrors: [], - updatedArtifacts: [{}], + updatedArtifacts: [partial({})], } as WriteExistingFilesResult); git.branchExists.mockReturnValue(true); commit.commitFilesToBranch.mockResolvedValueOnce(null); @@ -592,7 +595,7 @@ describe('workers/repository/update/branch/index', () => { } as PackageFilesResult); npmPostExtract.getAdditionalFiles.mockResolvedValueOnce({ artifactErrors: [], - updatedArtifacts: [{}], + updatedArtifacts: [partial({})], } as WriteExistingFilesResult); git.branchExists.mockReturnValue(true); commit.commitFilesToBranch.mockResolvedValueOnce(null); @@ -615,7 +618,7 @@ describe('workers/repository/update/branch/index', () => { } as PackageFilesResult); npmPostExtract.getAdditionalFiles.mockResolvedValueOnce({ artifactErrors: [], - updatedArtifacts: [{}], + updatedArtifacts: [partial({})], } as WriteExistingFilesResult); git.branchExists.mockReturnValue(true); commit.commitFilesToBranch.mockResolvedValueOnce(null); @@ -638,7 +641,7 @@ describe('workers/repository/update/branch/index', () => { } as PackageFilesResult); npmPostExtract.getAdditionalFiles.mockResolvedValueOnce({ artifactErrors: [], - updatedArtifacts: [{}], + updatedArtifacts: [partial({})], } as WriteExistingFilesResult); expect( await branchWorker.processBranch({ @@ -662,7 +665,7 @@ describe('workers/repository/update/branch/index', () => { } as PackageFilesResult); npmPostExtract.getAdditionalFiles.mockResolvedValueOnce({ artifactErrors: [], - updatedArtifacts: [{}], + updatedArtifacts: [partial({})], } as WriteExistingFilesResult); git.branchExists.mockReturnValue(true); automerge.tryBranchAutomerge.mockResolvedValueOnce('failed'); @@ -684,7 +687,7 @@ describe('workers/repository/update/branch/index', () => { } as PackageFilesResult); npmPostExtract.getAdditionalFiles.mockResolvedValueOnce({ artifactErrors: [], - updatedArtifacts: [{}], + updatedArtifacts: [partial({})], } as WriteExistingFilesResult); git.branchExists.mockReturnValue(true); automerge.tryBranchAutomerge.mockResolvedValueOnce('stale'); @@ -885,7 +888,7 @@ describe('workers/repository/update/branch/index', () => { } as PackageFilesResult); npmPostExtract.getAdditionalFiles.mockResolvedValueOnce({ artifactErrors: [], - updatedArtifacts: [{}], + updatedArtifacts: [partial({})], } as WriteExistingFilesResult); git.branchExists.mockReturnValue(true); automerge.tryBranchAutomerge.mockResolvedValueOnce('failed'); @@ -934,7 +937,7 @@ describe('workers/repository/update/branch/index', () => { } as PackageFilesResult); npmPostExtract.getAdditionalFiles.mockResolvedValueOnce({ artifactErrors: [], - updatedArtifacts: [{}], + updatedArtifacts: [partial({})], } as WriteExistingFilesResult); git.branchExists.mockReturnValue(true); platform.getBranchPr.mockResolvedValueOnce({ @@ -970,7 +973,7 @@ describe('workers/repository/update/branch/index', () => { } as PackageFilesResult); npmPostExtract.getAdditionalFiles.mockResolvedValueOnce({ artifactErrors: [], - updatedArtifacts: [{}], + updatedArtifacts: [partial({})], } as WriteExistingFilesResult); git.branchExists.mockReturnValue(true); platform.getBranchPr.mockResolvedValueOnce({ @@ -1002,13 +1005,16 @@ describe('workers/repository/update/branch/index', () => { }); it('branch pr no schedule', async () => { - getUpdated.getUpdatedPackageFiles.mockResolvedValueOnce({ - updatedPackageFiles: [{}], - artifactErrors: [], - } as PackageFilesResult); + getUpdated.getUpdatedPackageFiles.mockResolvedValueOnce( + partial({ + updatedPackageFiles: [partial({})], + artifactErrors: [], + updatedArtifacts: [], + }) + ); npmPostExtract.getAdditionalFiles.mockResolvedValueOnce({ artifactErrors: [], - updatedArtifacts: [{}], + updatedArtifacts: [partial({})], } as WriteExistingFilesResult); git.branchExists.mockReturnValue(true); platform.getBranchPr.mockResolvedValueOnce({ @@ -1037,13 +1043,16 @@ describe('workers/repository/update/branch/index', () => { }); it('skips branch update if stopUpdatingLabel presents', async () => { - getUpdated.getUpdatedPackageFiles.mockResolvedValueOnce({ - updatedPackageFiles: [{}], - artifactErrors: [], - } as PackageFilesResult); + getUpdated.getUpdatedPackageFiles.mockResolvedValueOnce( + partial({ + updatedPackageFiles: [partial({})], + artifactErrors: [], + updatedArtifacts: [], + }) + ); npmPostExtract.getAdditionalFiles.mockResolvedValueOnce({ artifactErrors: [], - updatedArtifacts: [{}], + updatedArtifacts: [partial({})], } as WriteExistingFilesResult); git.branchExists.mockReturnValue(true); platform.getBranchPr.mockResolvedValueOnce({ @@ -1072,13 +1081,16 @@ describe('workers/repository/update/branch/index', () => { }); it('updates branch if stopUpdatingLabel presents and PR rebase/retry box checked', async () => { - getUpdated.getUpdatedPackageFiles.mockResolvedValueOnce({ - updatedPackageFiles: [{}], - artifactErrors: [], - } as PackageFilesResult); + getUpdated.getUpdatedPackageFiles.mockResolvedValueOnce( + partial({ + updatedPackageFiles: [partial({})], + artifactErrors: [], + updatedArtifacts: [], + }) + ); npmPostExtract.getAdditionalFiles.mockResolvedValueOnce({ artifactErrors: [], - updatedArtifacts: [{}], + updatedArtifacts: [partial({})], } as WriteExistingFilesResult); git.branchExists.mockReturnValue(true); platform.getBranchPr.mockResolvedValueOnce({ @@ -1118,6 +1130,7 @@ describe('workers/repository/update/branch/index', () => { getUpdated.getUpdatedPackageFiles.mockResolvedValueOnce({ updatedPackageFiles: [updatedPackageFile], artifactErrors: [], + updatedArtifacts: [], } as PackageFilesResult); npmPostExtract.getAdditionalFiles.mockResolvedValueOnce({ artifactErrors: [], @@ -1139,11 +1152,13 @@ describe('workers/repository/update/branch/index', () => { }, } as Pr); git.isBranchModified.mockResolvedValueOnce(true); - git.getRepoStatus.mockResolvedValueOnce({ - modified: ['modified_file'], - not_added: [], - deleted: ['deleted_file'], - } as StatusResult); + git.getRepoStatus.mockResolvedValueOnce( + partial({ + modified: ['modified_file'], + not_added: [], + deleted: ['deleted_file'], + }) + ); fs.readLocalFile.mockResolvedValueOnce('modified file content'); fs.localPathExists .mockResolvedValueOnce(true) @@ -1228,11 +1243,13 @@ describe('workers/repository/update/branch/index', () => { }, } as never); git.isBranchModified.mockResolvedValueOnce(true); - git.getRepoStatus.mockResolvedValueOnce({ - modified: ['modified_file'], - not_added: [], - deleted: ['deleted_file'], - } as StatusResult); + git.getRepoStatus.mockResolvedValueOnce( + partial({ + modified: ['modified_file'], + not_added: [], + deleted: ['deleted_file'], + }) + ); fs.readLocalFile.mockResolvedValueOnce('modified file content'); fs.localPathExists @@ -1287,6 +1304,7 @@ describe('workers/repository/update/branch/index', () => { getUpdated.getUpdatedPackageFiles.mockResolvedValueOnce({ updatedPackageFiles: [updatedPackageFile], artifactErrors: [], + updatedArtifacts: [], } as PackageFilesResult); npmPostExtract.getAdditionalFiles.mockResolvedValueOnce({ artifactErrors: [], @@ -1308,11 +1326,13 @@ describe('workers/repository/update/branch/index', () => { }, } as Pr); git.isBranchModified.mockResolvedValueOnce(true); - git.getRepoStatus.mockResolvedValueOnce({ - modified: ['modified_file'], - not_added: [], - deleted: ['deleted_file'], - } as StatusResult); + git.getRepoStatus.mockResolvedValueOnce( + partial({ + modified: ['modified_file'], + not_added: [], + deleted: ['deleted_file'], + }) + ); fs.readLocalFile.mockResolvedValueOnce('modified file content'); fs.localPathExists @@ -1370,6 +1390,7 @@ describe('workers/repository/update/branch/index', () => { getUpdated.getUpdatedPackageFiles.mockResolvedValueOnce({ updatedPackageFiles: [updatedPackageFile], artifactErrors: [], + updatedArtifacts: [], } as PackageFilesResult); npmPostExtract.getAdditionalFiles.mockResolvedValueOnce({ artifactErrors: [], @@ -1392,16 +1413,20 @@ describe('workers/repository/update/branch/index', () => { } as Pr); git.isBranchModified.mockResolvedValueOnce(true); git.getRepoStatus - .mockResolvedValueOnce({ - modified: ['modified_file', 'modified_then_deleted_file'], - not_added: [], - deleted: ['deleted_file', 'deleted_then_created_file'], - } as StatusResult) - .mockResolvedValueOnce({ - modified: ['modified_file', 'deleted_then_created_file'], - not_added: [], - deleted: ['deleted_file', 'modified_then_deleted_file'], - } as StatusResult); + .mockResolvedValueOnce( + partial({ + modified: ['modified_file', 'modified_then_deleted_file'], + not_added: [], + deleted: ['deleted_file', 'deleted_then_created_file'], + }) + ) + .mockResolvedValueOnce( + partial({ + modified: ['modified_file', 'deleted_then_created_file'], + not_added: [], + deleted: ['deleted_file', 'modified_then_deleted_file'], + }) + ); fs.readLocalFile .mockResolvedValueOnce('modified file content' as never) @@ -1491,18 +1516,18 @@ describe('workers/repository/update/branch/index', () => { findFileContent(updatedArtifacts, 'deleted_then_created_file') ).toBe('this file was once deleted'); expect( - updatedArtifacts.find( + updatedArtifacts?.find( (f) => f.type === 'deletion' && f.path === 'deleted_then_created_file' ) ).toBeUndefined(); expect( - updatedArtifacts.find( + updatedArtifacts?.find( (f) => f.type === 'addition' && f.path === 'modified_then_deleted_file' ) ).toBeUndefined(); expect( - updatedArtifacts.find( + updatedArtifacts?.find( (f) => f.type === 'deletion' && f.path === 'modified_then_deleted_file' ) @@ -1518,6 +1543,7 @@ describe('workers/repository/update/branch/index', () => { getUpdated.getUpdatedPackageFiles.mockResolvedValueOnce({ updatedPackageFiles: [updatedPackageFile], artifactErrors: [], + updatedArtifacts: [], } as PackageFilesResult); npmPostExtract.getAdditionalFiles.mockResolvedValueOnce({ artifactErrors: [], @@ -1539,11 +1565,13 @@ describe('workers/repository/update/branch/index', () => { }, } as Pr); git.isBranchModified.mockResolvedValueOnce(true); - git.getRepoStatus.mockResolvedValueOnce({ - modified: ['modified_file', 'modified_then_deleted_file'], - not_added: [], - deleted: ['deleted_file', 'deleted_then_created_file'], - } as StatusResult); + git.getRepoStatus.mockResolvedValueOnce( + partial({ + modified: ['modified_file', 'modified_then_deleted_file'], + not_added: [], + deleted: ['deleted_file', 'deleted_then_created_file'], + }) + ); fs.readLocalFile .mockResolvedValueOnce('modified file content') diff --git a/lib/workers/repository/update/branch/reuse.spec.ts b/lib/workers/repository/update/branch/reuse.spec.ts index 63d540061c1674..1945f185b4d69c 100644 --- a/lib/workers/repository/update/branch/reuse.spec.ts +++ b/lib/workers/repository/update/branch/reuse.spec.ts @@ -35,7 +35,7 @@ describe('workers/repository/update/branch/reuse', () => { it('returns true if no PR', async () => { git.branchExists.mockReturnValueOnce(true); - platform.getBranchPr.mockReturnValue(null); + platform.getBranchPr.mockResolvedValue(null); const res = await shouldReuseExistingBranch(config); expect(res.reuseExistingBranch).toBeTrue(); }); diff --git a/lib/workers/repository/update/pr/automerge.spec.ts b/lib/workers/repository/update/pr/automerge.spec.ts index 8017691b65215c..f8ca6da2c466e1 100644 --- a/lib/workers/repository/update/pr/automerge.spec.ts +++ b/lib/workers/repository/update/pr/automerge.spec.ts @@ -8,8 +8,6 @@ import * as prAutomerge from './automerge'; jest.mock('../../../../util/git'); -const defaultConfig = getConfig(); - describe('workers/repository/update/pr/automerge', () => { describe('checkAutoMerge(pr, config)', () => { const spy = jest.spyOn(schedule, 'isScheduledNow'); @@ -17,9 +15,10 @@ describe('workers/repository/update/pr/automerge', () => { let pr: Pr; beforeEach(() => { - config = partial({ - ...defaultConfig, - }); + // TODO #7154 incompatible types + config = { + ...getConfig(), + } as BranchConfig; pr = partial({}); }); diff --git a/lib/workers/repository/update/pr/body/updates-table.spec.ts b/lib/workers/repository/update/pr/body/updates-table.spec.ts index f2ee613cfb5499..82715c4b16c7f6 100644 --- a/lib/workers/repository/update/pr/body/updates-table.spec.ts +++ b/lib/workers/repository/update/pr/body/updates-table.spec.ts @@ -85,7 +85,8 @@ describe('workers/repository/update/pr/body/updates-table', () => { displayFrom: '^6.2.3', displayTo: '6.2.3', }; - const upgrade3: BranchUpgradeConfig = undefined; + // TODO #7154 allow or filter undefined + const upgrade3 = undefined as never; const configObj: BranchConfig = { manager: 'some-manager', branchName: 'some-branch', diff --git a/lib/workers/repository/update/pr/changelog/github.spec.ts b/lib/workers/repository/update/pr/changelog/github.spec.ts index 313d4d55d2bda0..cb5ab72dc5f119 100644 --- a/lib/workers/repository/update/pr/changelog/github.spec.ts +++ b/lib/workers/repository/update/pr/changelog/github.spec.ts @@ -11,7 +11,7 @@ jest.mock('../../../../../modules/datasource/npm'); const upgrade: BranchUpgradeConfig = { manager: 'some-manager', - branchName: undefined, + branchName: '', depName: 'renovate', endpoint: 'https://api.github.com/', versioning: semverVersioning.id, @@ -53,7 +53,7 @@ describe('workers/repository/update/pr/changelog/github', () => { expect( await getChangeLogJSON({ ...upgrade, - currentVersion: null, + currentVersion: undefined, }) ).toBeNull(); }); @@ -313,7 +313,7 @@ describe('workers/repository/update/pr/changelog/github', () => { const upgradeData: BranchUpgradeConfig = { manager: 'some-manager', - branchName: undefined, + branchName: '', depName: 'correctPrefix/target', endpoint: 'https://api.github.com/', versioning: 'npm', diff --git a/lib/workers/repository/update/pr/changelog/gitlab.spec.ts b/lib/workers/repository/update/pr/changelog/gitlab.spec.ts index f8b7e89cde9837..0e27e9f6511504 100644 --- a/lib/workers/repository/update/pr/changelog/gitlab.spec.ts +++ b/lib/workers/repository/update/pr/changelog/gitlab.spec.ts @@ -9,7 +9,7 @@ jest.mock('../../../../../modules/datasource/npm'); const upgrade: BranchUpgradeConfig = { manager: 'some-manager', - branchName: undefined, + branchName: '', endpoint: 'https://gitlab.com/api/v4/ ', depName: 'renovate', versioning: semverVersioning.id, @@ -51,7 +51,7 @@ describe('workers/repository/update/pr/changelog/gitlab', () => { expect( await getChangeLogJSON({ ...upgrade, - currentVersion: null, + currentVersion: undefined, }) ).toBeNull(); }); diff --git a/lib/workers/repository/update/pr/changelog/index.spec.ts b/lib/workers/repository/update/pr/changelog/index.spec.ts index 570c613e9cebbf..f9e1cb1b0dfc21 100644 --- a/lib/workers/repository/update/pr/changelog/index.spec.ts +++ b/lib/workers/repository/update/pr/changelog/index.spec.ts @@ -59,7 +59,7 @@ describe('workers/repository/update/pr/changelog/index', () => { expect( await getChangeLogJSON({ ...upgrade, - currentVersion: null, + currentVersion: undefined, }) ).toBeNull(); }); diff --git a/lib/workers/repository/update/pr/changelog/release-notes.spec.ts b/lib/workers/repository/update/pr/changelog/release-notes.spec.ts index 9580a00edbf327..661f58796fbcbf 100644 --- a/lib/workers/repository/update/pr/changelog/release-notes.spec.ts +++ b/lib/workers/repository/update/pr/changelog/release-notes.spec.ts @@ -98,7 +98,10 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { expect( await addReleaseNotes(input as never, {} as BranchUpgradeConfig) ).toEqual(input); - expect(await addReleaseNotes(null, {} as BranchUpgradeConfig)).toBeNull(); + // TODO #7154 + expect( + await addReleaseNotes(null as never, {} as BranchUpgradeConfig) + ).toBeNull(); expect( await addReleaseNotes( { versions: [] } as never, @@ -974,7 +977,7 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { gitRef: '15.3.0', } as ChangeLogRelease ); - versionOneNotes = res; + versionOneNotes = res!; expect(res).toMatchSnapshot({ notesSourceUrl: @@ -1004,7 +1007,7 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { gitRef: '15.2.0', } as ChangeLogRelease ); - versionTwoNotes = res; + versionTwoNotes = res!; expect(res).toMatchSnapshot({ notesSourceUrl: @@ -1034,7 +1037,7 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { gitRef: '4.33.0', } as ChangeLogRelease ); - versionTwoNotes = res; + versionTwoNotes = res!; expect(res).toMatchSnapshot({ notesSourceUrl: @@ -1070,7 +1073,7 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { gitRef: '4.33.0', } as ChangeLogRelease ); - versionTwoNotes = res; + versionTwoNotes = res!; expect(res).toMatchSnapshot({ notesSourceUrl: diff --git a/lib/workers/repository/update/pr/changelog/release-notes.ts b/lib/workers/repository/update/pr/changelog/release-notes.ts index 8a94dec41c3a89..efc52019bf815d 100644 --- a/lib/workers/repository/update/pr/changelog/release-notes.ts +++ b/lib/workers/repository/update/pr/changelog/release-notes.ts @@ -374,6 +374,7 @@ export function releaseNotesCacheMinutes(releaseDate?: string | Date): number { return 14495; // 5 minutes shy of 10 days } +// TODO #7154 allow `null` and `undefined` export async function addReleaseNotes( input: ChangeLogResult, config: BranchUpgradeConfig diff --git a/lib/workers/repository/update/pr/code-owners.spec.ts b/lib/workers/repository/update/pr/code-owners.spec.ts index fdf8644b7ff2ee..f3639b9ed15d06 100644 --- a/lib/workers/repository/update/pr/code-owners.spec.ts +++ b/lib/workers/repository/update/pr/code-owners.spec.ts @@ -82,7 +82,7 @@ describe('workers/repository/update/pr/code-owners', () => { if (path === codeOwnerFilePath) { return Promise.resolve(['* @mike'].join('\n')); } - return Promise.resolve(null); + return Promise.resolve(null); }); git.getBranchFiles.mockResolvedValueOnce(['README.md']); const codeOwners = await codeOwnersForPr(pr); diff --git a/lib/workers/repository/update/pr/labels.spec.ts b/lib/workers/repository/update/pr/labels.spec.ts index 60f5f8d315f419..f3f16a8cc978f1 100644 --- a/lib/workers/repository/update/pr/labels.spec.ts +++ b/lib/workers/repository/update/pr/labels.spec.ts @@ -49,11 +49,12 @@ describe('workers/repository/update/pr/labels', () => { }); it('null labels ignored', () => { + // TODO #7154 const result = prepareLabels({ - labels: ['labelA', null], + labels: ['labelA', null] as never, // an empty space between two commas in an array is categorized as a null value // eslint-disable-next-line no-sparse-arrays - addLabels: ['labelB', '', undefined, , ,], + addLabels: ['labelB', '', undefined, , ,] as never, }); expect(result).toBeArrayOfSize(2); expect(result).toEqual(['labelA', 'labelB']); diff --git a/lib/workers/repository/updates/flatten.spec.ts b/lib/workers/repository/updates/flatten.spec.ts index ce5df4f5a7c532..c3f987abaf61cb 100644 --- a/lib/workers/repository/updates/flatten.spec.ts +++ b/lib/workers/repository/updates/flatten.spec.ts @@ -15,7 +15,8 @@ beforeEach(() => { describe('workers/repository/updates/flatten', () => { describe('flattenUpdates()', () => { it('flattens', async () => { - config.lockFileMaintenance.enabled = true; + // TODO #7154 + config.lockFileMaintenance!.enabled = true; config.packageRules = [ { matchUpdateTypes: ['minor'], diff --git a/lib/workers/repository/updates/generate.spec.ts b/lib/workers/repository/updates/generate.spec.ts index 25ded125464fbf..a6fa8195bf381b 100644 --- a/lib/workers/repository/updates/generate.spec.ts +++ b/lib/workers/repository/updates/generate.spec.ts @@ -1,7 +1,6 @@ -import { defaultConfig, partial } from '../../../../test/util'; +import { defaultConfig } from '../../../../test/util'; import type { UpdateType } from '../../../config/types'; import { NpmDatasource } from '../../../modules/datasource/npm'; -import type { LookupUpdate } from '../../../modules/manager/types'; import type { BranchUpgradeConfig } from '../../types'; import { generateBranchConfig } from './generate'; @@ -12,7 +11,7 @@ beforeEach(() => { describe('workers/repository/updates/generate', () => { describe('generateBranchConfig()', () => { it('does not group single upgrade', () => { - const branch = [ + const branch: BranchUpgradeConfig[] = [ { manager: 'some-manager', depName: 'some-dep', @@ -33,7 +32,7 @@ describe('workers/repository/updates/generate', () => { }); it('handles lockFileMaintenance', () => { - const branch = [ + const branch: BranchUpgradeConfig[] = [ { manager: 'some-manager', branchName: 'some-branch', @@ -57,7 +56,7 @@ describe('workers/repository/updates/generate', () => { }); it('handles lockFileUpdate', () => { - const branch = [ + const branch: BranchUpgradeConfig[] = [ { manager: 'some-manager', branchName: 'some-branch', @@ -97,7 +96,7 @@ describe('workers/repository/updates/generate', () => { }); it('does not group same upgrades', () => { - const branch = [ + const branch: BranchUpgradeConfig[] = [ { manager: 'some-manager', depName: 'some-dep', @@ -127,7 +126,7 @@ describe('workers/repository/updates/generate', () => { }); it('groups multiple upgrades same version', () => { - const branch = [ + const branch: BranchUpgradeConfig[] = [ { manager: 'some-manager', depName: 'some-dep', @@ -199,7 +198,7 @@ describe('workers/repository/updates/generate', () => { }); it('groups major updates with different versions but same newValue, no recreateClosed', () => { - const branch = [ + const branch: BranchUpgradeConfig[] = [ { manager: 'some-manager', depName: 'some-dep', @@ -235,7 +234,7 @@ describe('workers/repository/updates/generate', () => { }); it('groups multiple upgrades different version', () => { - const branch = [ + const branch: BranchUpgradeConfig[] = [ { manager: 'some-manager', depName: 'depB', @@ -278,7 +277,7 @@ describe('workers/repository/updates/generate', () => { }); it('groups multiple upgrades different version but same value', () => { - const branch = [ + const branch: BranchUpgradeConfig[] = [ { manager: 'some-manager', depName: 'depB', @@ -321,7 +320,7 @@ describe('workers/repository/updates/generate', () => { }); it('groups multiple upgrades different value but same version', () => { - const branch = [ + const branch: BranchUpgradeConfig[] = [ { manager: 'some-manager', depName: 'depB', @@ -364,7 +363,7 @@ describe('workers/repository/updates/generate', () => { }); it('groups multiple digest updates', () => { - const branch = [ + const branch: BranchUpgradeConfig[] = [ { manager: 'some-manager', depName: 'foo/bar', @@ -404,15 +403,16 @@ describe('workers/repository/updates/generate', () => { }); it('pins digest to table', () => { - const branch = [ - partial({ + // TODO #7154 incompatible types + const branch: BranchUpgradeConfig[] = [ + { ...defaultConfig, depName: 'foo-image', newDigest: 'abcdefg987612345', currentDigest: '', updateType: 'pinDigest', isPinDigest: true, - }), + } as BranchUpgradeConfig, ]; const res = generateBranchConfig(branch); expect(res.upgrades[0].displayFrom).toBe(''); @@ -420,7 +420,7 @@ describe('workers/repository/updates/generate', () => { }); it('fixes different messages', () => { - const branch = [ + const branch: BranchUpgradeConfig[] = [ { manager: 'some-manager', depName: 'depA', @@ -460,8 +460,9 @@ describe('workers/repository/updates/generate', () => { }); it('uses semantic commits', () => { - const branch = [ - partial({ + // TODO #7154 incompatible types + const branch: BranchUpgradeConfig[] = [ + { ...defaultConfig, manager: 'some-manager', depName: 'some-dep', @@ -475,7 +476,7 @@ describe('workers/repository/updates/generate', () => { group: { foo: 2, }, - }), + } as BranchUpgradeConfig, ]; const res = generateBranchConfig(branch); expect(res.prTitle).toBe( @@ -484,8 +485,9 @@ describe('workers/repository/updates/generate', () => { }); it('scopes monorepo commits', () => { - const branch = [ - partial({ + // TODO #7154 incompatible types + const branch: BranchUpgradeConfig[] = [ + { ...defaultConfig, manager: 'some-manager', depName: 'some-dep', @@ -501,15 +503,16 @@ describe('workers/repository/updates/generate', () => { group: { foo: 2, }, - }), + } as BranchUpgradeConfig, ]; const res = generateBranchConfig(branch); expect(res.prTitle).toBe('chore(): update dependency some-dep to v1.2.0'); }); it('scopes monorepo commits with nested package files using parent directory', () => { - const branch = [ - partial({ + // TODO #7154 incompatible types + const branch: BranchUpgradeConfig[] = [ + { ...defaultConfig, commitBodyTable: false, manager: 'some-manager', @@ -526,7 +529,7 @@ describe('workers/repository/updates/generate', () => { group: { foo: 2, }, - }), + } as BranchUpgradeConfig, ]; const res = generateBranchConfig(branch); expect(res.prTitle).toBe( @@ -535,8 +538,9 @@ describe('workers/repository/updates/generate', () => { }); it('scopes monorepo commits with nested package files using base directory', () => { - const branch = [ - partial({ + // TODO #7154 incompatible types + const branch: BranchUpgradeConfig[] = [ + { ...defaultConfig, manager: 'some-manager', depName: 'some-dep', @@ -552,7 +556,7 @@ describe('workers/repository/updates/generate', () => { group: { foo: 2, }, - }), + } as BranchUpgradeConfig, ]; const res = generateBranchConfig(branch); expect(res.prTitle).toBe( @@ -561,8 +565,9 @@ describe('workers/repository/updates/generate', () => { }); it('adds commit message body', () => { - const branch = [ - partial({ + // TODO #7154 incompatible types + const branch: BranchUpgradeConfig[] = [ + { ...defaultConfig, manager: 'some-manager', depName: 'some-dep', @@ -570,7 +575,7 @@ describe('workers/repository/updates/generate', () => { newValue: '1.2.0', isSingleVersion: true, newVersion: '1.2.0', - }), + } as BranchUpgradeConfig, ]; const res = generateBranchConfig(branch); expect(res.commitMessage).toMatchSnapshot(); @@ -578,14 +583,15 @@ describe('workers/repository/updates/generate', () => { }); it('supports manual prTitle', () => { - const branch = [ - partial({ + // TODO #7154 incompatible types + const branch: BranchUpgradeConfig[] = [ + { ...defaultConfig, manager: 'some-manager', depName: 'some-dep', prTitle: 'Upgrade {{depName}}', toLowerCase: true, - }), + } as BranchUpgradeConfig, ]; const res = generateBranchConfig(branch); expect(res.prTitle).toBe('upgrade some-dep'); @@ -598,7 +604,7 @@ describe('workers/repository/updates/generate', () => { commitBodyTable: true, datasource: NpmDatasource.id, depName: '@types/some-dep', - groupName: null, + groupName: null as never, branchName: 'some-branch', prTitle: 'some-title', currentValue: '0.5.7', @@ -612,7 +618,7 @@ describe('workers/repository/updates/generate', () => { datasource: NpmDatasource.id, manager: 'some-manager', depName: 'some-dep', - groupName: null, + groupName: null as never, branchName: 'some-branch', prTitle: 'some-title', newValue: '0.6.0', @@ -623,7 +629,7 @@ describe('workers/repository/updates/generate', () => { datasource: NpmDatasource.id, manager: 'some-manager', depName: 'some-dep', - groupName: null, + groupName: null as never, branchName: 'some-branch', prTitle: 'some-other-title', newValue: '1.0.0', @@ -661,7 +667,7 @@ describe('workers/repository/updates/generate', () => { { manager: 'some-manager', depName: 'some-dep', - groupName: null, + groupName: null as never, branchName: 'some-branch', prTitle: 'some-title', newValue: '0.6.0', @@ -673,7 +679,7 @@ describe('workers/repository/updates/generate', () => { datasource: NpmDatasource.id, manager: 'some-manager', depName: 'some-dep', - groupName: null, + groupName: null as never, branchName: 'some-branch', prTitle: 'some-other-title', newValue: '1.0.0', @@ -683,7 +689,7 @@ describe('workers/repository/updates/generate', () => { { manager: 'some-manager', depName: '@types/some-dep', - groupName: null, + groupName: null as never, branchName: 'some-branch', prTitle: 'some-title', newValue: '0.5.7', @@ -718,6 +724,7 @@ describe('workers/repository/updates/generate', () => { }); it('handles upgrades', () => { + // TODO #7154 incompatible types const branch: BranchUpgradeConfig[] = [ { manager: 'some-manager', @@ -765,7 +772,7 @@ describe('workers/repository/updates/generate', () => { updateType: 'patch' as UpdateType, fileReplacePosition: 0, }, - ]; + ] as BranchUpgradeConfig[]; const res = generateBranchConfig(branch); expect(res.prTitle).toMatchSnapshot('some-title (patch)'); }); @@ -829,7 +836,7 @@ describe('workers/repository/updates/generate', () => { }); it('passes through pendingChecks', () => { - const branch = [ + const branch: BranchUpgradeConfig[] = [ { manager: 'some-manager', depName: 'some-dep', @@ -853,7 +860,7 @@ describe('workers/repository/updates/generate', () => { }); it('filters pendingChecks', () => { - const branch = [ + const branch: BranchUpgradeConfig[] = [ { manager: 'some-manager', depName: 'some-dep', @@ -876,7 +883,7 @@ describe('workers/repository/updates/generate', () => { }); it('displays pending versions', () => { - const branch = [ + const branch: BranchUpgradeConfig[] = [ { manager: 'some-manager', depName: 'some-dep', diff --git a/tsconfig.strict.json b/tsconfig.strict.json index 31ed5c1aaa64c6..a4aad68848c2b9 100644 --- a/tsconfig.strict.json +++ b/tsconfig.strict.json @@ -12,9 +12,7 @@ "**/__mocks__/*", "coverage", "config.js", - "tmp", + "tmp" // TODO: fixme - "lib/workers/**/*.spec.ts", - "lib/renovate.spec.ts" ] } From e5c6f38d750383538bab95a40184058fec5bf0e0 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Tue, 21 Jun 2022 13:00:21 +0200 Subject: [PATCH 154/240] refactor: enable strict checks (#16168) * refactor: enable strict checks * chore: revert changes * chore: fix tsconfig --- .eslintrc.js | 2 +- .github/workflows/build.yml | 4 +- lib/config/migration.ts | 3 - lib/config/options/index.spec.ts | 2 - lib/config/presets/gitea/index.ts | 1 - lib/config/presets/index.spec.ts | 1 - lib/config/presets/local/common.ts | 1 - lib/config/presets/local/index.ts | 1 - lib/config/presets/npm/index.ts | 1 - lib/config/validation.ts | 2 - lib/modules/datasource/crate/index.ts | 1 - lib/modules/datasource/docker/index.ts | 12 +-- lib/modules/datasource/galaxy/index.ts | 9 +-- lib/modules/datasource/github-tags/index.ts | 6 +- lib/modules/datasource/gitlab-tags/index.ts | 1 - lib/modules/datasource/index.spec.ts | 2 - lib/modules/datasource/index.ts | 13 ++-- lib/modules/datasource/npm/npmrc.ts | 1 - lib/modules/datasource/packagist/index.ts | 1 - .../datasource/rubygems/get-rubygems-org.ts | 3 +- .../manager/batect-wrapper/artifacts.ts | 1 - lib/modules/manager/batect/extract.spec.ts | 1 - lib/modules/manager/batect/extract.ts | 1 - lib/modules/manager/composer/extract.ts | 1 - lib/modules/manager/composer/update-locked.ts | 1 - lib/modules/manager/composer/utils.ts | 4 +- lib/modules/manager/flux/extract.ts | 1 - .../manager/git-submodules/artifacts.ts | 3 +- lib/modules/manager/git-submodules/update.ts | 2 - lib/modules/manager/gitlabci/extract.spec.ts | 1 - lib/modules/manager/gitlabci/utils.ts | 4 +- lib/modules/manager/gomod/artifacts.ts | 3 - lib/modules/manager/gomod/extract.ts | 1 - lib/modules/manager/gomod/update.spec.ts | 1 - lib/modules/manager/gomod/update.ts | 11 +-- .../gradle-wrapper/artifacts-real.spec.ts | 1 - .../manager/gradle-wrapper/artifacts.ts | 3 - lib/modules/manager/gradle/parser.spec.ts | 2 - lib/modules/manager/gradle/parser.ts | 4 - lib/modules/manager/gradle/update.ts | 4 +- lib/modules/manager/helmv3/extract.ts | 1 - lib/modules/manager/index.spec.ts | 1 - .../manager/jsonnet-bundler/artifacts.ts | 1 - lib/modules/manager/maven/extract.ts | 11 +-- lib/modules/manager/maven/index.spec.ts | 1 - lib/modules/manager/maven/update.spec.ts | 1 - lib/modules/manager/maven/update.ts | 3 +- lib/modules/manager/metadata.spec.ts | 1 - lib/modules/manager/mix/artifacts.spec.ts | 1 - .../manager/npm/extract/locked-versions.ts | 7 +- lib/modules/manager/npm/extract/monorepo.ts | 15 ++-- lib/modules/manager/npm/extract/pnpm.ts | 3 +- lib/modules/manager/npm/post-update/index.ts | 52 ++++++------- lib/modules/manager/npm/post-update/lerna.ts | 2 +- lib/modules/manager/npm/post-update/npm.ts | 10 +-- lib/modules/manager/npm/range.ts | 2 +- .../npm/update/dependency/index.spec.ts | 1 - .../manager/npm/update/dependency/index.ts | 11 +-- .../update/locked-dependency/index.spec.ts | 1 - .../locked-dependency/package-lock/index.ts | 13 ++-- .../locked-dependency/yarn-lock/index.ts | 6 +- lib/modules/manager/npm/utils.spec.ts | 1 - lib/modules/manager/nuget/extract.ts | 10 +-- lib/modules/manager/nuget/package-tree.ts | 1 - .../manager/pip_requirements/extract.ts | 5 +- lib/modules/manager/pip_setup/extract.ts | 2 +- lib/modules/manager/pipenv/extract.ts | 6 +- .../manager/terraform/lockfile/index.ts | 6 +- .../manager/terraform/lockfile/util.ts | 12 ++- lib/modules/manager/terraform/modules.ts | 4 +- lib/modules/manager/terraform/providers.ts | 9 +-- .../manager/terraform/required-providers.ts | 6 +- lib/modules/manager/terraform/resources.ts | 6 +- lib/modules/manager/terraform/util.ts | 5 +- lib/modules/manager/terragrunt/extract.ts | 2 +- lib/modules/manager/terragrunt/modules.ts | 4 +- .../platform/azure/azure-got-wrapper.ts | 3 +- lib/modules/platform/azure/azure-helper.ts | 7 +- lib/modules/platform/azure/index.ts | 53 ++++++------- lib/modules/platform/azure/util.ts | 5 +- .../platform/bitbucket-server/index.ts | 15 ++-- .../platform/bitbucket-server/utils.ts | 2 +- lib/modules/platform/bitbucket/index.ts | 16 ++-- lib/modules/platform/gitea/index.ts | 29 ++++--- lib/modules/platform/github/index.ts | 76 +++++++++---------- lib/modules/platform/gitlab/index.ts | 23 +++--- lib/modules/platform/index.ts | 6 +- lib/modules/versioning/npm/range.ts | 5 +- lib/workers/global/index.ts | 1 - .../config-migration/branch/migrated-data.ts | 1 - .../repository/config-migration/pr/index.ts | 2 +- .../repository/dependency-dashboard.spec.ts | 1 - .../repository/dependency-dashboard.ts | 12 +-- lib/workers/repository/error-config.ts | 2 +- lib/workers/repository/errors-warnings.ts | 2 +- lib/workers/repository/extract/file-match.ts | 6 +- lib/workers/repository/finalise/prune.ts | 2 +- lib/workers/repository/index.ts | 2 +- lib/workers/repository/init/apis.ts | 8 +- lib/workers/repository/init/merge.ts | 2 +- .../repository/init/vulnerability.spec.ts | 4 +- lib/workers/repository/init/vulnerability.ts | 3 +- .../repository/onboarding/branch/check.ts | 3 +- .../repository/onboarding/branch/config.ts | 2 +- .../repository/onboarding/branch/create.ts | 4 +- .../onboarding/branch/index.spec.ts | 4 +- .../repository/onboarding/branch/index.ts | 4 +- .../repository/onboarding/branch/rebase.ts | 4 +- .../onboarding/pr/config-description.ts | 2 +- lib/workers/repository/onboarding/pr/index.ts | 4 +- .../repository/onboarding/pr/pr-list.ts | 3 +- lib/workers/repository/process/deprecated.ts | 2 +- .../repository/process/extract-update.ts | 2 +- lib/workers/repository/process/fetch.ts | 2 +- lib/workers/repository/process/index.ts | 2 +- lib/workers/repository/process/limits.ts | 2 +- .../process/lookup/filter-checks.ts | 14 ++-- .../repository/process/lookup/filter.ts | 2 +- .../repository/process/lookup/generate.ts | 4 +- .../repository/process/lookup/index.ts | 55 ++++++-------- .../repository/process/lookup/rollback.ts | 6 +- lib/workers/repository/process/sort.ts | 4 +- .../repository/process/vulnerabilities.ts | 2 +- .../update/branch/auto-replace.spec.ts | 1 - .../repository/update/branch/auto-replace.ts | 2 +- .../repository/update/branch/automerge.ts | 2 +- .../update/branch/check-existing.ts | 2 +- .../repository/update/branch/commit.spec.ts | 1 - .../repository/update/branch/commit.ts | 2 +- .../branch/execute-post-upgrade-commands.ts | 2 +- .../update/branch/handle-existing.ts | 2 +- lib/workers/repository/update/branch/index.ts | 6 +- lib/workers/repository/update/branch/reuse.ts | 2 +- lib/workers/repository/update/pr/automerge.ts | 2 +- .../update/pr/changelog/github/index.ts | 2 +- .../update/pr/changelog/gitlab/index.ts | 2 +- .../update/pr/changelog/release-notes.ts | 2 +- .../update/pr/changelog/releases.ts | 2 +- .../update/pr/changelog/source-github.ts | 2 +- .../update/pr/changelog/source-gitlab.ts | 2 +- lib/workers/repository/updates/branch-name.ts | 10 +-- lib/workers/repository/updates/branchify.ts | 2 +- package.json | 4 +- tsconfig.app.json | 1 - tsconfig.json | 4 +- tsconfig.strict.json | 3 +- 146 files changed, 341 insertions(+), 474 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index ffb596076a199d..72f2ce598f782b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -95,7 +95,7 @@ module.exports = { }, ], '@typescript-eslint/prefer-optional-chain': 2, - '@typescript-eslint/prefer-nullish-coalescing': 2, + '@typescript-eslint/prefer-nullish-coalescing': 1, // TODO: Temporary (#7154) curly: [2, 'all'], 'require-await': 2, // next 2 rules disabled due to https://github.com/microsoft/TypeScript/issues/20024 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 36a12865108123..2999333f1997e3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -137,8 +137,8 @@ jobs: - name: Type check run: yarn type-check - - name: Null check - run: yarn null-check + - name: Strict check + run: yarn strict-check release: needs: [lint, test] diff --git a/lib/config/migration.ts b/lib/config/migration.ts index 88cbae7d3e636b..ace62ce9ff50e1 100644 --- a/lib/config/migration.ts +++ b/lib/config/migration.ts @@ -155,13 +155,10 @@ export function migrateConfig(config: RenovateConfig): MigratedConfig { migratedConfig[key] = String(val[0]); } else if (key === 'node' && (val as RenovateConfig).enabled === true) { // validated non-null - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion delete migratedConfig.node!.enabled; migratedConfig.travis = migratedConfig.travis ?? {}; migratedConfig.travis.enabled = true; - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion if (Object.keys(migratedConfig.node!).length) { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion const subMigrate = migrateConfig(migratedConfig.node!); migratedConfig.node = subMigrate.migratedConfig; } else { diff --git a/lib/config/options/index.spec.ts b/lib/config/options/index.spec.ts index 27277a8b0222e6..ddfc1b2f5e9191 100644 --- a/lib/config/options/index.spec.ts +++ b/lib/config/options/index.spec.ts @@ -23,7 +23,6 @@ describe('config/options/index', () => { .filter((option) => option.supportedManagers) .forEach((option) => { expect(option.supportedManagers).toBeNonEmptyArray(); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion for (const item of option.supportedManagers!) { expect(managerList).toContain(item); } @@ -39,7 +38,6 @@ describe('config/options/index', () => { .filter((option) => option.supportedPlatforms) .forEach((option) => { expect(option.supportedPlatforms).toBeNonEmptyArray(); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion for (const item of option.supportedPlatforms!) { expect(platformList).toContain(item); } diff --git a/lib/config/presets/gitea/index.ts b/lib/config/presets/gitea/index.ts index 6bf1ed6106f561..91c80ef522613a 100644 --- a/lib/config/presets/gitea/index.ts +++ b/lib/config/presets/gitea/index.ts @@ -34,7 +34,6 @@ export async function fetchJSONFile( } // TODO: null check #7154 - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion return parsePreset(fromBase64(res.content!)); } diff --git a/lib/config/presets/index.spec.ts b/lib/config/presets/index.spec.ts index d6a562dbfe7d32..64290cf42174ef 100644 --- a/lib/config/presets/index.spec.ts +++ b/lib/config/presets/index.spec.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { Fixtures } from '../../../test/fixtures'; import { mocked } from '../../../test/util'; import type { RenovateConfig } from '../types'; diff --git a/lib/config/presets/local/common.ts b/lib/config/presets/local/common.ts index 9e6823bac27624..3271595554cb9c 100644 --- a/lib/config/presets/local/common.ts +++ b/lib/config/presets/local/common.ts @@ -27,7 +27,6 @@ export async function fetchJSONFile( } // TODO: null check #7154 - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion return parsePreset(raw!); } diff --git a/lib/config/presets/local/index.ts b/lib/config/presets/local/index.ts index 6b951eeea3e5fd..4703b51c5e00db 100644 --- a/lib/config/presets/local/index.ts +++ b/lib/config/presets/local/index.ts @@ -39,7 +39,6 @@ export function getPreset({ presetName, presetPath, // TODO: fix type #7154 - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion endpoint!, tag ); diff --git a/lib/config/presets/npm/index.ts b/lib/config/presets/npm/index.ts index 4cff9788cbbf96..28b2b3253cc6d4 100644 --- a/lib/config/presets/npm/index.ts +++ b/lib/config/presets/npm/index.ts @@ -35,7 +35,6 @@ export async function getPreset({ } const body = (await http.getJson(packageUrl)).body; // TODO: check null #7154 - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion dep = body.versions![body['dist-tags']!.latest]; } catch (err) { throw new Error(PRESET_DEP_NOT_FOUND); diff --git a/lib/config/validation.ts b/lib/config/validation.ts index 23be22ec6a7055..92209fc4f7788f 100644 --- a/lib/config/validation.ts +++ b/lib/config/validation.ts @@ -320,7 +320,6 @@ export async function validateConfig( if (key === 'packageRules') { for (const [subIndex, packageRule] of val.entries()) { if (is.object(packageRule)) { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion const resolvedRule = migrateConfig({ packageRules: [ await resolveConfigPresets( @@ -505,7 +504,6 @@ export async function validateConfig( if ( (selectors.includes(key) || key === 'matchCurrentVersion') && // TODO: can be undefined ? #7154 - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion !rulesRe.test(parentPath!) && // Inside a packageRule (parentPath || !isPreset) // top level in a preset ) { diff --git a/lib/modules/datasource/crate/index.ts b/lib/modules/datasource/crate/index.ts index f03476ef209e17..6e62d59f765470 100644 --- a/lib/modules/datasource/crate/index.ts +++ b/lib/modules/datasource/crate/index.ts @@ -267,7 +267,6 @@ export class CrateDatasource extends Datasource { const clonePathPromise: Promise | null = memCache.get(cacheKey); let clonePath: string; - // eslint-disable-next-line @typescript-eslint/no-misused-promises if (clonePathPromise) { clonePath = await clonePathPromise; } else { diff --git a/lib/modules/datasource/docker/index.ts b/lib/modules/datasource/docker/index.ts index c03122762d250d..c258891cda89a4 100644 --- a/lib/modules/datasource/docker/index.ts +++ b/lib/modules/datasource/docker/index.ts @@ -159,7 +159,7 @@ export async function getAuthHeaders( ) ).body; - const token = authResponse.token || authResponse.access_token; + const token = authResponse.token ?? authResponse.access_token; // istanbul ignore if if (!token) { logger.warn('Failed to obtain docker registry token'); @@ -512,7 +512,7 @@ export class DockerDatasource extends Datasource { manifest.mediaType === MediaType.ociManifestIndexV1 || (!manifest.mediaType && hasKey('manifests', manifest)) ) { - const imageList = manifest as OciImageList; + const imageList = manifest; if (imageList.manifests.length) { logger.trace( { registry, dockerRepository, tag }, @@ -812,10 +812,9 @@ export class DockerDatasource extends Datasource { { registryUrl, packageName }: GetReleasesConfig, newValue?: string ) => { - const newTag = newValue || 'latest'; + const newTag = newValue ?? 'latest'; const { registryHost, dockerRepository } = getRegistryRepository( packageName, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion registryUrl! ); return `${registryHost}:${dockerRepository}:${newTag}`; @@ -827,13 +826,12 @@ export class DockerDatasource extends Datasource { ): Promise { const { registryHost, dockerRepository } = getRegistryRepository( packageName, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion registryUrl! ); logger.debug( `getDigest(${registryHost}, ${dockerRepository}, ${newValue})` ); - const newTag = newValue || 'latest'; + const newTag = newValue ?? 'latest'; let digest: string | null = null; try { let manifestResponse = await this.getManifestResponse( @@ -857,7 +855,6 @@ export class DockerDatasource extends Datasource { dockerRepository, newTag ); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion digest = extractDigestFromResponseBody(manifestResponse!); } logger.debug({ digest }, 'Got docker digest'); @@ -895,7 +892,6 @@ export class DockerDatasource extends Datasource { }: GetReleasesConfig): Promise { const { registryHost, dockerRepository } = getRegistryRepository( packageName, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion registryUrl! ); const tags = await this.getTags(registryHost, dockerRepository); diff --git a/lib/modules/datasource/galaxy/index.ts b/lib/modules/datasource/galaxy/index.ts index 3b9908b90c082b..2d5d7aa1f89d54 100644 --- a/lib/modules/datasource/galaxy/index.ts +++ b/lib/modules/datasource/galaxy/index.ts @@ -29,13 +29,8 @@ export class GalaxyDatasource extends Datasource { const userName = lookUp[0]; const projectName = lookUp[1]; - const galaxyAPIUrl = - registryUrl + - 'api/v1/roles/?owner__username=' + - userName + - '&name=' + - projectName; - const galaxyProjectUrl = registryUrl + userName + '/' + projectName; + const galaxyAPIUrl = `${registryUrl}api/v1/roles/?owner__username=${userName}&name=${projectName}`; + const galaxyProjectUrl = `${registryUrl}${userName}/${projectName}`; let raw: HttpResponse | null = null; try { diff --git a/lib/modules/datasource/github-tags/index.ts b/lib/modules/datasource/github-tags/index.ts index 6b0ccdff0879dc..b6990fea04f9a3 100644 --- a/lib/modules/datasource/github-tags/index.ts +++ b/lib/modules/datasource/github-tags/index.ts @@ -74,10 +74,8 @@ export class GithubTagsDatasource extends GithubReleasesDatasource { newValue?: string ): Promise { return newValue - ? // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion - this.getTagCommit(registryUrl, repo!, newValue) - : // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion - this.getCommit(registryUrl, repo!); + ? this.getTagCommit(registryUrl, repo!, newValue) + : this.getCommit(registryUrl, repo!); } override async getReleases( diff --git a/lib/modules/datasource/gitlab-tags/index.ts b/lib/modules/datasource/gitlab-tags/index.ts index bb9185f7a5eb61..c80b9b4911530f 100644 --- a/lib/modules/datasource/gitlab-tags/index.ts +++ b/lib/modules/datasource/gitlab-tags/index.ts @@ -75,7 +75,6 @@ export class GitlabTagsDatasource extends Datasource { ): Promise { const depHost = getDepHost(registryUrl); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion const urlEncodedRepo = encodeURIComponent(repo!); let digest: string | null = null; diff --git a/lib/modules/datasource/index.spec.ts b/lib/modules/datasource/index.spec.ts index 1463e98cd00769..1cbf25a0bc5818 100644 --- a/lib/modules/datasource/index.spec.ts +++ b/lib/modules/datasource/index.spec.ts @@ -1,5 +1,3 @@ -/* fixme #7154 */ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import fs from 'fs-extra'; import { logger } from '../../../test/util'; import { diff --git a/lib/modules/datasource/index.ts b/lib/modules/datasource/index.ts index ece88626ad2201..2baaeb7f35973b 100644 --- a/lib/modules/datasource/index.ts +++ b/lib/modules/datasource/index.ts @@ -236,7 +236,7 @@ export function getDefaultVersioning(datasourceName: string): string { if (!datasource) { logger.warn({ datasourceName }, 'Missing datasource!'); } - return datasource?.defaultVersioning || 'semver'; + return datasource?.defaultVersioning ?? 'semver'; } function applyReplacements( @@ -281,7 +281,7 @@ async function fetchReleases( config.additionalRegistryUrls ); let dep: ReleaseResult | null = null; - const registryStrategy = datasource.registryStrategy || 'hunt'; + const registryStrategy = datasource.registryStrategy ?? 'hunt'; try { if (is.nonEmptyArray(registryUrls)) { if (registryStrategy === 'first') { @@ -336,7 +336,7 @@ export async function getPkgReleases( logger.warn('No datasource found'); return null; } - const packageName = config.packageName || config.depName; + const packageName = config.packageName ?? config.depName; if (!packageName) { logger.error({ config }, 'Datasource getReleases without packageName'); return null; @@ -374,7 +374,7 @@ export async function getPkgReleases( } // Use the datasource's default versioning if none is configured const versioning = - config.versioning || getDefaultVersioning(config.datasource); + config.versioning ?? getDefaultVersioning(config.datasource); const version = allVersioning.get(versioning); // Filter and sort valid versions @@ -391,7 +391,7 @@ export async function getPkgReleases( ); // Filter releases for compatibility for (const [constraintName, constraintValue] of Object.entries( - config.constraints || {} + config.constraints ?? {} )) { // Currently we only support if the constraint is a plain version // TODO: Support range/range compatibility filtering #8476 @@ -448,7 +448,6 @@ export function getDigest( return Promise.resolve(null); } const digestConfig = getDigestConfig(datasource, config); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion return datasource.getDigest!(digestConfig, value); } @@ -457,6 +456,6 @@ export function getDefaultConfig( ): Promise> { const loadedDatasource = getDatasourceFor(datasource); return Promise.resolve>( - loadedDatasource?.defaultConfig || Object.create({}) + loadedDatasource?.defaultConfig ?? Object.create({}) ); } diff --git a/lib/modules/datasource/npm/npmrc.ts b/lib/modules/datasource/npm/npmrc.ts index fccb2d7fd4d6a8..5c9354b3fd8878 100644 --- a/lib/modules/datasource/npm/npmrc.ts +++ b/lib/modules/datasource/npm/npmrc.ts @@ -174,7 +174,6 @@ export function resolveRegistryUrl(packageName: string): string { packageName.startsWith(matchPackagePrefixes[0]) ) { // TODO: fix types #7154 - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion registryUrl = registryUrls![0]; } } diff --git a/lib/modules/datasource/packagist/index.ts b/lib/modules/datasource/packagist/index.ts index 3f218ad3712074..48a947215bb221 100644 --- a/lib/modules/datasource/packagist/index.ts +++ b/lib/modules/datasource/packagist/index.ts @@ -274,7 +274,6 @@ export class PackagistDatasource extends Datasource { if (name in providerPackages) { pkgUrl = URL.resolve( regUrl, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion providersUrl! .replace('%package%', name) .replace('%hash%', providerPackages[name]) diff --git a/lib/modules/datasource/rubygems/get-rubygems-org.ts b/lib/modules/datasource/rubygems/get-rubygems-org.ts index e8c26257d95b2a..7e416fa94f1800 100644 --- a/lib/modules/datasource/rubygems/get-rubygems-org.ts +++ b/lib/modules/datasource/rubygems/get-rubygems-org.ts @@ -119,8 +119,7 @@ export class RubyGemsOrgDatasource extends Datasource { async syncVersions(): Promise { if (RubyGemsOrgDatasource.isDataStale()) { this.updateRubyGemsVersionsPromise = - // eslint-disable-next-line @typescript-eslint/no-misused-promises - this.updateRubyGemsVersionsPromise || this.updateRubyGemsVersions(); + this.updateRubyGemsVersionsPromise ?? this.updateRubyGemsVersions(); await this.updateRubyGemsVersionsPromise; this.updateRubyGemsVersionsPromise = null; } diff --git a/lib/modules/manager/batect-wrapper/artifacts.ts b/lib/modules/manager/batect-wrapper/artifacts.ts index 70ed746392f8f5..d8b70c64cfee8b 100644 --- a/lib/modules/manager/batect-wrapper/artifacts.ts +++ b/lib/modules/manager/batect-wrapper/artifacts.ts @@ -34,7 +34,6 @@ export async function updateArtifacts({ packageFileName, config, }: UpdateArtifact): Promise { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion const version = config.newVersion!; logger.debug({ version, packageFileName }, 'Updating Batect wrapper scripts'); diff --git a/lib/modules/manager/batect/extract.spec.ts b/lib/modules/manager/batect/extract.spec.ts index 3cc1f50465445f..e36c85ece5e344 100644 --- a/lib/modules/manager/batect/extract.spec.ts +++ b/lib/modules/manager/batect/extract.spec.ts @@ -78,7 +78,6 @@ describe('modules/manager/batect/extract', () => { // TODO: #7154 expect( - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion result?.sort((a, b) => a.packageFile!.localeCompare(b.packageFile!)) ).toEqual([ { diff --git a/lib/modules/manager/batect/extract.ts b/lib/modules/manager/batect/extract.ts index 4b957d12ead904..dea4284291e9f2 100644 --- a/lib/modules/manager/batect/extract.ts +++ b/lib/modules/manager/batect/extract.ts @@ -161,7 +161,6 @@ export async function extractAllPackageFiles( const content = await readLocalFile(packageFile, 'utf8'); // TODO #7154 - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion const result = extractPackageFile(content!, packageFile); if (result !== null) { diff --git a/lib/modules/manager/composer/extract.ts b/lib/modules/manager/composer/extract.ts index 021c89fa510e93..06c6838dd3afa3 100644 --- a/lib/modules/manager/composer/extract.ts +++ b/lib/modules/manager/composer/extract.ts @@ -45,7 +45,6 @@ function parseRepositories( switch (repo.type) { case 'vcs': case 'git': - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion repositories[name!] = repo; break; case 'composer': diff --git a/lib/modules/manager/composer/update-locked.ts b/lib/modules/manager/composer/update-locked.ts index 186f54d80f81a2..9187bfb1ebe2b0 100644 --- a/lib/modules/manager/composer/update-locked.ts +++ b/lib/modules/manager/composer/update-locked.ts @@ -12,7 +12,6 @@ export function updateLockedDependency( `composer.updateLockedDependency: ${depName}@${currentVersion} -> ${newVersion} [${lockFile}]` ); try { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion const locked = JSON.parse(lockFileContent!) as ComposerLock; if ( locked.packages?.find( diff --git a/lib/modules/manager/composer/utils.ts b/lib/modules/manager/composer/utils.ts index 6787845ebf650d..92c5eecf26ec49 100644 --- a/lib/modules/manager/composer/utils.ts +++ b/lib/modules/manager/composer/utils.ts @@ -18,10 +18,8 @@ export function getComposerArguments( if (config.composerIgnorePlatformReqs) { if (config.composerIgnorePlatformReqs.length === 0) { - // TODO: toolConstraint.constraint can be null or undefined? - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO: toolConstraint.constraint can be null or undefined? (#7154) const major = api.getMajor(toolConstraint.constraint!); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion const minor = api.getMinor(toolConstraint.constraint!); args += api.matches(`${major}.${minor}`, '^2.2') ? " --ignore-platform-req='ext-*' --ignore-platform-req='lib-*'" diff --git a/lib/modules/manager/flux/extract.ts b/lib/modules/manager/flux/extract.ts index 52f0ec7eb3e3d1..8d07678ece319c 100644 --- a/lib/modules/manager/flux/extract.ts +++ b/lib/modules/manager/flux/extract.ts @@ -141,7 +141,6 @@ export async function extractAllPackageFiles( for (const file of packageFiles) { const content = await readLocalFile(file, 'utf8'); // TODO #7154 - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion const manifest = readManifest(content!, file); if (manifest) { manifests.push(manifest); diff --git a/lib/modules/manager/git-submodules/artifacts.ts b/lib/modules/manager/git-submodules/artifacts.ts index 1a85a0b97ed484..f77865f0c4d928 100644 --- a/lib/modules/manager/git-submodules/artifacts.ts +++ b/lib/modules/manager/git-submodules/artifacts.ts @@ -6,9 +6,8 @@ export default function updateArtifacts({ }: UpdateArtifact): UpdateArtifactsResult[] | null { const res: UpdateArtifactsResult[] = []; updatedDeps.forEach((dep) => { - logger.info('Updating submodule ' + dep.depName); + logger.info(`Updating submodule ${dep.depName}`); res.push({ - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion file: { type: 'addition', path: dep.depName!, contents: '' }, }); }); diff --git a/lib/modules/manager/git-submodules/update.ts b/lib/modules/manager/git-submodules/update.ts index 6639a01f7ace1f..613cc6c1186c18 100644 --- a/lib/modules/manager/git-submodules/update.ts +++ b/lib/modules/manager/git-submodules/update.ts @@ -13,9 +13,7 @@ export default async function updateDependency({ const submoduleGit = Git(upath.join(localDir, upgrade.depName)); try { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion await git.submoduleUpdate(['--init', upgrade.depName!]); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion await submoduleGit.checkout([upgrade.newDigest!]); return fileContent; } catch (err) { diff --git a/lib/modules/manager/gitlabci/extract.spec.ts b/lib/modules/manager/gitlabci/extract.spec.ts index fb66a99062ed8d..a45d88a1aa2ab9 100644 --- a/lib/modules/manager/gitlabci/extract.spec.ts +++ b/lib/modules/manager/gitlabci/extract.spec.ts @@ -87,7 +87,6 @@ describe('modules/manager/gitlabci/extract', () => { expect(deps).toHaveLength(8); // TODO #7154 - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion expect(deps.some((dep) => dep.currentValue!.includes("'"))).toBeFalse(); }); diff --git a/lib/modules/manager/gitlabci/utils.ts b/lib/modules/manager/gitlabci/utils.ts index 39b30691354692..40f33bf47bc6f0 100644 --- a/lib/modules/manager/gitlabci/utils.ts +++ b/lib/modules/manager/gitlabci/utils.ts @@ -28,8 +28,8 @@ export function getGitlabDep(imageName: string): PackageDependency { const match = depProxyRe.exec(imageName); if (match?.groups) { const dep = { ...getDep(match.groups.depName), replaceString: imageName }; - dep.autoReplaceStringTemplate = - match.groups.prefix + dep.autoReplaceStringTemplate; + // TODO: #7154 + dep.autoReplaceStringTemplate = `${match.groups.prefix}${dep.autoReplaceStringTemplate}`; return dep; } else { return getDep(imageName); diff --git a/lib/modules/manager/gomod/artifacts.ts b/lib/modules/manager/gomod/artifacts.ts index 2b6dc742b65e1f..4b41ccfabafe2f 100644 --- a/lib/modules/manager/gomod/artifacts.ts +++ b/lib/modules/manager/gomod/artifacts.ts @@ -69,7 +69,6 @@ function getGitEnvironmentVariables(): NodeJS.ProcessEnv { `Adding Git authentication for Go Module retrieval for ${httpUrl} using token auth.` ); environmentVariables = getGitAuthenticatedEnvironmentVariables( - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion httpUrl!, hostRule, environmentVariables @@ -89,7 +88,6 @@ function getUpdateImportPathCmds( { constraints, newMajor }: UpdateArtifactsConfig ): string[] { const updateImportCommands = updatedDeps - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion .map((dep) => dep.depName!) .filter((x) => !x.startsWith('gopkg.in')) .map((depName) => `mod upgrade --mod-name=${depName} -t=${newMajor}`); @@ -246,7 +244,6 @@ export async function updateArtifacts({ const isImportPathUpdateRequired = config.postUpdateOptions?.includes('gomodUpdateImportPaths') && config.updateType === 'major' && - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion config.newMajor! > 1; if (isImportPathUpdateRequired) { const updateImportCmds = getUpdateImportPathCmds(updatedDeps, config); diff --git a/lib/modules/manager/gomod/extract.ts b/lib/modules/manager/gomod/extract.ts index 97f78f62c402f9..8d91306a1d0246 100644 --- a/lib/modules/manager/gomod/extract.ts +++ b/lib/modules/manager/gomod/extract.ts @@ -71,7 +71,6 @@ export function extractPackageFile(content: string): PackageFile | null { if (multiMatch && !line.endsWith('// indirect')) { logger.trace({ lineNumber }, `require line: "${line}"`); const dep = getDep(lineNumber, multiMatch, 'require'); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion dep.managerData!.multiLine = true; deps.push(dep); } else if (line.trim() !== ')') { diff --git a/lib/modules/manager/gomod/update.spec.ts b/lib/modules/manager/gomod/update.spec.ts index fcb98a41470ca5..63e2d1fe34f63b 100644 --- a/lib/modules/manager/gomod/update.spec.ts +++ b/lib/modules/manager/gomod/update.spec.ts @@ -40,7 +40,6 @@ describe('modules/manager/gomod/update', () => { depType: 'require', }; const res2 = updateDependency({ - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion fileContent: res1!, upgrade: upgrade2, }); diff --git a/lib/modules/manager/gomod/update.ts b/lib/modules/manager/gomod/update.ts index e6eb87ed572fe1..693cd45d4bd6ca 100644 --- a/lib/modules/manager/gomod/update.ts +++ b/lib/modules/manager/gomod/update.ts @@ -58,10 +58,8 @@ export function updateDependency({ } let newLine: string; if (upgrade.updateType === 'digest') { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion const newDigestRightSized = upgrade.newDigest!.substring( 0, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion upgrade.currentDigest!.length ); if (lineToChange.includes(newDigestRightSized)) { @@ -72,15 +70,13 @@ export function updateDependency({ 'gomod: need to update digest' ); newLine = lineToChange.replace( - // TODO: can be undefined? - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO: can be undefined? (#7154) updateLineExp!, `$$${newDigestRightSized}` ); } else { newLine = lineToChange.replace( - // TODO: can be undefined? - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO: can be undefined? (#7154) updateLineExp!, `$$${upgrade.newValue}` ); @@ -96,7 +92,6 @@ export function updateDependency({ 'rethinkdb/rethinkdb-go.v5' ); } else if ( - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion upgrade.newMajor! > 1 && !newLine.includes(`/v${upgrade.newMajor}`) ) { @@ -105,7 +100,6 @@ export function updateDependency({ newLine = newLine.replace(depName, `${depName}/v${upgrade.newMajor}`); } else { // Replace version - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion const [oldV] = upgrade.currentValue!.split('.'); newLine = newLine.replace( regEx(`/${oldV}(\\s+)`, undefined, false), @@ -117,7 +111,6 @@ export function updateDependency({ if (lineToChange.endsWith('+incompatible')) { let toAdd = '+incompatible'; - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion if (upgrade.updateType === 'major' && upgrade.newMajor! >= 2) { toAdd = ''; } diff --git a/lib/modules/manager/gradle-wrapper/artifacts-real.spec.ts b/lib/modules/manager/gradle-wrapper/artifacts-real.spec.ts index 7f065643807a3a..f99fa0851f3e15 100644 --- a/lib/modules/manager/gradle-wrapper/artifacts-real.spec.ts +++ b/lib/modules/manager/gradle-wrapper/artifacts-real.spec.ts @@ -247,7 +247,6 @@ describe('modules/manager/gradle-wrapper/artifacts-real', () => { expect( await readString( // TODO #7154 - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion adminConfig.localDir!, `gradle/wrapper/gradle-wrapper.properties` ) diff --git a/lib/modules/manager/gradle-wrapper/artifacts.ts b/lib/modules/manager/gradle-wrapper/artifacts.ts index 3fba527ee385ec..d3da5a3d55dcd3 100644 --- a/lib/modules/manager/gradle-wrapper/artifacts.ts +++ b/lib/modules/manager/gradle-wrapper/artifacts.ts @@ -68,7 +68,6 @@ export async function updateArtifacts({ const gradlewPath = upath.resolve(projectDir, `./${gradlew}`); let cmd = await prepareGradleCommand( gradlew, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion projectDir!, await stat(gradlewPath).catch(() => null), `wrapper` @@ -93,7 +92,6 @@ export async function updateArtifacts({ cmd += ` --gradle-distribution-sha256-sum ${quote(checksum)}`; } } else { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion cmd += ` --gradle-version ${quote(config.newValue!)}`; } logger.debug(`Updating gradle wrapper: "${cmd}"`); @@ -101,7 +99,6 @@ export async function updateArtifacts({ docker: { image: 'java', tagConstraint: - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion config.constraints?.java ?? getJavaContraint(config.currentValue!), tagScheme: getJavaVersioning(), }, diff --git a/lib/modules/manager/gradle/parser.spec.ts b/lib/modules/manager/gradle/parser.spec.ts index e518d26c857188..779d9bf10a0c43 100644 --- a/lib/modules/manager/gradle/parser.spec.ts +++ b/lib/modules/manager/gradle/parser.spec.ts @@ -141,7 +141,6 @@ describe('modules/manager/gradle/parser', () => { const [res] = deps; const idx = content // TODO #7154 - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion .slice(res.managerData!.fileReplacePosition) .indexOf('1.2.3'); expect(idx).toBe(0); @@ -152,7 +151,6 @@ describe('modules/manager/gradle/parser', () => { const { deps } = parseGradle(content, {}, 'build.gradle'); const replacementIndices = deps.map(({ managerData, currentValue }) => // TODO #7154 - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion content.slice(managerData!.fileReplacePosition).indexOf(currentValue!) ); expect(replacementIndices.every((idx) => idx === 0)).toBeTrue(); diff --git a/lib/modules/manager/gradle/parser.ts b/lib/modules/manager/gradle/parser.ts index dd4203223aa96b..cb33ef3c111c9d 100644 --- a/lib/modules/manager/gradle/parser.ts +++ b/lib/modules/manager/gradle/parser.ts @@ -120,7 +120,6 @@ function handleAssignment({ if (dep) { dep.groupName = key; dep.managerData = { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion fileReplacePosition: valToken.offset + dep.depName!.length + 1, packageFile, }; @@ -149,7 +148,6 @@ function processDepString({ const dep = parseDependencyString(token.value); if (dep) { dep.managerData = { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion fileReplacePosition: token.offset + dep.depName!.length + 1, packageFile, }; @@ -309,7 +307,6 @@ function processPredefinedRegistryUrl({ google: GOOGLE_REPO, gradlePluginPortal: GRADLE_PLUGIN_PORTAL_REPO, }[registryName]; - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion return { urls: [registryUrl!] }; } @@ -959,7 +956,6 @@ export function parseProps( ...dep, managerData: { fileReplacePosition: - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion offset + leftPart.length + dep.depName!.length + 1, packageFile, }, diff --git a/lib/modules/manager/gradle/update.ts b/lib/modules/manager/gradle/update.ts index 02629ca4e5c729..3b8cf531eb8605 100644 --- a/lib/modules/manager/gradle/update.ts +++ b/lib/modules/manager/gradle/update.ts @@ -12,7 +12,7 @@ export function updateDependency({ logger.warn('gradle manager does not support replacement updates yet'); return null; } - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO check null (#7154) const offset = managerData!.fileReplacePosition; const leftPart = fileContent.slice(0, offset); const rightPart = fileContent.slice(offset); @@ -24,7 +24,7 @@ export function updateDependency({ return fileContent; } if (version === currentValue || upgrade.groupName) { - return leftPart + newValue + restPart; + return `${leftPart}${newValue}${restPart}`; } logger.debug({ depName, version, currentValue, newValue }, 'Unknown value'); } else { diff --git a/lib/modules/manager/helmv3/extract.ts b/lib/modules/manager/helmv3/extract.ts index 4a6f32a44ac0b3..c525c8a787620e 100644 --- a/lib/modules/manager/helmv3/extract.ts +++ b/lib/modules/manager/helmv3/extract.ts @@ -61,7 +61,6 @@ export async function extractPackageFile( return res; } - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion const repository = resolveAlias(dep.repository, config.registryAliases!); if (!repository) { res.skipReason = 'placeholder-url'; diff --git a/lib/modules/manager/index.spec.ts b/lib/modules/manager/index.spec.ts index 914b2288e082c0..720a49b0e745da 100644 --- a/lib/modules/manager/index.spec.ts +++ b/lib/modules/manager/index.spec.ts @@ -18,7 +18,6 @@ describe('modules/manager/index', () => { it(`has valid supportedDatasources for ${m}`, () => { expect(supportedDatasources).toBeNonEmptyArray(); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion supportedDatasources!.every((d) => { expect(datasources.includes(d)).toBeTrue(); }); diff --git a/lib/modules/manager/jsonnet-bundler/artifacts.ts b/lib/modules/manager/jsonnet-bundler/artifacts.ts index 703347bba2d46f..77551f708ad6b0 100644 --- a/lib/modules/manager/jsonnet-bundler/artifacts.ts +++ b/lib/modules/manager/jsonnet-bundler/artifacts.ts @@ -13,7 +13,6 @@ import type { } from '../types'; function dependencyUrl(dep: PackageDependency): string { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion const url = dep.packageName!; if (dep.managerData?.subdir) { return url.concat('/', dep.managerData.subdir); diff --git a/lib/modules/manager/maven/extract.ts b/lib/modules/manager/maven/extract.ts index 5f80d4bdb2ae12..f7e95756969a94 100644 --- a/lib/modules/manager/maven/extract.ts +++ b/lib/modules/manager/maven/extract.ts @@ -178,15 +178,12 @@ function applyPropsInternal( return substr; }); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion const depName = replaceAll(dep.depName!); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion const registryUrls = dep.registryUrls!.map((url) => replaceAll(url)); let fileReplacePosition = dep.fileReplacePosition; let propSource = dep.propSource; let groupName: string | null = null; - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion const currentValue = dep.currentValue!.replace( regEx(/^\${.*?}$/), (substr) => { @@ -289,7 +286,6 @@ export function extractPackage( } result.deps.forEach((dep) => { if (is.array(dep.registryUrls)) { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion repoUrls.forEach((url) => dep.registryUrls!.push(url)); } }); @@ -297,7 +293,7 @@ export function extractPackage( if (packageFile && project.childNamed('parent')) { const parentPath = - project.valueWithPath('parent.relativePath')?.trim() || '../pom.xml'; + project.valueWithPath('parent.relativePath')?.trim() ?? '../pom.xml'; result.parent = resolveParentFile(packageFile, parentPath); } @@ -370,7 +366,6 @@ export function resolveParents(packages: PackageFile[]): PackageFile[] { const extractedProps: Record = {}; const registryUrls: Record> = {}; packages.forEach((pkg) => { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion const name = pkg.packageFile!; packageFileNames.push(name); extractedPackages[name] = pkg; @@ -386,7 +381,6 @@ export function resolveParents(packages: PackageFile[]): PackageFile[] { const visitedPackages: Set = new Set(); let pkg: PackageFile | null = extractedPackages[name]; while (pkg) { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion propsHierarchy.unshift(pkg.mavenProps!); if (pkg.deps) { @@ -414,7 +408,6 @@ export function resolveParents(packages: PackageFile[]): PackageFile[] { packageFileNames.forEach((name) => { const pkg = extractedPackages[name]; pkg.deps.forEach((rawDep) => { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion const urlsSet = new Set([...rawDep.registryUrls!, ...registryUrls[name]]); rawDep.registryUrls = [...urlsSet]; }); @@ -425,7 +418,7 @@ export function resolveParents(packages: PackageFile[]): PackageFile[] { const pkg = extractedPackages[name]; pkg.deps.forEach((rawDep) => { const dep = applyProps(rawDep, name, extractedProps[name]); - const sourceName = dep.propSource || name; + const sourceName = dep.propSource ?? name; extractedDeps[sourceName].push(dep); }); }); diff --git a/lib/modules/manager/maven/index.spec.ts b/lib/modules/manager/maven/index.spec.ts index f397c0594f4dfc..ecffba19c17f96 100644 --- a/lib/modules/manager/maven/index.spec.ts +++ b/lib/modules/manager/maven/index.spec.ts @@ -1,5 +1,4 @@ // TODO #7154 -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { Fixtures } from '../../../../test/fixtures'; import { fs } from '../../../../test/util'; import type { PackageDependency, PackageFile } from '../types'; diff --git a/lib/modules/manager/maven/update.spec.ts b/lib/modules/manager/maven/update.spec.ts index 247b41d617587c..dbe881f8d9260b 100644 --- a/lib/modules/manager/maven/update.spec.ts +++ b/lib/modules/manager/maven/update.spec.ts @@ -1,5 +1,4 @@ // TODO #7154 -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { XmlDocument } from 'xmldoc'; import { Fixtures } from '../../../../test/fixtures'; import * as pomUpdater from '.'; diff --git a/lib/modules/manager/maven/update.ts b/lib/modules/manager/maven/update.ts index 0134ae9fee7b37..c76169b2cf9d73 100644 --- a/lib/modules/manager/maven/update.ts +++ b/lib/modules/manager/maven/update.ts @@ -24,8 +24,7 @@ export function updateAtPosition( return fileContent; } if (version === currentValue || upgrade.groupName) { - // TODO: validate newValue - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO: validate newValue (#7154) const replacedPart = versionPart.replace(version, newValue!); return leftPart + replacedPart + restPart; } diff --git a/lib/modules/manager/metadata.spec.ts b/lib/modules/manager/metadata.spec.ts index 71a66590d8e9b2..ee0a675dd38414 100644 --- a/lib/modules/manager/metadata.spec.ts +++ b/lib/modules/manager/metadata.spec.ts @@ -16,7 +16,6 @@ describe('modules/manager/metadata', () => { // do nothing } expect(readme).toBeDefined(); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion const lines = readme!.split('\n'); let isCode = false; const res: string[] = []; diff --git a/lib/modules/manager/mix/artifacts.spec.ts b/lib/modules/manager/mix/artifacts.spec.ts index 27f7dd88747aef..69ae7572973a53 100644 --- a/lib/modules/manager/mix/artifacts.spec.ts +++ b/lib/modules/manager/mix/artifacts.spec.ts @@ -132,7 +132,6 @@ describe('modules/manager/mix/artifacts', () => { expect(execSnapshots).toMatchSnapshot(); // TODO #7154 - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion const [updateResult] = result!; expect(updateResult).toEqual({ file: { type: 'addition', path: 'mix.lock', contents: 'New mix.lock' }, diff --git a/lib/modules/manager/npm/extract/locked-versions.ts b/lib/modules/manager/npm/extract/locked-versions.ts index 3c1d9f1cac671f..b8d881027afef6 100644 --- a/lib/modules/manager/npm/extract/locked-versions.ts +++ b/lib/modules/manager/npm/extract/locked-versions.ts @@ -24,14 +24,11 @@ export async function getLockedVersions( if (!isYarn1 && !packageFile.constraints?.yarn) { if (lockfileVersion && lockfileVersion >= 8) { // https://github.com/yarnpkg/berry/commit/9bcd27ae34aee77a567dd104947407532fa179b3 - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion packageFile.constraints!.yarn = '^3.0.0'; } else if (lockfileVersion && lockfileVersion >= 6) { // https://github.com/yarnpkg/berry/commit/f753790380cbda5b55d028ea84b199445129f9ba - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion packageFile.constraints!.yarn = '^2.2.0'; } else { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion packageFile.constraints!.yarn = '^2.0.0'; } } @@ -49,7 +46,7 @@ export async function getLockedVersions( } } } else if (npmLock) { - logger.debug('Found ' + npmLock + ' for ' + packageFile.packageFile); + logger.debug(`Found ${npmLock} for ${packageFile.packageFile}`); lockFiles.push(npmLock); if (!lockFileCache[npmLock]) { logger.trace('Retrieving/parsing ' + npmLock); @@ -63,13 +60,11 @@ export async function getLockedVersions( packageFile.constraints.npm += ' <7'; } } else { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion packageFile.constraints!.npm = '<7'; } } for (const dep of packageFile.deps) { dep.lockedVersion = semver.valid( - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion lockFileCache[npmLock].lockedVersions[dep.depName!] ); } diff --git a/lib/modules/manager/npm/extract/monorepo.ts b/lib/modules/manager/npm/extract/monorepo.ts index 31581102b35876..fd4b497299056c 100644 --- a/lib/modules/manager/npm/extract/monorepo.ts +++ b/lib/modules/manager/npm/extract/monorepo.ts @@ -24,16 +24,13 @@ export async function detectMonorepos( } = p; const { lernaJsonFile, yarnZeroInstall, hasPackageManager } = managerData; - const packages = yarnWorkspacesPackages || lernaPackages; + const packages = yarnWorkspacesPackages ?? lernaPackages; if (packages?.length) { const internalPackagePatterns = ( is.array(packages) ? packages : [packages] - ) - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion - .map((pattern) => getSiblingFileName(packageFile!, pattern)); + ).map((pattern) => getSiblingFileName(packageFile!, pattern)); const internalPackageFiles = packageFiles.filter((sp) => matchesAnyPattern( - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion getSubDirectory(sp.packageFile!), internalPackagePatterns ) @@ -49,17 +46,17 @@ export async function detectMonorepos( }); for (const subPackage of internalPackageFiles) { - subPackage.managerData = subPackage.managerData || {}; + subPackage.managerData = subPackage.managerData ?? {}; subPackage.managerData.lernaJsonFile = lernaJsonFile; subPackage.managerData.yarnZeroInstall = yarnZeroInstall; subPackage.managerData.hasPackageManager = hasPackageManager; subPackage.lernaClient = lernaClient; - subPackage.yarnLock = subPackage.yarnLock || yarnLock; - subPackage.npmLock = subPackage.npmLock || npmLock; + subPackage.yarnLock = subPackage.yarnLock ?? yarnLock; + subPackage.npmLock = subPackage.npmLock ?? npmLock; subPackage.skipInstalls = skipInstalls && subPackage.skipInstalls; // skip if both are true if (subPackage.yarnLock) { subPackage.hasYarnWorkspaces = !!yarnWorkspacesPackages; - subPackage.npmrc = subPackage.npmrc || npmrc; + subPackage.npmrc = subPackage.npmrc ?? npmrc; } if (p.constraints) { diff --git a/lib/modules/manager/npm/extract/pnpm.ts b/lib/modules/manager/npm/extract/pnpm.ts index 844c405bb3eacb..99da51e7eb8850 100644 --- a/lib/modules/manager/npm/extract/pnpm.ts +++ b/lib/modules/manager/npm/extract/pnpm.ts @@ -92,7 +92,7 @@ export async function detectPnpmWorkspaces( } // search for corresponding pnpm workspace - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 const pnpmWorkspace = await findPnpmWorkspace(packageFile!); if (pnpmWorkspace === null) { continue; @@ -115,7 +115,6 @@ export async function detectPnpmWorkspaces( const packagePaths = packagePathCache.get(workspaceYamlPath); const isPackageInWorkspace = packagePaths?.some((p) => - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion p.endsWith(packageFile!) ); diff --git a/lib/modules/manager/npm/post-update/index.ts b/lib/modules/manager/npm/post-update/index.ts index 51db6b2a29bb44..dbda105ca35218 100644 --- a/lib/modules/manager/npm/post-update/index.ts +++ b/lib/modules/manager/npm/post-update/index.ts @@ -84,7 +84,7 @@ export function determineLockFileDirs( function getPackageFile(fileName: string): Partial { logger.trace('Looking for packageFile: ' + fileName); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + for (const packageFile of packageFiles.npm!) { if (packageFile.packageFile === fileName) { logger.trace({ packageFile }, 'Found packageFile'); @@ -95,7 +95,7 @@ export function determineLockFileDirs( return {}; } - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 for (const p of config.updatedPackageFiles!) { logger.trace(`Checking ${String(p.path)} for lock files`); const packageFile = getPackageFile(p.path); @@ -138,9 +138,8 @@ export async function writeExistingFiles( 'Writing package.json files' ); for (const packageFile of npmFiles) { - const basedir = - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion - upath.dirname(packageFile.packageFile!); + // TODO #7154 + const basedir = upath.dirname(packageFile.packageFile!); const npmrc: string = packageFile.npmrc ?? config.npmrc; const npmrcFilename = upath.join(basedir, '.npmrc'); if (is.string(npmrc)) { @@ -182,7 +181,7 @@ export async function writeExistingFiles( upgrade.rangeStrategy === 'widen' && upgrade.npmLock === npmLock ) { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 widens.push(upgrade.depName!); } const { depName } = upgrade; @@ -209,7 +208,7 @@ export async function writeExistingFiles( npmLockParsed.dependencies ) { widens.forEach((depName) => { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 delete npmLockParsed.dependencies![depName]; }); } @@ -258,7 +257,7 @@ export async function writeUpdatedPackageFiles( ) { logger.debug(`Writing lock file: ${packageFile.path}`); // TODO #7154 - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + await writeLocalFile(packageFile.path, packageFile.contents!); continue; } @@ -268,11 +267,11 @@ export async function writeUpdatedPackageFiles( logger.debug(`Writing ${packageFile.path}`); const detectedIndent = // TODO #7154 - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + detectIndent(packageFile.contents!.toString()).indent || ' '; // TODO #7154 - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + const massagedFile = JSON.parse(packageFile.contents!.toString()); try { const { token } = hostRules.find({ @@ -282,12 +281,10 @@ export async function writeUpdatedPackageFiles( for (const upgrade of config.upgrades) { // istanbul ignore if: test me if (upgrade.gitRef && upgrade.packageFile === packageFile.path) { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion massagedFile[upgrade.depType as NpmDepType][upgrade.depName!] = - massagedFile[ - upgrade.depType as NpmDepType - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion - ][upgrade.depName!].replace( + massagedFile[upgrade.depType as NpmDepType][ + upgrade.depName! + ].replace( 'git+https://github.com', `git+https://${token}@github.com` ); @@ -574,8 +571,8 @@ export async function getAdditionalFiles( updatedArtifacts.push({ type: 'addition', path: npmLock, - // TODO: can this be undefined? - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO: can this be undefined? (#7154) + contents: res.lockFile!.replace(tokenRe, ''), }); } @@ -642,8 +639,7 @@ export async function getAdditionalFiles( } artifactErrors.push({ lockFile: yarnLock, - // TODO #7154 - + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing stderr: res.stderr || res.stdout, }); } else { @@ -658,8 +654,7 @@ export async function getAdditionalFiles( updatedArtifacts.push({ type: 'addition', path: lockFileName, - // - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 contents: res.lockFile!, }); await updateYarnOffline(lockFileDir, updatedArtifacts); @@ -677,7 +672,7 @@ export async function getAdditionalFiles( await resetNpmrcContent(lockFileDir, npmrcContent); // istanbul ignore if: needs test if (existingYarnrcYmlContent) { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 await writeLocalFile(yarnRcYmlFilename!, existingYarnrcYmlContent); } } @@ -715,7 +710,7 @@ export async function getAdditionalFiles( } artifactErrors.push({ lockFile: pnpmShrinkwrap, - // TODO #7154 + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing stderr: res.stderr || res.stdout, }); } else { @@ -730,8 +725,7 @@ export async function getAdditionalFiles( updatedArtifacts.push({ type: 'addition', path: pnpmShrinkwrap, - // TODO: can be undefined? - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO: can be undefined? (#7154) contents: res.lockFile!, }); } @@ -743,7 +737,7 @@ export async function getAdditionalFiles( let lockFile: string; logger.debug(`Finding package.json for lerna location "${lernaJsonFile}"`); const lernaPackageFile = packageFiles.npm.find( - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 (p) => getSubDirectory(p.packageFile!) === getSubDirectory(lernaJsonFile) ); // istanbul ignore if: not sure how to test @@ -824,13 +818,13 @@ export async function getAdditionalFiles( const filename = packageFile.npmLock ?? packageFile.yarnLock; logger.trace(`Checking for ${filename}`); const existingContent = await getFile( - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 filename!, config.reuseExistingBranch ? config.branchName : config.baseBranch ); if (existingContent) { logger.trace('Found lock file'); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 const lockFilePath = filename!; logger.trace('Checking against ' + lockFilePath); try { @@ -850,7 +844,7 @@ export async function getAdditionalFiles( logger.debug('File is updated: ' + lockFilePath); updatedArtifacts.push({ type: 'addition', - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 path: filename!, contents: newContent, }); diff --git a/lib/modules/manager/npm/post-update/lerna.ts b/lib/modules/manager/npm/post-update/lerna.ts index e33388be4f07d5..90db8a57c187b1 100644 --- a/lib/modules/manager/npm/post-update/lerna.ts +++ b/lib/modules/manager/npm/post-update/lerna.ts @@ -22,7 +22,7 @@ export function getLernaVersion( ); return 'latest'; } - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 return lernaDep.currentValue!; } diff --git a/lib/modules/manager/npm/post-update/npm.ts b/lib/modules/manager/npm/post-update/npm.ts index d2c4eaa889e547..a9375269bdacf7 100644 --- a/lib/modules/manager/npm/post-update/npm.ts +++ b/lib/modules/manager/npm/post-update/npm.ts @@ -149,13 +149,9 @@ export async function generateLockFile( const depType = lockUpdate.depType as | 'dependencies' | 'optionalDependencies'; - if ( - lockFileParsed.packages?.['']?.[depType]?.[ - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion - lockUpdate.depName! - ] - ) { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + + // TODO #7154 + if (lockFileParsed.packages?.['']?.[depType]?.[lockUpdate.depName!]) { lockFileParsed.packages[''][depType]![lockUpdate.depName!] = lockUpdate.newValue!; } diff --git a/lib/modules/manager/npm/range.ts b/lib/modules/manager/npm/range.ts index 051f6c736018de..6c676a7472f812 100644 --- a/lib/modules/manager/npm/range.ts +++ b/lib/modules/manager/npm/range.ts @@ -6,7 +6,7 @@ import type { RangeConfig } from '../types'; export function getRangeStrategy(config: RangeConfig): RangeStrategy { const { depType, depName, packageJsonType, currentValue, rangeStrategy } = config; - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 const isComplexRange = parseRange(currentValue!).length > 1; if (rangeStrategy === 'bump' && isComplexRange) { logger.debug( diff --git a/lib/modules/manager/npm/update/dependency/index.spec.ts b/lib/modules/manager/npm/update/dependency/index.spec.ts index e438a6bf15c7b3..01b3b91f04f5bf 100644 --- a/lib/modules/manager/npm/update/dependency/index.spec.ts +++ b/lib/modules/manager/npm/update/dependency/index.spec.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import * as npmUpdater from '../..'; import { Fixtures } from '../../../../../../test/fixtures'; diff --git a/lib/modules/manager/npm/update/dependency/index.ts b/lib/modules/manager/npm/update/dependency/index.ts index 768a0954af4568..70eca55de162f8 100644 --- a/lib/modules/manager/npm/update/dependency/index.ts +++ b/lib/modules/manager/npm/update/dependency/index.ts @@ -47,7 +47,7 @@ function replaceAsString( } else if (depType === 'dependenciesMeta') { if (oldValue !== newValue) { parsedContents.dependenciesMeta = renameObjKey( - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 parsedContents.dependenciesMeta!, oldValue, newValue @@ -117,7 +117,8 @@ export function updateDependency({ logger.debug('Updating package.json git digest'); newValue = upgrade.currentRawValue.replace( upgrade.currentDigest, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 + upgrade.newDigest!.substring(0, upgrade.currentDigest.length) ); } else { @@ -162,7 +163,7 @@ export function updateDependency({ return fileContent; } - /* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ + // TODO #7154 let newFileContent = replaceAsString( parsedContents, fileContent, @@ -218,7 +219,7 @@ export function updateDependency({ 'resolutions', depKey, parsedContents.resolutions[depKey], - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 newValue! ); if (upgrade.newName) { @@ -246,7 +247,7 @@ export function updateDependency({ 'dependenciesMeta', depName, depKey, - depName + '@' + newValue + `${depName}@${newValue}` ); } } diff --git a/lib/modules/manager/npm/update/locked-dependency/index.spec.ts b/lib/modules/manager/npm/update/locked-dependency/index.spec.ts index 89120d9738a6ac..857621abaaf9a0 100644 --- a/lib/modules/manager/npm/update/locked-dependency/index.spec.ts +++ b/lib/modules/manager/npm/update/locked-dependency/index.spec.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { updateLockedDependency } from '../..'; import { Fixtures } from '../../../../../../test/fixtures'; import * as httpMock from '../../../../../../test/http-mock'; diff --git a/lib/modules/manager/npm/update/locked-dependency/package-lock/index.ts b/lib/modules/manager/npm/update/locked-dependency/package-lock/index.ts index 25cabb0d34af42..353641cb6bfd68 100644 --- a/lib/modules/manager/npm/update/locked-dependency/package-lock/index.ts +++ b/lib/modules/manager/npm/update/locked-dependency/package-lock/index.ts @@ -30,13 +30,12 @@ export async function updateLockedDependency( try { let packageJson: PackageJson; let packageLockJson: PackageLockOrEntry; - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 const detectedIndent = detectIndent(lockFileContent!).indent || ' '; let newPackageJsonContent: string | null | undefined; try { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 packageJson = JSON.parse(packageFileContent!); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion packageLockJson = JSON.parse(lockFileContent!); } catch (err) { logger.warn({ err }, 'Failed to parse files'); @@ -46,7 +45,7 @@ export async function updateLockedDependency( const lockedDeps = getLockedDependencies( packageLockJson, depName, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 currentVersion! ); if (lockedDeps.some((dep) => dep.bundled)) { @@ -129,7 +128,7 @@ export async function updateLockedDependency( packageJson, packageLockJson, depName, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 currentVersion!, newVersion ); @@ -203,7 +202,7 @@ export async function updateLockedDependency( newVersion, })!; newPackageJsonContent = updateDependency({ - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 fileContent: packageFileContent!, upgrade: { depName, depType, newValue }, }); @@ -226,7 +225,7 @@ export async function updateLockedDependency( ...config, ...parentUpdate, lockFileContent: newLockFileContent, - packageFileContent: newPackageJsonContent || packageFileContent, + packageFileContent: newPackageJsonContent ?? packageFileContent, }; const parentUpdateResult = await updateLockedDependency( parentUpdateConfig, diff --git a/lib/modules/manager/npm/update/locked-dependency/yarn-lock/index.ts b/lib/modules/manager/npm/update/locked-dependency/yarn-lock/index.ts index 77ec2ac1cc5fa1..da325462afe76a 100644 --- a/lib/modules/manager/npm/update/locked-dependency/yarn-lock/index.ts +++ b/lib/modules/manager/npm/update/locked-dependency/yarn-lock/index.ts @@ -16,7 +16,7 @@ export function updateLockedDependency( ); let yarnLock: YarnLock; try { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 yarnLock = parseSyml(lockFileContent!); } catch (err) { logger.warn({ err }, 'Failed to parse yarn files'); @@ -30,7 +30,7 @@ export function updateLockedDependency( const lockedDeps = getLockedDependencies( yarnLock, depName, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 currentVersion! ); if (!lockedDeps.length) { @@ -67,7 +67,7 @@ export function updateLockedDependency( ); return { status: 'update-failed' }; } - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 let newLockFileContent = lockFileContent!; for (const dependency of updateLockedDeps) { const { depName, constraint, newVersion } = dependency; diff --git a/lib/modules/manager/npm/utils.spec.ts b/lib/modules/manager/npm/utils.spec.ts index e7d8af6ec13169..60c7752659ab07 100644 --- a/lib/modules/manager/npm/utils.spec.ts +++ b/lib/modules/manager/npm/utils.spec.ts @@ -58,7 +58,6 @@ describe('modules/manager/npm/utils', () => { const lockFile = Fixtures.get('lockfile-parsing/package-lock.json'); const { detectedIndent, lockFileParsed } = parseLockFile(lockFile); // TODO #7154 - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion const lockFileComposed = composeLockFile(lockFileParsed!, detectedIndent); expect(lockFileComposed).toBe(lockFile); }); diff --git a/lib/modules/manager/nuget/extract.ts b/lib/modules/manager/nuget/extract.ts index ea4507e79b3793..ec032b7d5a841b 100644 --- a/lib/modules/manager/nuget/extract.ts +++ b/lib/modules/manager/nuget/extract.ts @@ -44,13 +44,13 @@ function extractDepsFromXml(xmlNode: XmlDocument): PackageDependency[] { if (elemNames.has(name)) { const depName = attr?.Include || attr?.Update; const version = - attr?.Version || - child.valueWithPath('Version') || - attr?.VersionOverride || + attr?.Version ?? + child.valueWithPath('Version') ?? + attr?.VersionOverride ?? child.valueWithPath('VersionOverride'); const currentValue = checkVersion - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion - ?.exec(version!) + + ?.exec(version) ?.groups?.currentValue?.trim(); if (depName && currentValue) { results.push({ diff --git a/lib/modules/manager/nuget/package-tree.ts b/lib/modules/manager/nuget/package-tree.ts index e7872f73a0c7fd..1a9537f6a30fe8 100644 --- a/lib/modules/manager/nuget/package-tree.ts +++ b/lib/modules/manager/nuget/package-tree.ts @@ -41,7 +41,6 @@ export async function getDependentPackageFiles( const packageFileContent = await readLocalFile(f, 'utf8'); // TODO #7154 - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion const doc = new xmldoc.XmlDocument(packageFileContent!); const projectReferenceAttributes = doc .childrenNamed('ItemGroup') diff --git a/lib/modules/manager/pip_requirements/extract.ts b/lib/modules/manager/pip_requirements/extract.ts index 34524aee2b1c63..64bb9f01322fa5 100644 --- a/lib/modules/manager/pip_requirements/extract.ts +++ b/lib/modules/manager/pip_requirements/extract.ts @@ -40,7 +40,7 @@ export function cleanRegistryUrls(registryUrls: string[]): string[] { .replace(regEx(/^{/), '') .replace(regEx(/}$/), ''); const sub = process.env[envvar]; - return sub || match; + return sub ?? match; } ); }); @@ -76,7 +76,7 @@ export function extractPackageFile(content: string): PackageFile | null { const [lineNoEnvMarkers] = line.split(';').map((part) => part.trim()); const lineNoHashes = lineNoEnvMarkers.split(' \\')[0]; const packageMatches = - pkgValRegex.exec(lineNoHashes) || pkgRegex.exec(lineNoHashes); + pkgValRegex.exec(lineNoHashes) ?? pkgRegex.exec(lineNoHashes); const gitPackageMatches = packageGitRegex.exec(lineNoHashes); if (!packageMatches && !gitPackageMatches) { return null; @@ -109,7 +109,6 @@ export function extractPackageFile(content: string): PackageFile | null { } // validated above - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion const [, depName, , currVal] = packageMatches!; const currentValue = currVal?.trim(); dep = { diff --git a/lib/modules/manager/pip_setup/extract.ts b/lib/modules/manager/pip_setup/extract.ts index 9e8d5a84d4d977..592226734bd0de 100644 --- a/lib/modules/manager/pip_setup/extract.ts +++ b/lib/modules/manager/pip_setup/extract.ts @@ -36,7 +36,7 @@ function depStringHandler( ): Context { const depStr = token.value; const match = extractRegex.exec(depStr); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 const { depName, currentValue } = match!.groups!; const dep: PackageDependency = { diff --git a/lib/modules/manager/pipenv/extract.ts b/lib/modules/manager/pipenv/extract.ts index 9d963f916a2b34..adeb9039696c78 100644 --- a/lib/modules/manager/pipenv/extract.ts +++ b/lib/modules/manager/pipenv/extract.ts @@ -60,7 +60,6 @@ function extractFromSection( skipReason = 'invalid-name'; } // validated above - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion const specifierMatches = specifierRegex.exec(currentValue!); if (!specifierMatches) { logger.debug( @@ -83,7 +82,7 @@ function extractFromSection( dep.datasource = PypiDatasource.id; } if (nestedVersion) { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 dep.managerData!.nestedVersion = nestedVersion; } if (requirements.index) { @@ -132,15 +131,12 @@ export async function extractPackageFile( const constraints: Record = {}; if (is.nonEmptyString(pipfile.requires?.python_version)) { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion constraints.python = `== ${pipfile.requires!.python_version}.*`; } else if (is.nonEmptyString(pipfile.requires?.python_full_version)) { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion constraints.python = `== ${pipfile.requires!.python_full_version}`; } if (is.nonEmptyString(pipfile.packages?.pipenv)) { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion constraints.pipenv = pipfile.packages!.pipenv; } else if (is.nonEmptyString(pipfile['dev-packages']?.pipenv)) { constraints.pipenv = pipfile['dev-packages']!.pipenv; diff --git a/lib/modules/manager/terraform/lockfile/index.ts b/lib/modules/manager/terraform/lockfile/index.ts index c8765fa7dccde0..f2aee3eab9c2c4 100644 --- a/lib/modules/manager/terraform/lockfile/index.ts +++ b/lib/modules/manager/terraform/lockfile/index.ts @@ -89,7 +89,7 @@ export async function updateArtifacts({ updates.push(...maintenanceUpdates); } else { const providerDeps = updatedDeps.filter((dep) => - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 ['provider', 'required_provider'].includes(dep.depType!) ); for (const dep of providerDeps) { @@ -108,15 +108,13 @@ export async function updateArtifacts({ continue; } const update: ProviderLockUpdate = { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 newVersion: newVersion!, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion newConstraint: newConstraint!, newHashes: (await TerraformProviderHash.createHashes( registryUrl, updateLock.packageName, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion newVersion! )) ?? /* istanbul ignore next: needs test */ [], ...updateLock, diff --git a/lib/modules/manager/terraform/lockfile/util.ts b/lib/modules/manager/terraform/lockfile/util.ts index a19b2aff952f4c..774be9e7284914 100644 --- a/lib/modules/manager/terraform/lockfile/util.ts +++ b/lib/modules/manager/terraform/lockfile/util.ts @@ -139,30 +139,28 @@ export function writeLockUpdates( const sections: string[][] = []; // sort updates in order of appearance in the lockfile - /* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ + // TODO #7154 updates.sort( (a, b) => a.lineNumbers.block!.start - b.lineNumbers.block!.start ); - /* eslint-enable @typescript-eslint/no-unnecessary-type-assertion */ updates.forEach((update, index, array) => { // re add leading whitespace let startWhitespace: number | undefined; if (index > 0) { // get end of the - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 startWhitespace = array[index - 1].lineNumbers.block!.end; } const leadingNonRelevantLines = lines.slice( startWhitespace, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 update.lineNumbers.block!.start ); sections.push(leadingNonRelevantLines); const providerBlockLines = lines.slice( - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 update.lineNumbers.block!.start, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion update.lineNumbers.block!.end ); const newProviderBlockLines: string[] = []; @@ -201,7 +199,7 @@ export function writeLockUpdates( (value) => `${hashLinePrefix}${value}${hashLineSuffix}` ); newProviderBlockLines.splice( - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 update.lineNumbers.hashes.start!, 0, ...hashesWithWhitespace diff --git a/lib/modules/manager/terraform/modules.ts b/lib/modules/manager/terraform/modules.ts index 5be46e462232c9..2e8542463fe8e6 100644 --- a/lib/modules/manager/terraform/modules.ts +++ b/lib/modules/manager/terraform/modules.ts @@ -30,14 +30,14 @@ export function extractTerraformModule( ): ExtractionResult { const result = extractTerraformProvider(startingLine, lines, moduleName); result.dependencies.forEach((dep) => { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 dep.managerData!.terraformDependencyType = TerraformDependencyTypes.module; }); return result; } export function analyseTerraformModule(dep: PackageDependency): void { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 const source = dep.managerData!.source as string; const githubRefMatch = githubRefMatchRegex.exec(source); const bitbucketRefMatch = bitbucketRefMatchRegex.exec(source); diff --git a/lib/modules/manager/terraform/providers.ts b/lib/modules/manager/terraform/providers.ts index 07ec08caaf5d2b..b1251cf77dbce5 100644 --- a/lib/modules/manager/terraform/providers.ts +++ b/lib/modules/manager/terraform/providers.ts @@ -41,8 +41,8 @@ export function extractTerraformProvider( // istanbul ignore else if (is.string(line)) { // `{` will be counted with +1 and `}` with -1. Therefore if we reach braceCounter == 0. We have found the end of the terraform block - const openBrackets = (line.match(regEx(/\{/g)) || []).length; - const closedBrackets = (line.match(regEx(/\}/g)) || []).length; + const openBrackets = (line.match(regEx(/\{/g)) ?? []).length; + const closedBrackets = (line.match(regEx(/\}/g)) ?? []).length; braceCounter = braceCounter + openBrackets - closedBrackets; // only update fields inside the root block @@ -52,9 +52,8 @@ export function extractTerraformProvider( if (kvMatch.groups.key === 'version') { dep.currentValue = kvMatch.groups.value; } else if (kvMatch.groups.key === 'source') { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 dep.managerData!.source = kvMatch.groups.value; - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion dep.managerData!.sourceLine = lineNumber; } } @@ -81,7 +80,7 @@ export function analyzeTerraformProvider( dep.datasource = TerraformProviderDatasource.id; if (is.nonEmptyString(dep.managerData?.source)) { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 const source = sourceExtractionRegex.exec(dep.managerData!.source); if (!source?.groups) { dep.skipReason = 'unsupported-url'; diff --git a/lib/modules/manager/terraform/required-providers.ts b/lib/modules/manager/terraform/required-providers.ts index 1c730c3f6d56ae..537e40b25c1db9 100644 --- a/lib/modules/manager/terraform/required-providers.ts +++ b/lib/modules/manager/terraform/required-providers.ts @@ -22,7 +22,7 @@ function extractBlock( if (kvMatch?.groups) { switch (kvMatch.groups.key) { case 'source': - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 dep.managerData!.source = kvMatch.groups.value; break; @@ -58,14 +58,14 @@ export function extractTerraformRequiredProviders( const kvMatch = keyValueExtractionRegex.exec(line); if (kvMatch?.groups) { dep.currentValue = kvMatch.groups.value; - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 dep.managerData!.moduleName = kvMatch.groups.key; deps.push(dep); } else { const nameMatch = providerBlockExtractionRegex.exec(line); if (nameMatch?.groups) { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 dep.managerData!.moduleName = nameMatch.groups.key; lineNumber = extractBlock(lineNumber, lines, dep); deps.push(dep); diff --git a/lib/modules/manager/terraform/resources.ts b/lib/modules/manager/terraform/resources.ts index c691e940e7fe52..47bb534e292dc1 100644 --- a/lib/modules/manager/terraform/resources.ts +++ b/lib/modules/manager/terraform/resources.ts @@ -75,8 +75,8 @@ export function extractTerraformResource( // istanbul ignore else if (is.string(line)) { // `{` will be counted with +1 and `}` with -1. Therefore if we reach braceCounter == 0. We have found the end of the terraform block - const openBrackets = (line.match(regEx(/\{/g)) || []).length; - const closedBrackets = (line.match(regEx(/\}/g)) || []).length; + const openBrackets = (line.match(regEx(/\{/g)) ?? []).length; + const closedBrackets = (line.match(regEx(/\}/g)) ?? []).length; braceCounter = braceCounter + openBrackets - closedBrackets; const kvMatch = keyValueExtractionRegex.exec(line); @@ -141,7 +141,7 @@ export function analyseTerraformResource( dep.skipReason = 'local-chart'; } dep.depType = 'helm_release'; - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 dep.registryUrls = [dep.managerData.repository!]; dep.depName = dep.managerData.chart; dep.datasource = HelmDatasource.id; diff --git a/lib/modules/manager/terraform/util.ts b/lib/modules/manager/terraform/util.ts index dea1126352164c..4852300c1e6b80 100644 --- a/lib/modules/manager/terraform/util.ts +++ b/lib/modules/manager/terraform/util.ts @@ -53,13 +53,14 @@ export function massageProviderLookupName(dep: PackageDependency): void { if (!dep.packageName) { dep.packageName = dep.depName; } - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + + // TODO #7154 if (!dep.packageName!.includes('/')) { dep.packageName = `hashicorp/${dep.packageName}`; } // handle cases like `Telmate/proxmox` - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 dep.packageName = dep.packageName!.toLowerCase(); } diff --git a/lib/modules/manager/terragrunt/extract.ts b/lib/modules/manager/terragrunt/extract.ts index 929bec4d319912..f9a06462d93b25 100644 --- a/lib/modules/manager/terragrunt/extract.ts +++ b/lib/modules/manager/terragrunt/extract.ts @@ -54,7 +54,7 @@ export function extractPackageFile(content: string): PackageFile | null { logger.warn({ err }, 'Error extracting terragrunt plugins'); } deps.forEach((dep) => { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 switch (dep.managerData!.terragruntDependencyType) { case TerragruntDependencyTypes.terragrunt: analyseTerragruntModule(dep); diff --git a/lib/modules/manager/terragrunt/modules.ts b/lib/modules/manager/terragrunt/modules.ts index 16ea8f6a26689e..877b2c050c183c 100644 --- a/lib/modules/manager/terragrunt/modules.ts +++ b/lib/modules/manager/terragrunt/modules.ts @@ -23,7 +23,7 @@ export function extractTerragruntModule( const moduleName = 'terragrunt'; const result = extractTerragruntProvider(startingLine, lines, moduleName); result.dependencies.forEach((dep) => { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 dep.managerData!.terragruntDependencyType = TerragruntDependencyTypes.terragrunt; }); @@ -33,7 +33,7 @@ export function extractTerragruntModule( export function analyseTerragruntModule( dep: PackageDependency ): void { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 const source = dep.managerData!.source; const githubRefMatch = githubRefMatchRegex.exec(source ?? ''); const gitTagsRefMatch = gitTagsRefMatchRegex.exec(source ?? ''); diff --git a/lib/modules/platform/azure/azure-got-wrapper.ts b/lib/modules/platform/azure/azure-got-wrapper.ts index aaa337a718b832..408ef5d36504fa 100644 --- a/lib/modules/platform/azure/azure-got-wrapper.ts +++ b/lib/modules/platform/azure/azure-got-wrapper.ts @@ -15,8 +15,7 @@ function getAuthenticationHandler(config: HostRule): IRequestHandler { if (!config.token && config.username && config.password) { return getBasicHandler(config.username, config.password, true); } - // TODO: token can be undefined here - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO: token can be undefined here (#7154) return getHandlerFromToken(config.token!, true); } diff --git a/lib/modules/platform/azure/azure-helper.ts b/lib/modules/platform/azure/azure-helper.ts index 7d132d8afbb628..0b22aebfb99a32 100644 --- a/lib/modules/platform/azure/azure-helper.ts +++ b/lib/modules/platform/azure/azure-helper.ts @@ -49,9 +49,8 @@ export async function getAzureBranchObj( }; } return { - // TODO: fix undefined + // TODO: fix undefined (#7154) name: getNewBranchName(branchName)!, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion oldObjectId: refs[0].objectId!, }; } @@ -134,10 +133,10 @@ export async function getMergeMethod( if (!branchRef) { return true; } + // TODO #7154 return scope.matchKind === 'Exact' ? scope.refName === branchRef - : // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion - branchRef.startsWith(scope.refName!); + : branchRef.startsWith(scope.refName!); }; const policyConfigurations = ( diff --git a/lib/modules/platform/azure/index.ts b/lib/modules/platform/azure/index.ts index 8296d495cf7bf7..788ad4fea7671e 100644 --- a/lib/modules/platform/azure/index.ts +++ b/lib/modules/platform/azure/index.ts @@ -137,7 +137,7 @@ export async function getRawFile( } as GitVersionDescriptor; const buf = await azureApiGit.getItemContent( - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 repoId!, fileName, undefined, @@ -159,7 +159,7 @@ export async function getJsonFile( branchOrTag?: string ): Promise { const raw = await getRawFile(fileName, repoName, branchOrTag); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 return JSON5.parse(raw!); } @@ -186,8 +186,9 @@ export async function initRepo({ logger.debug('Repo is empty'); throw new Error(REPOSITORY_EMPTY); } + // TODO #7154 config.repoId = repo.id!; - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + config.project = repo.project!.name!; config.owner = '?owner?'; logger.debug(`${repository} owner = ${config.owner}`); @@ -196,7 +197,7 @@ export async function initRepo({ logger.debug(`${repository} default branch = ${defaultBranch}`); const names = getProjectAndRepo(repository); config.defaultMergeMethod = await azureHelper.getMergeMethod( - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 repo.id!, names.project, null, @@ -210,10 +211,10 @@ export async function initRepo({ hostType: defaults.hostType, url: defaults.endpoint, }); - const manualUrl = - defaults.endpoint + - `${encodeURIComponent(projectName)}/_git/${encodeURIComponent(repoName)}`; - const url = repo.remoteUrl || manualUrl; + const manualUrl = `${defaults.endpoint}${encodeURIComponent( + projectName + )}/_git/${encodeURIComponent(repoName)}`; + const url = repo.remoteUrl ?? manualUrl; await git.initRepo({ ...config, url, @@ -335,12 +336,12 @@ async function getStatusCheck(branchName: string): Promise { const branch = await azureApiGit.getBranch( config.repoId, - // TODO: fix undefined + // TODO: fix undefined (#7154) getBranchNameWithoutRefsheadsPrefix(branchName)! ); // only grab the latest statuses, it will group any by context return azureApiGit.getStatuses( - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 branch.commit!.commitId!, config.repoId, undefined, @@ -366,7 +367,7 @@ export async function getBranchStatusCheck( const res = await getStatusCheck(branchName); for (const check of res) { if (getGitStatusContextCombinedName(check.context) === context) { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 return azureToRenovateStatusMapping[check.state!] ?? BranchStatus.yellow; } } @@ -435,7 +436,7 @@ export async function createPr({ pr = await azureApiGit.updatePullRequest( { autoCompleteSetBy: { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 id: pr.createdBy!.id, }, completionOptions: { @@ -445,35 +446,32 @@ export async function createPr({ }, }, config.repoId, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 pr.pullRequestId! ); } if (platformOptions?.azureAutoApprove) { await azureApiGit.createPullRequestReviewer( { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion reviewerUrl: pr.createdBy!.url, vote: AzurePrVote.Approved, isFlagged: false, isRequired: false, }, config.repoId, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 pr.pullRequestId!, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion pr.createdBy!.id! ); } await Promise.all( - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion labels!.map((label) => azureApiGit.createPullRequestLabel( { name: label, }, config.repoId, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 pr.pullRequestId! ) ) @@ -558,7 +556,7 @@ export async function ensureComment({ config.repoId, number, threadIdFound, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 commentIdFound! ); logger.debug( @@ -647,7 +645,7 @@ export async function setBranchStatus({ }; await azureApiGit.createCommitStatus( statusToCreate, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 branch.commit!.commitId!, config.repoId ); @@ -663,10 +661,9 @@ export async function mergePr({ let pr = await azureApiGit.getPullRequestById(pullRequestId, config.project); + // TODO #7154 const mergeMethod = - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion config.mergeMethods[pr.targetRefName!] ?? - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion (config.mergeMethods[pr.targetRefName!] = await azureHelper.getMergeMethod( config.repoId, config.project, @@ -721,7 +718,7 @@ export async function mergePr({ { pullRequestId, status: pr.status }, `Expected PR to have status ${ PullRequestStatus[PullRequestStatus.Completed] - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 }, however it is ${PullRequestStatus[pr.status!]}.` ); } @@ -771,15 +768,15 @@ async function getUserIds(users: string[]): Promise { const azureApiCore = await azureApi.coreApi(); const repos = await azureApiGit.getRepositories(); const repo = repos.filter((c) => c.id === config.repoId)[0]; - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + + // TODO #7154 const teams = await azureApiCore.getTeams(repo.project!.id!); const members = await Promise.all( teams.map( async (t) => await azureApiCore.getTeamMembersWithExtendedProperties( - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 repo.project!.id!, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion t.id! ) ) @@ -794,7 +791,7 @@ async function getUserIds(users: string[]): Promise { r.toLowerCase() === m.identity?.uniqueName?.toLowerCase() ) { if (ids.filter((c) => c.id === m.identity?.id).length === 0) { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 ids.push({ id: m.identity.id!, name: r }); } } @@ -806,7 +803,7 @@ async function getUserIds(users: string[]): Promise { users.forEach((r) => { if (r.toLowerCase() === t.name?.toLowerCase()) { if (ids.filter((c) => c.id === t.id).length === 0) { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 ids.push({ id: t.id!, name: r }); } } diff --git a/lib/modules/platform/azure/util.ts b/lib/modules/platform/azure/util.ts index 0b7aa652faa983..60fe471cf914fa 100644 --- a/lib/modules/platform/azure/util.ts +++ b/lib/modules/platform/azure/util.ts @@ -101,7 +101,8 @@ export function getRenovatePRFormat(azurePr: GitPullRequest): AzurePr { const bodyStruct = getPrBodyStruct(azurePr.description); const createdAt = azurePr.creationDate?.toISOString(); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + + // TODO #7154 const state = stateMap[azurePr.status!] ?? PrState.Open; const sourceRefName = azurePr.sourceRefName; @@ -183,6 +184,6 @@ export function getRepoByName( (r) => project === r?.project?.name?.toLowerCase() && repo === r?.name?.toLowerCase() - ) || null + ) ?? null ); } diff --git a/lib/modules/platform/bitbucket-server/index.ts b/lib/modules/platform/bitbucket-server/index.ts index ef6725ea853f57..212f01a481bcb1 100644 --- a/lib/modules/platform/bitbucket-server/index.ts +++ b/lib/modules/platform/bitbucket-server/index.ts @@ -144,7 +144,7 @@ export async function getJsonFile( repoName?: string, branchOrTag?: string ): Promise { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 const raw = (await getRawFile(fileName, repoName, branchOrTag)) as string; return JSON5.parse(raw); } @@ -191,7 +191,7 @@ export async function initRepo({ const gitUrl = utils.getRepoGitUrl( config.repositorySlug, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 defaults.endpoint!, info, opts @@ -263,7 +263,7 @@ export async function getPr( reviewers: res.body.reviewers.map((r) => r.user.name), }; pr.hasReviewers = is.nonEmptyArray(pr.reviewers); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 pr.version = updatePrVersion(pr.number, pr.version!); return pr; @@ -464,7 +464,7 @@ export async function setBranchStatus({ const body: any = { key: context, description, - url: targetUrl || 'https://renovatebot.com', + url: targetUrl ?? 'https://renovatebot.com', }; switch (state) { @@ -563,8 +563,7 @@ export async function addReviewers( throw new Error(REPOSITORY_NOT_FOUND); } - // TODO: can `reviewers` be undefined? - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO: can `reviewers` be undefined? (#7154) const reviewersSet = new Set([...pr.reviewers!, ...reviewers]); await bitbucketServerHttp.putJson( @@ -835,7 +834,7 @@ export async function createPr({ ...utils.prInfo(prInfoRes.body), }; - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 updatePrVersion(pr.number, pr.version!); // istanbul ignore if @@ -886,10 +885,10 @@ export async function updatePr({ updatePrVersion(prNo, updatedPr.version); const currentState = updatedPr.state; + // TODO #7154 const newState = { [PrState.Open]: 'OPEN', [PrState.Closed]: 'DECLINED', - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion }[state!]; if ( diff --git a/lib/modules/platform/bitbucket-server/utils.ts b/lib/modules/platform/bitbucket-server/utils.ts index 5f8f88f2d49d80..4031166e97b38a 100644 --- a/lib/modules/platform/bitbucket-server/utils.ts +++ b/lib/modules/platform/bitbucket-server/utils.ts @@ -172,11 +172,11 @@ export function getRepoGitUrl( if (!cloneUrl) { // Fallback to generating the url if the API didn't give us an URL const { host, pathname } = url.parse(defaultEndpoint); + // TODO #7154 gitUrl = git.getUrl({ protocol: defaultEndpoint.split(':')[0] as GitProtocol, auth: `${opts.username}:${opts.password}`, host: `${host}${pathname}${ - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion pathname!.endsWith('/') ? '' : /* istanbul ignore next */ '/' }scm`, repository, diff --git a/lib/modules/platform/bitbucket/index.ts b/lib/modules/platform/bitbucket/index.ts index 15a098988cf0f3..48962df1563440 100644 --- a/lib/modules/platform/bitbucket/index.ts +++ b/lib/modules/platform/bitbucket/index.ts @@ -89,7 +89,7 @@ export async function initPlatform({ } // TODO: Add a connection check that endpoint/username/password combination are valid (#9594) const platformConfig: PlatformResult = { - endpoint: endpoint || BITBUCKET_PROD_ENDPOINT, + endpoint: endpoint ?? BITBUCKET_PROD_ENDPOINT, }; return Promise.resolve(platformConfig); } @@ -125,7 +125,7 @@ export async function getRawFile( const url = `/2.0/repositories/${repo}/src/` + - (finalBranchOrTag || `HEAD`) + + (finalBranchOrTag ?? `HEAD`) + `/${path}`; const res = await bitbucketHttp.get(url); return res.body; @@ -136,7 +136,7 @@ export async function getJsonFile( repoName?: string, branchOrTag?: string ): Promise { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 const raw = (await getRawFile(fileName, repoName, branchOrTag)) as string; return JSON5.parse(raw); } @@ -189,7 +189,7 @@ export async function initRepo({ // Converts API hostnames to their respective HTTP git hosts: // `api.bitbucket.org` to `bitbucket.org` // `api-staging.` to `staging.` - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 const hostnameWithoutApiPrefix = regEx(/api[.|-](.+)/).exec(hostname!)?.[1]; const url = git.getUrl({ @@ -374,7 +374,7 @@ export async function getBranchStatusCheck( ): Promise { const statuses = await getStatus(branchName); const bbState = statuses.find((status) => status.key === context)?.state; - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 return bbToRenovateStatusMapping[bbState!] || null; } @@ -388,7 +388,7 @@ export async function setBranchStatus({ const sha = await getBranchCommit(branchName); // TargetUrl can not be empty so default to bitbucket - const url = targetUrl || /* istanbul ignore next */ 'https://bitbucket.org'; + const url = targetUrl ?? /* istanbul ignore next */ 'https://bitbucket.org'; const body = { name: context, @@ -595,8 +595,8 @@ export async function addReviewers( ): Promise { logger.debug(`Adding reviewers '${reviewers.join(', ')}' to #${prId}`); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion - const { title } = (await getPr(prId)) as Pr; + // TODO #7154 + const { title } = (await getPr(prId))!; const body = { title, diff --git a/lib/modules/platform/gitea/index.ts b/lib/modules/platform/gitea/index.ts index 97e437db5eb3b7..5a98cf8cafda00 100644 --- a/lib/modules/platform/gitea/index.ts +++ b/lib/modules/platform/gitea/index.ts @@ -68,6 +68,7 @@ function toRenovateIssue(data: helper.Issue): Issue { }; } +// TODO #7154 function toRenovatePR(data: helper.PR): Pr | null { if (!data) { return null; @@ -104,7 +105,7 @@ function toRenovatePR(data: helper.PR): Pr | null { cannotMergeReason: data.mergeable ? undefined : `pr.mergeable="${data.mergeable}"`, - hasAssignees: !!(data.assignee?.login || is.nonEmptyArray(data.assignees)), + hasAssignees: !!(data.assignee?.login ?? is.nonEmptyArray(data.assignees)), }; } @@ -193,7 +194,7 @@ const platform: Platform = { let gitAuthor: string; try { const user = await helper.getCurrentUser({ token }); - gitAuthor = `${user.full_name || user.username} <${user.email}>`; + gitAuthor = `${user.full_name ?? user.username} <${user.email}>`; botUserID = user.id; botUserName = user.username; defaults.version = await helper.getVersion({ token }); @@ -226,12 +227,8 @@ const platform: Platform = { repoName?: string, branchOrTag?: string ): Promise { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion - const raw = (await platform.getRawFile( - fileName, - repoName, - branchOrTag - )) as string; + // TODO #7154 + const raw = (await platform.getRawFile(fileName, repoName, branchOrTag))!; return JSON5.parse(raw); }, @@ -341,7 +338,7 @@ const platform: Platform = { // Create new status for branch commit const branchCommit = git.getBranchCommit(branchName); // TODO: check branchCommit - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + await helper.createCommitStatus(config.repository, branchCommit!, { state: helper.renovateToGiteaStatusMapping[state] || 'pending', context, @@ -376,7 +373,7 @@ const platform: Platform = { logger.debug({ ccs }, 'Branch status check result'); return ( - helper.giteaToRenovateStatusMapping[ccs.worstStatus] || + helper.giteaToRenovateStatusMapping[ccs.worstStatus] ?? BranchStatus.yellow ); }, @@ -435,7 +432,7 @@ const platform: Platform = { // Add pull request to cache for further lookups / queries if (config.prList !== null) { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 (await config.prList).push(pr!); } } @@ -610,7 +607,7 @@ const platform: Platform = { return null; } logger.debug(`Found Issue #${issue.number}`); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 return getIssue!(issue.number!); }, @@ -660,7 +657,7 @@ const platform: Platform = { for (const issue of issues) { if (issue.state === 'open' && issue.number !== activeIssue.number) { logger.warn(`Closing duplicate Issue #${issue.number}`); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 await helper.closeIssue(config.repository, issue.number!); } } @@ -681,7 +678,7 @@ const platform: Platform = { logger.debug(`Updating Issue #${activeIssue.number}`); const existingIssue = await helper.updateIssue( config.repository, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 activeIssue.number!, { body, @@ -704,7 +701,7 @@ const platform: Platform = { ) { await helper.updateIssueLabels( config.repository, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 activeIssue.number!, { labels, @@ -738,7 +735,7 @@ const platform: Platform = { for (const issue of issueList) { if (issue.state === 'open' && issue.title === title) { logger.debug({ number: issue.number }, 'Closing issue'); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 await helper.closeIssue(config.repository, issue.number!); } } diff --git a/lib/modules/platform/github/index.ts b/lib/modules/platform/github/index.ts index 003d4f3cdf9d22..81f25e24a8b8be 100644 --- a/lib/modules/platform/github/index.ts +++ b/lib/modules/platform/github/index.ts @@ -162,7 +162,7 @@ export async function initPlatform({ logger.debug({ platformConfig, renovateUsername }, 'Platform config'); const platformResult: PlatformResult = { endpoint: platformConfig.endpoint, - gitAuthor: gitAuthor || discoveredGitAuthor, + gitAuthor: gitAuthor ?? discoveredGitAuthor, renovateUsername, }; @@ -230,7 +230,7 @@ export async function getJsonFile( repoName?: string, branchOrTag?: string ): Promise { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 const raw = (await getRawFile(fileName, repoName, branchOrTag)) as string; return JSON5.parse(raw); } @@ -270,10 +270,10 @@ export async function initRepo({ let infoQuery = repoInfoQuery; // GitHub Enterprise Server <3.3.0 doesn't support autoMergeAllowed and hasIssuesEnabled objects + // TODO #7154 if ( platformConfig.isGhe && // semver not null safe, accepts null and undefined - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion semver.satisfies(platformConfig.gheVersion!, '<3.3.0') ) { infoQuery = infoQuery.replace(/\n\s*autoMergeAllowed\s*\n/, '\n'); @@ -376,7 +376,7 @@ export async function initRepo({ await githubApi.getJson<{ full_name: string }[]>( 'user/repos?per_page=100', { - token: forkToken || opts.token, + token: forkToken ?? opts.token, paginate: true, pageLimit: 100, } @@ -387,7 +387,7 @@ export async function initRepo({ full_name: string; default_branch: string; }>(`repos/${repository}/forks`, { - token: forkToken || opts.token, + token: forkToken ?? opts.token, }); config.repository = forkedRepo.body.full_name; const forkDefaultBranch = forkedRepo.body.default_branch; @@ -460,7 +460,7 @@ export async function initRepo({ sha, force: true, }, - token: forkToken || opts.token, + token: forkToken ?? opts.token, }); } catch (err) /* istanbul ignore next */ { logger.warn( @@ -492,13 +492,12 @@ export async function initRepo({ logger.debug(`Using ${tokenType} token for git init`); parsedEndpoint.auth = opts.token ?? null; } - // TODO: null checks #7154 - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO: null checks (#7154) parsedEndpoint.host = parsedEndpoint.host!.replace( 'api.github.com', 'github.com' ); - parsedEndpoint.pathname = config.repository + '.git'; + parsedEndpoint.pathname = `${config.repository}.git`; const url = URL.format(parsedEndpoint); await git.initRepo({ ...config, @@ -576,7 +575,7 @@ function cachePr(pr?: Pr | null): void { // Fetch fresh Pull Request and cache it when possible async function fetchPr(prNo: number): Promise { const { body: ghRestPr } = await githubApi.getJson( - `repos/${config.parentRepo || config.repository}/pulls/${prNo}` + `repos/${config.parentRepo ?? config.repository}/pulls/${prNo}` ); const result = coerceRestPr(ghRestPr); cachePr(result); @@ -614,8 +613,7 @@ export async function getPrList(): Promise { !config.forkMode && !config.ignorePrAuthor && config.renovateUsername ? config.renovateUsername : null; - // TODO: check null `repo` #7154 - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO: check null `repo` (#7154) const prCache = await getPrCache(githubApi, repo!, username); config.prList = Object.values(prCache); } @@ -948,7 +946,7 @@ export async function getIssue( try { const issueBody = ( await githubApi.getJson<{ body: string }>( - `repos/${config.parentRepo || config.repository}/issues/${number}`, + `repos/${config.parentRepo ?? config.repository}/issues/${number}`, { useCache } ) ).body.body; @@ -971,15 +969,14 @@ export async function findIssue(title: string): Promise { return null; } logger.debug(`Found issue ${issue.number}`); - // TODO: can number be required? #7154 - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO: can number be required? (#7154) return getIssue(issue.number!); } async function closeIssue(issueNumber: number): Promise { logger.debug(`closeIssue(${issueNumber})`); await githubApi.patchJson( - `repos/${config.parentRepo || config.repository}/issues/${issueNumber}`, + `repos/${config.parentRepo ?? config.repository}/issues/${issueNumber}`, { body: { state: 'closed' }, } @@ -1027,13 +1024,13 @@ export async function ensureIssue({ for (const i of issues) { if (i.state === 'open' && i.number !== issue.number) { logger.warn(`Closing duplicate issue ${i.number}`); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 await closeIssue(i.number!); } } const issueBody = ( await githubApi.getJson<{ body: string }>( - `repos/${config.parentRepo || config.repository}/issues/${ + `repos/${config.parentRepo ?? config.repository}/issues/${ issue.number }` ) @@ -1053,7 +1050,7 @@ export async function ensureIssue({ data.labels = labels; } await githubApi.patchJson( - `repos/${config.parentRepo || config.repository}/issues/${ + `repos/${config.parentRepo ?? config.repository}/issues/${ issue.number }`, { @@ -1065,12 +1062,12 @@ export async function ensureIssue({ } } await githubApi.postJson( - `repos/${config.parentRepo || config.repository}/issues`, + `repos/${config.parentRepo ?? config.repository}/issues`, { body: { title, body, - labels: labels || [], + labels: labels ?? [], }, } ); @@ -1100,7 +1097,7 @@ export async function ensureIssueClosing(title: string): Promise { const issueList = await getIssueList(); for (const issue of issueList) { if (issue.state === 'open' && issue.title === title) { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 await closeIssue(issue.number!); logger.debug({ number: issue.number }, 'Issue closed'); } @@ -1112,7 +1109,7 @@ export async function addAssignees( assignees: string[] ): Promise { logger.debug(`Adding assignees '${assignees.join(', ')}' to #${issueNo}`); - const repository = config.parentRepo || config.repository; + const repository = config.parentRepo ?? config.repository; await githubApi.postJson(`repos/${repository}/issues/${issueNo}/assignees`, { body: { assignees, @@ -1133,7 +1130,7 @@ export async function addReviewers( try { await githubApi.postJson( `repos/${ - config.parentRepo || config.repository + config.parentRepo ?? config.repository }/pulls/${prNo}/requested_reviewers`, { body: { @@ -1152,7 +1149,7 @@ async function addLabels( labels: string[] | null | undefined ): Promise { logger.debug(`Adding labels '${labels?.join(', ')}' to #${issueNo}`); - const repository = config.parentRepo || config.repository; + const repository = config.parentRepo ?? config.repository; if (is.array(labels) && labels.length) { await githubApi.postJson(`repos/${repository}/issues/${issueNo}/labels`, { body: labels, @@ -1165,7 +1162,7 @@ export async function deleteLabel( label: string ): Promise { logger.debug(`Deleting label ${label} from #${issueNo}`); - const repository = config.parentRepo || config.repository; + const repository = config.parentRepo ?? config.repository; try { await githubApi.deleteJson( `repos/${repository}/issues/${issueNo}/labels/${label}` @@ -1179,7 +1176,7 @@ async function addComment(issueNo: number, body: string): Promise { // POST /repos/:owner/:repo/issues/:number/comments await githubApi.postJson( `repos/${ - config.parentRepo || config.repository + config.parentRepo ?? config.repository }/issues/${issueNo}/comments`, { body: { body }, @@ -1191,7 +1188,7 @@ async function editComment(commentId: number, body: string): Promise { // PATCH /repos/:owner/:repo/issues/comments/:id await githubApi.patchJson( `repos/${ - config.parentRepo || config.repository + config.parentRepo ?? config.repository }/issues/comments/${commentId}`, { body: { body }, @@ -1203,7 +1200,7 @@ async function deleteComment(commentId: number): Promise { // DELETE /repos/:owner/:repo/issues/comments/:id await githubApi.deleteJson( `repos/${ - config.parentRepo || config.repository + config.parentRepo ?? config.repository }/issues/comments/${commentId}` ); } @@ -1212,7 +1209,7 @@ async function getComments(issueNo: number): Promise { // GET /repos/:owner/:repo/issues/:number/comments logger.debug(`Getting comments for #${issueNo}`); const url = `repos/${ - config.parentRepo || config.repository + config.parentRepo ?? config.repository }/issues/${issueNo}/comments?per_page=100`; try { const comments = ( @@ -1334,9 +1331,9 @@ async function tryPrAutomerge( } // If GitHub Enterprise Server <3.3.0 it doesn't support automerge + // TODO #7154 if (platformConfig.isGhe) { // semver not null safe, accepts null and undefined - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion if (semver.satisfies(platformConfig.gheVersion!, '<3.3.0')) { logger.debug( { prNumber }, @@ -1391,8 +1388,8 @@ export async function createPr({ const body = sanitize(rawBody); const base = targetBranch; // Include the repository owner to handle forkMode and regular mode - // TODO: can `repository` be null? #7154 - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO: can `repository` be null? (#7154) + const head = `${config.repository!.split('/')[0]}:${sourceBranch}`; const options: any = { body: { @@ -1411,7 +1408,7 @@ export async function createPr({ logger.debug({ title, head, base, draft: draftPR }, 'Creating PR'); const ghPr = ( await githubApi.postJson( - `repos/${config.parentRepo || config.repository}/pulls`, + `repos/${config.parentRepo ?? config.repository}/pulls`, options ) ).body; @@ -1451,7 +1448,7 @@ export async function updatePr({ } try { const { body: ghPr } = await githubApi.patchJson( - `repos/${config.parentRepo || config.repository}/pulls/${prNo}`, + `repos/${config.parentRepo ?? config.repository}/pulls/${prNo}`, options ); const result = coerceRestPr(ghPr); @@ -1476,7 +1473,7 @@ export async function mergePr({ { branch: branchName, prNo }, 'Branch protection: Attempting to merge PR when PR reviews are enabled' ); - const repository = config.parentRepo || config.repository; + const repository = config.parentRepo ?? config.repository; const reviews = await githubApi.getJson<{ state: string }[]>( `repos/${repository}/pulls/${prNo}/reviews` ); @@ -1493,7 +1490,7 @@ export async function mergePr({ logger.debug('Found approving reviews'); } const url = `repos/${ - config.parentRepo || config.repository + config.parentRepo ?? config.repository }/pulls/${prNo}/merge`; const options: any = { body: {} as { merge_method?: string }, @@ -1579,9 +1576,10 @@ export function massageMarkdown(input: string): string { export async function getVulnerabilityAlerts(): Promise { let vulnerabilityAlerts: { node: VulnerabilityAlert }[] | undefined; + // TODO #7154 const gheSupportsStateFilter = semver.satisfies( // semver not null safe, accepts null and undefined - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + platformConfig.gheVersion!, '>=3.5' ); @@ -1629,7 +1627,7 @@ export async function getVulnerabilityAlerts(): Promise { const key = `${ecosystem.toLowerCase()}/${name}`; const range = vulnerableVersionRange; const elem = shortAlerts[key] || {}; - elem[range] = patch || null; + elem[range] = patch ?? null; shortAlerts[key] = elem; } logger.debug({ alerts: shortAlerts }, 'GitHub vulnerability details'); diff --git a/lib/modules/platform/gitlab/index.ts b/lib/modules/platform/gitlab/index.ts index 6584bcb9152984..53595121dc93b2 100644 --- a/lib/modules/platform/gitlab/index.ts +++ b/lib/modules/platform/gitlab/index.ts @@ -169,7 +169,7 @@ export async function getRawFile( const repo = urlEscape(repoName ?? config.repository); const url = `projects/${repo}/repository/files/${escapedFileName}?ref=` + - (branchOrTag || `HEAD`); + (branchOrTag ?? `HEAD`); const res = await gitlabApi.getJson<{ content: string }>(url); const buf = res.body.content; const str = Buffer.from(buf, 'base64').toString(); @@ -181,7 +181,7 @@ export async function getJsonFile( repoName?: string, branchOrTag?: string ): Promise { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 const raw = (await getRawFile(fileName, repoName, branchOrTag)) as string; return JSON5.parse(raw); } @@ -218,12 +218,12 @@ function getRepoUrl( ); } - // TODO: null check #7154 + // TODO: null check (#7154) const { protocol, host, pathname } = parseUrl(defaults.endpoint)!; const newPathname = pathname.slice(0, pathname.indexOf('/api')); const url = URL.format({ protocol: protocol.slice(0, -1) || 'https', - auth: 'oauth2:' + opts.token, + auth: `oauth2:${opts.token}`, host, pathname: newPathname + '/' + repository + '.git', }); @@ -233,7 +233,7 @@ function getRepoUrl( logger.debug({ url: res.body.http_url_to_repo }, `using http URL`); const repoUrl = URL.parse(`${res.body.http_url_to_repo}`); - repoUrl.auth = 'oauth2:' + opts.token; + repoUrl.auth = `oauth2:${opts.token}`; return URL.format(repoUrl); } @@ -579,7 +579,7 @@ export async function createPr({ remove_source_branch: true, title, description, - labels: (labels || []).join(','), + labels: (labels ?? []).join(','), squash: config.squash, }, } @@ -610,7 +610,7 @@ export async function getPr(iid: number): Promise { displayNumber: `Merge Request #${mr.iid}`, bodyStruct: getPrBodyStruct(mr.description), state: mr.state === 'opened' ? PrState.Open : mr.state, - hasAssignees: !!(mr.assignee?.id || mr.assignees?.[0]?.id), + hasAssignees: !!(mr.assignee?.id ?? mr.assignees?.[0]?.id), hasReviewers: !!mr.reviewers?.length, title: mr.title, labels: mr.labels, @@ -634,8 +634,7 @@ export async function updatePr({ const newState = { [PrState.Closed]: 'close', [PrState.Open]: 'reopen', - // TODO: null check #7154 - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO: null check (#7154) }[state!]; await gitlabApi.putJson( `projects/${config.repository}/merge_requests/${iid}`, @@ -893,7 +892,7 @@ export async function ensureIssue({ body: { title, description, - labels: (labels || issue.labels || []).join(','), + labels: (labels ?? issue.labels ?? []).join(','), confidential: confidential ?? false, }, } @@ -905,7 +904,7 @@ export async function ensureIssue({ body: { title, description, - labels: (labels || []).join(','), + labels: (labels ?? []).join(','), confidential: confidential ?? false, }, }); @@ -1019,7 +1018,7 @@ export async function deleteLabel( logger.debug(`Deleting label ${label} from #${issueNo}`); try { const pr = await getPr(issueNo); - const labels = (pr.labels || []) + const labels = (pr.labels ?? []) .filter((l: string) => l !== label) .join(','); await gitlabApi.putJson( diff --git a/lib/modules/platform/index.ts b/lib/modules/platform/index.ts index 0a4251348f8d34..889d5cc9eaa97f 100644 --- a/lib/modules/platform/index.ts +++ b/lib/modules/platform/index.ts @@ -40,8 +40,7 @@ export function setPlatformApi(name: string): void { export async function initPlatform(config: AllConfig): Promise { setPrivateKey(config.gitPrivateKey); setNoVerify(config.gitNoVerify ?? []); - // TODO: `platform` #7154 - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO: `platform` (#7154) setPlatformApi(config.platform!); // TODO: types const platformInfo = await platform.initPlatform(config); @@ -57,8 +56,7 @@ export async function initPlatform(config: AllConfig): Promise { // This is done for validation and will be overridden later once repo config is incorporated setGitAuthor(returnConfig.gitAuthor); const platformRule: HostRule = { - // TODO: null check #7154 - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO: null check (#7154) matchHost: URL.parse(returnConfig.endpoint).hostname!, }; ( diff --git a/lib/modules/versioning/npm/range.ts b/lib/modules/versioning/npm/range.ts index 647f528740f079..c375f330975cc8 100644 --- a/lib/modules/versioning/npm/range.ts +++ b/lib/modules/versioning/npm/range.ts @@ -56,6 +56,7 @@ function replaceCaretValue(oldValue: string, newValue: string): string { return needReplace ? resultTuple.join('.') : oldValue; } +// TODO: #7154 export function getNewValue({ currentValue, rangeStrategy, @@ -92,14 +93,14 @@ export function getNewValue({ // TODO fix this const splitCurrent = currentValue.split(element.operator); splitCurrent.pop(); - return splitCurrent.join(element.operator) + newValue; + return `${splitCurrent.join(element.operator)}${newValue}`; } if (parsedRange.length > 1) { const previousElement = parsedRange[parsedRange.length - 2]; if (previousElement.operator === '-') { const splitCurrent = currentValue.split('-'); splitCurrent.pop(); - return splitCurrent.join('-') + '- ' + newValue; + return `${splitCurrent.join('-')}- ${newValue}`; } if (element.operator?.startsWith('>')) { logger.warn(`Complex ranges ending in greater than are not supported`); diff --git a/lib/workers/global/index.ts b/lib/workers/global/index.ts index f41b40ad017456..70a32e5b6eb0c9 100644 --- a/lib/workers/global/index.ts +++ b/lib/workers/global/index.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import is from '@sindresorhus/is'; import { ERROR } from 'bunyan'; import fs from 'fs-extra'; diff --git a/lib/workers/repository/config-migration/branch/migrated-data.ts b/lib/workers/repository/config-migration/branch/migrated-data.ts index a120f7633c3677..ce310b70c9737e 100644 --- a/lib/workers/repository/config-migration/branch/migrated-data.ts +++ b/lib/workers/repository/config-migration/branch/migrated-data.ts @@ -52,7 +52,6 @@ export class MigratedDataFactory { // indent defaults to 2 spaces // TODO #7154 - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion const indent = detectIndent(raw!).indent ?? ' '; let content: string; diff --git a/lib/workers/repository/config-migration/pr/index.ts b/lib/workers/repository/config-migration/pr/index.ts index 3c62ab5852cb37..7ab87877c16d7b 100644 --- a/lib/workers/repository/config-migration/pr/index.ts +++ b/lib/workers/repository/config-migration/pr/index.ts @@ -117,7 +117,7 @@ If you need any further assistance then you can also [request help here](${ } else { const pr = await platform.createPr({ sourceBranch: branchName, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 targetBranch: config.defaultBranch!, prTitle, prBody, diff --git a/lib/workers/repository/dependency-dashboard.spec.ts b/lib/workers/repository/dependency-dashboard.spec.ts index 9a51cecdecc3fa..8fb40454cde2b9 100644 --- a/lib/workers/repository/dependency-dashboard.spec.ts +++ b/lib/workers/repository/dependency-dashboard.spec.ts @@ -518,7 +518,6 @@ describe('workers/repository/dependency-dashboard', () => { config.dependencyDashboard = true; config.dependencyDashboardChecks = { branchName2: 'approve-branch' }; config.dependencyDashboardIssue = 1; - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion mockedFunction(platform.getIssue!).mockResolvedValueOnce({ title: 'Dependency Dashboard', body: `This issue contains a list of Renovate updates and their statuses. diff --git a/lib/workers/repository/dependency-dashboard.ts b/lib/workers/repository/dependency-dashboard.ts index 3c2fbcef165013..7289c6b79ec61c 100644 --- a/lib/workers/repository/dependency-dashboard.ts +++ b/lib/workers/repository/dependency-dashboard.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ +// TODO #7154 import is from '@sindresorhus/is'; import { nameFromLevel } from 'bunyan'; import { GlobalConfig } from '../../config/global'; @@ -45,7 +45,7 @@ export async function readDashboardBody(config: RenovateConfig): Promise { stringifiedConfig.includes('"prCreation":"approval"') ) { config.dependencyDashboardTitle = - config.dependencyDashboardTitle || `Dependency Dashboard`; + config.dependencyDashboardTitle ?? `Dependency Dashboard`; const issue = await platform.findIssue(config.dependencyDashboardTitle); if (issue) { config.dependencyDashboardIssue = issue.number; @@ -63,7 +63,7 @@ function getListItem(branch: BranchConfig, type: string): string { item += branch.prTitle; } const uniquePackages = [ - ...new Set(branch.upgrades.map((upgrade) => '`' + upgrade.depName + '`')), + ...new Set(branch.upgrades.map((upgrade) => `\`${upgrade.depName}\``)), ]; if (uniquePackages.length < 2) { return item + '\n'; @@ -114,8 +114,8 @@ export async function ensureDependencyDashboard( config.packageRules?.some((rule) => rule.dependencyDashboardApproval) || branches.some( (branch) => - branch.dependencyDashboardApproval || - branch.dependencyDashboardPrApproval + !!branch.dependencyDashboardApproval || + !!branch.dependencyDashboardPrApproval ) ) ) { @@ -271,7 +271,7 @@ export async function ensureDependencyDashboard( branch.prBlockedBy !== 'BranchAutomerge' ); const otherBranches = inProgress.filter( - (branch) => branch.prBlockedBy || !branch.prNo + (branch) => !!branch.prBlockedBy || !branch.prNo ); // istanbul ignore if if (otherBranches.length) { diff --git a/lib/workers/repository/error-config.ts b/lib/workers/repository/error-config.ts index dc42b9a442440c..227e4e4fc51ed4 100644 --- a/lib/workers/repository/error-config.ts +++ b/lib/workers/repository/error-config.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ +// TODO #7154 import { GlobalConfig } from '../../config/global'; import type { RenovateConfig } from '../../config/types'; import { logger } from '../../logger'; diff --git a/lib/workers/repository/errors-warnings.ts b/lib/workers/repository/errors-warnings.ts index 4c3d0d3ab18b7f..0c2fb0ed6aea09 100644 --- a/lib/workers/repository/errors-warnings.ts +++ b/lib/workers/repository/errors-warnings.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ +// TODO #7154 import type { RenovateConfig } from '../../config/types'; import { logger } from '../../logger'; import type { PackageFile } from '../../modules/manager/types'; diff --git a/lib/workers/repository/extract/file-match.ts b/lib/workers/repository/extract/file-match.ts index e13f180b041909..27683f3342eb1c 100644 --- a/lib/workers/repository/extract/file-match.ts +++ b/lib/workers/repository/extract/file-match.ts @@ -40,9 +40,9 @@ export function getFilteredFileList( fileList: string[] ): string[] { const { includePaths, ignorePaths } = config; - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 + let filteredList = getIncludedFiles(fileList, includePaths!); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion filteredList = filterIgnoredFiles(filteredList, ignorePaths!); return filteredList; } @@ -54,7 +54,7 @@ export function getMatchingFiles( const fileList = getFilteredFileList(config, allFiles); const { fileMatch, manager } = config; let matchedFiles: string[] = []; - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 for (const match of fileMatch!) { logger.debug(`Using file match: ${match} for manager ${manager}`); const re = regEx(match); diff --git a/lib/workers/repository/finalise/prune.ts b/lib/workers/repository/finalise/prune.ts index c7327e3a24f3ac..403140bd786226 100644 --- a/lib/workers/repository/finalise/prune.ts +++ b/lib/workers/repository/finalise/prune.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { GlobalConfig } from '../../../config/global'; import type { RenovateConfig } from '../../../config/types'; import { REPOSITORY_CHANGED } from '../../../constants/error-messages'; @@ -100,6 +99,7 @@ export async function pruneStaleBranches( logger.debug('No branchList'); return; } + // TODO #7154 let renovateBranches = getBranchList().filter((branchName) => branchName.startsWith(config.branchPrefix!) ); diff --git a/lib/workers/repository/index.ts b/lib/workers/repository/index.ts index 6605c5233e5a7f..c176080ec5e24d 100644 --- a/lib/workers/repository/index.ts +++ b/lib/workers/repository/index.ts @@ -62,7 +62,7 @@ export async function renovateRepository( await ensureDependencyDashboard(config, branches); } await finaliseRepo(config, branchList); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 repoResult = processResult(config, res!); } } catch (err) /* istanbul ignore next */ { diff --git a/lib/workers/repository/init/apis.ts b/lib/workers/repository/init/apis.ts index fe21c16925b69b..d1d425ad335ed4 100644 --- a/lib/workers/repository/init/apis.ts +++ b/lib/workers/repository/init/apis.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { configFileNames } from '../../../config/app-strings'; import type { RenovateConfig } from '../../../config/types'; import { @@ -7,11 +6,12 @@ import { } from '../../../constants/error-messages'; import { RepoParams, RepoResult, platform } from '../../../modules/platform'; -// TODO: fix types +// TODO: fix types (#7154) export type WorkerPlatformConfig = RepoResult & RenovateConfig & Record; +// TODO #7154 const defaultConfigFile = (config: RenovateConfig): string => configFileNames.includes(config.onboardingConfigFileName!) ? config.onboardingConfigFileName! @@ -45,7 +45,7 @@ async function validateIncludeForks(config: RenovateConfig): Promise { } } -// TODO: fix types +// TODO: fix types (#7154) async function getPlatformConfig( config: RepoParams ): Promise { @@ -56,7 +56,7 @@ async function getPlatformConfig( }; } -// TODO: fix types +// TODO: fix types (#7154) export async function initApis( input: RenovateConfig ): Promise { diff --git a/lib/workers/repository/init/merge.ts b/lib/workers/repository/init/merge.ts index c623921b5a969f..f0528cef20b26b 100644 --- a/lib/workers/repository/init/merge.ts +++ b/lib/workers/repository/init/merge.ts @@ -205,7 +205,7 @@ export async function mergeRenovateConfig( delete migratedConfig.errors; delete migratedConfig.warnings; logger.debug({ config: migratedConfig }, 'migrated config'); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 const repository = config.repository!; // Decrypt before resolving in case we need npm authentication for any presets const decryptedConfig = await decryptConfig(migratedConfig, repository); diff --git a/lib/workers/repository/init/vulnerability.spec.ts b/lib/workers/repository/init/vulnerability.spec.ts index 722a012952b0fe..c8d90421ea2136 100644 --- a/lib/workers/repository/init/vulnerability.spec.ts +++ b/lib/workers/repository/init/vulnerability.spec.ts @@ -24,14 +24,12 @@ describe('workers/repository/init/vulnerability', () => { it('returns if alerts are disabled', async () => { // TODO #7154 - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion config.vulnerabilityAlerts!.enabled = false; expect(await detectVulnerabilityAlerts(config)).toEqual(config); }); it('returns if no alerts', async () => { // TODO #7154 - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion delete config.vulnerabilityAlerts!.enabled; platform.getVulnerabilityAlerts.mockResolvedValue([]); expect(await detectVulnerabilityAlerts(config)).toEqual(config); @@ -47,7 +45,7 @@ describe('workers/repository/init/vulnerability', () => { it('returns alerts and remediations', async () => { config.transitiveRemediation = true; - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 delete config.vulnerabilityAlerts!.enabled; platform.getVulnerabilityAlerts.mockResolvedValue([ partial({}), diff --git a/lib/workers/repository/init/vulnerability.ts b/lib/workers/repository/init/vulnerability.ts index ad02bf6c38605d..440a3a33abc3e6 100644 --- a/lib/workers/repository/init/vulnerability.ts +++ b/lib/workers/repository/init/vulnerability.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import type { PackageRule, RenovateConfig } from '../../../config/types'; import { NO_VULNERABILITY_ALERTS } from '../../../constants/error-messages'; import { logger } from '../../../logger'; @@ -44,6 +43,7 @@ type CombinedAlert = Record< > >; +// TODO can return `null` and `undefined` (#7154) export async function detectVulnerabilityAlerts( input: RenovateConfig ): Promise { @@ -108,6 +108,7 @@ export async function detectVulnerabilityAlerts( const firstPatchedVersion = alert.securityVulnerability.firstPatchedVersion.identifier; const advisory = alert.securityAdvisory; + // TODO #7154 let vulnerableRequirements = alert.vulnerableRequirements!; // istanbul ignore if if (!vulnerableRequirements.length) { diff --git a/lib/workers/repository/onboarding/branch/check.ts b/lib/workers/repository/onboarding/branch/check.ts index 7210ce61046924..7225bc38e9b66a 100644 --- a/lib/workers/repository/onboarding/branch/check.ts +++ b/lib/workers/repository/onboarding/branch/check.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { configFileNames } from '../../../../config/app-strings'; import type { RenovateConfig } from '../../../../config/types'; import { @@ -42,7 +41,7 @@ const packageJsonConfigExists = async (): Promise => { return false; }; -// TODO: types +// TODO: types (#7154) export type Pr = any; const closedPrExists = (config: RenovateConfig): Promise => diff --git a/lib/workers/repository/onboarding/branch/config.ts b/lib/workers/repository/onboarding/branch/config.ts index 6236169342a159..1aa01c1fd43eec 100644 --- a/lib/workers/repository/onboarding/branch/config.ts +++ b/lib/workers/repository/onboarding/branch/config.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { GlobalConfig } from '../../../../config/global'; import { getPreset } from '../../../../config/presets/local'; import { PRESET_DEP_NOT_FOUND } from '../../../../config/presets/util'; @@ -21,6 +20,7 @@ async function getOnboardingConfig( 'Checking if this org/owner has a default Renovate preset which can be used.' ); + // TODO #7154 const orgName = config.repository!.split('/')[0]; // Check for org/renovate-config diff --git a/lib/workers/repository/onboarding/branch/create.ts b/lib/workers/repository/onboarding/branch/create.ts index 98870a40b6a2ee..d7865b2fb2bfe3 100644 --- a/lib/workers/repository/onboarding/branch/create.ts +++ b/lib/workers/repository/onboarding/branch/create.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { configFileNames } from '../../../../config/app-strings'; import { GlobalConfig } from '../../../../config/global'; import type { RenovateConfig } from '../../../../config/types'; @@ -12,11 +11,13 @@ const defaultConfigFile = configFileNames[0]; export async function createOnboardingBranch( config: Partial ): Promise { + // TODO #7154 const configFile = configFileNames.includes(config.onboardingConfigFileName!) ? config.onboardingConfigFileName : defaultConfigFile; logger.debug('createOnboardingBranch()'); + // TODO #7154 const contents = await getOnboardingConfigContents(config, configFile!); logger.debug('Creating onboarding branch'); @@ -37,6 +38,7 @@ export async function createOnboardingBranch( files: [ { type: 'addition', + // TODO #7154 path: configFile!, contents, }, diff --git a/lib/workers/repository/onboarding/branch/index.spec.ts b/lib/workers/repository/onboarding/branch/index.spec.ts index 45a73f45cd8cb9..3bd7a3268e919a 100644 --- a/lib/workers/repository/onboarding/branch/index.spec.ts +++ b/lib/workers/repository/onboarding/branch/index.spec.ts @@ -79,7 +79,7 @@ describe('workers/repository/onboarding/branch/index', () => { const file = git.commitFiles.mock.calls[0][0].files[0] as FileAddition; const contents = file.contents?.toString(); expect(contents).toBeJsonString(); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 expect(JSON.parse(contents!)).toEqual({ $schema: 'https://docs.renovatebot.com/renovate-schema.json', }); @@ -113,7 +113,7 @@ describe('workers/repository/onboarding/branch/index', () => { const file = git.commitFiles.mock.calls[0][0].files[0] as FileAddition; const contents = file.contents?.toString(); expect(contents).toBeJsonString(); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 expect(JSON.parse(contents!)).toEqual({ $schema: 'https://docs.renovatebot.com/renovate-schema.json', extends: ['some/renovate-config'], diff --git a/lib/workers/repository/onboarding/branch/index.ts b/lib/workers/repository/onboarding/branch/index.ts index 030998f9d1fb6f..5371c7146e96c0 100644 --- a/lib/workers/repository/onboarding/branch/index.ts +++ b/lib/workers/repository/onboarding/branch/index.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { mergeChildConfig } from '../../../../config'; import { GlobalConfig } from '../../../../config/global'; import type { RenovateConfig } from '../../../../config/types'; @@ -44,6 +43,7 @@ export async function checkOnboardingBranch( } // istanbul ignore if if (platform.refreshPr) { + // TODO #7154 const onboardingPr = await platform.getBranchPr(config.onboardingBranch!); await platform.refreshPr(onboardingPr!.number); } @@ -72,8 +72,10 @@ export async function checkOnboardingBranch( } } if (!GlobalConfig.get('dryRun')) { + // TODO #7154 await checkoutBranch(onboardingBranch!); } + // TODO #7154 const branchList = [onboardingBranch!]; return { ...config, repoIsOnboarded, onboardingBranch, branchList }; } diff --git a/lib/workers/repository/onboarding/branch/rebase.ts b/lib/workers/repository/onboarding/branch/rebase.ts index 1aadf206ef3132..b4bce2b1ed22e6 100644 --- a/lib/workers/repository/onboarding/branch/rebase.ts +++ b/lib/workers/repository/onboarding/branch/rebase.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { configFileNames } from '../../../../config/app-strings'; import { GlobalConfig } from '../../../../config/global'; import type { RenovateConfig } from '../../../../config/types'; @@ -17,6 +16,7 @@ export async function rebaseOnboardingBranch( config: RenovateConfig ): Promise { logger.debug('Checking if onboarding branch needs rebasing'); + // TODO #7154 if (await isBranchModified(config.onboardingBranch!)) { logger.debug('Onboarding branch has been edited and cannot be rebased'); return null; @@ -24,6 +24,7 @@ export async function rebaseOnboardingBranch( const configFile = defaultConfigFile(config); const existingContents = await getFile(configFile, config.onboardingBranch); const contents = await getOnboardingConfigContents(config, configFile); + // TODO #7154 if ( contents === existingContents && !(await isBranchStale(config.onboardingBranch!)) @@ -45,6 +46,7 @@ export async function rebaseOnboardingBranch( return null; } + // TODO #7154 return commitAndPush({ branchName: config.onboardingBranch!, files: [ diff --git a/lib/workers/repository/onboarding/pr/config-description.ts b/lib/workers/repository/onboarding/pr/config-description.ts index c09ae1096ff59b..7476e6a9534520 100644 --- a/lib/workers/repository/onboarding/pr/config-description.ts +++ b/lib/workers/repository/onboarding/pr/config-description.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import is from '@sindresorhus/is'; import { configFileNames } from '../../../../config/app-strings'; import type { RenovateConfig } from '../../../../config/types'; @@ -34,6 +33,7 @@ export function getConfigDesc( config: RenovateConfig, packageFiles?: Record ): string { + // TODO #7154 const configFile = configFileNames.includes(config.onboardingConfigFileName!) ? config.onboardingConfigFileName : defaultConfigFile; diff --git a/lib/workers/repository/onboarding/pr/index.ts b/lib/workers/repository/onboarding/pr/index.ts index 409c2c0886defe..d16fb2ab21b042 100644 --- a/lib/workers/repository/onboarding/pr/index.ts +++ b/lib/workers/repository/onboarding/pr/index.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import is from '@sindresorhus/is'; import { GlobalConfig } from '../../../../config/global'; import type { RenovateConfig } from '../../../../config/types'; @@ -32,6 +31,7 @@ export async function ensureOnboardingPr( } logger.debug('ensureOnboardingPr()'); logger.trace({ config }); + // TODO #7154 const existingPr = await platform.getBranchPr(config.onboardingBranch!); logger.debug('Filling in onboarding PR template'); let prTemplate = `Welcome to [Renovate](${ @@ -45,6 +45,7 @@ export async function ensureOnboardingPr( : emojify( `:vertical_traffic_light: Renovate will begin keeping your dependencies up-to-date only once you merge or close this Pull Request.\n\n` ); + // TODO #7154 prTemplate += emojify( ` @@ -150,6 +151,7 @@ If you need any further assistance then you can also [request help here](${ if (GlobalConfig.get('dryRun')) { logger.info('DRY-RUN: Would create onboarding PR'); } else { + // TODO #7154 const pr = await platform.createPr({ sourceBranch: config.onboardingBranch!, targetBranch: config.defaultBranch!, diff --git a/lib/workers/repository/onboarding/pr/pr-list.ts b/lib/workers/repository/onboarding/pr/pr-list.ts index 6c4af79aa5dca8..b3fe124b68a5df 100644 --- a/lib/workers/repository/onboarding/pr/pr-list.ts +++ b/lib/workers/repository/onboarding/pr/pr-list.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import type { RenovateConfig } from '../../../../config/types'; import { logger } from '../../../../logger'; import { emojify } from '../../../../util/emoji'; @@ -20,6 +19,7 @@ export function getPrList( for (const branch of branches) { const prTitleRe = regEx(/@([a-z]+\/[a-z]+)/); + // TODO #7154 prDesc += `
\n${branch.prTitle!.replace( prTitleRe, '@​$1' @@ -60,6 +60,7 @@ export function getPrList( prDesc += '\n\n'; prDesc += '
\n\n'; } + // TODO #7154 const prHourlyLimit = config.prHourlyLimit!; if ( prHourlyLimit > 0 && diff --git a/lib/workers/repository/process/deprecated.ts b/lib/workers/repository/process/deprecated.ts index 46469213bd36df..642335326d0ad8 100644 --- a/lib/workers/repository/process/deprecated.ts +++ b/lib/workers/repository/process/deprecated.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ +// TODO #7154 import { GlobalConfig } from '../../../config/global'; import type { RenovateConfig } from '../../../config/types'; import { logger } from '../../../logger'; diff --git a/lib/workers/repository/process/extract-update.ts b/lib/workers/repository/process/extract-update.ts index eab3f61620d1e3..e0777d8c8a466a 100644 --- a/lib/workers/repository/process/extract-update.ts +++ b/lib/workers/repository/process/extract-update.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ +// TODO #7154 import is from '@sindresorhus/is'; import hasha from 'hasha'; import type { RenovateConfig } from '../../../config/types'; diff --git a/lib/workers/repository/process/fetch.ts b/lib/workers/repository/process/fetch.ts index 55905525eab9fe..38e690b12ce69d 100644 --- a/lib/workers/repository/process/fetch.ts +++ b/lib/workers/repository/process/fetch.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ +// TODO #7154 import is from '@sindresorhus/is'; import pAll from 'p-all'; import { getManagerConfig, mergeChildConfig } from '../../../config'; diff --git a/lib/workers/repository/process/index.ts b/lib/workers/repository/process/index.ts index 4eb1b36921adbd..83c001eb6a6c17 100644 --- a/lib/workers/repository/process/index.ts +++ b/lib/workers/repository/process/index.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ +// TODO #7154 import { mergeChildConfig } from '../../../config'; import { GlobalConfig } from '../../../config/global'; import type { RenovateConfig } from '../../../config/types'; diff --git a/lib/workers/repository/process/limits.ts b/lib/workers/repository/process/limits.ts index c26c7d5231c982..f9525e5420577b 100644 --- a/lib/workers/repository/process/limits.ts +++ b/lib/workers/repository/process/limits.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ +// TODO #7154 import { DateTime } from 'luxon'; import type { RenovateConfig } from '../../../config/types'; import { logger } from '../../../logger'; diff --git a/lib/workers/repository/process/lookup/filter-checks.ts b/lib/workers/repository/process/lookup/filter-checks.ts index a290984b5ea3e7..93044425c83425 100644 --- a/lib/workers/repository/process/lookup/filter-checks.ts +++ b/lib/workers/repository/process/lookup/filter-checks.ts @@ -41,7 +41,7 @@ export async function filterInternalChecks( releaseConfig.updateType = getUpdateType( releaseConfig, versioning, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 currentVersion!, candidateRelease.version ); @@ -70,20 +70,17 @@ export async function filterInternalChecks( continue; } } - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + + // TODO #7154 if (isActiveConfidenceLevel(minimumConfidence!)) { const confidenceLevel = await getMergeConfidenceLevel( - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion datasource!, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion depName!, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion currentVersion!, newVersion, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion updateType! ); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 if (!satisfiesConfidenceLevel(confidenceLevel, minimumConfidence!)) { logger.debug( { depName, check: 'minimumConfidence' }, @@ -113,6 +110,7 @@ export async function filterInternalChecks( } } } - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + + // TODO #7154 return { release: release!, pendingChecks, pendingReleases }; } diff --git a/lib/workers/repository/process/lookup/filter.ts b/lib/workers/repository/process/lookup/filter.ts index fa5e63069944d5..54329d083c15cc 100644 --- a/lib/workers/repository/process/lookup/filter.ts +++ b/lib/workers/repository/process/lookup/filter.ts @@ -50,7 +50,7 @@ export function filterVersions( const versionRelease = releases.find( (release) => release.version === v.version ); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 if (versionRelease!.isDeprecated) { logger.trace( `Skipping ${config.depName}@${v.version} because it is deprecated` diff --git a/lib/workers/repository/process/lookup/generate.ts b/lib/workers/repository/process/lookup/generate.ts index 64e272350449a6..89869351aa1cfb 100644 --- a/lib/workers/repository/process/lookup/generate.ts +++ b/lib/workers/repository/process/lookup/generate.ts @@ -66,7 +66,7 @@ export function generateUpdate( return update; } update.updateType = - update.updateType || + update.updateType ?? getUpdateType(config, versioning, currentVersion, newVersion); if (!versioning.isVersion(update.newValue)) { update.isRange = true; @@ -76,7 +76,7 @@ export function generateUpdate( } if ( rangeStrategy === 'bump' && - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 versioning.matches(newVersion, currentValue!) ) { update.isBump = true; diff --git a/lib/workers/repository/process/lookup/index.ts b/lib/workers/repository/process/lookup/index.ts index 9b682b4d03e2ae..157f31062cc207 100644 --- a/lib/workers/repository/process/lookup/index.ts +++ b/lib/workers/repository/process/lookup/index.ts @@ -45,7 +45,7 @@ export async function lookupUpdates( isVulnerabilityAlert, updatePinnedDependencies, } = config; - const unconstrainedValue = lockedVersion && is.undefined(currentValue); + const unconstrainedValue = !!lockedVersion && is.undefined(currentValue); const res: UpdateResult = { updates: [], warnings: [], @@ -68,7 +68,7 @@ export async function lookupUpdates( if (unconstrainedValue || isValid) { if ( !updatePinnedDependencies && - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 versioning.isSingleVersion(currentValue!) ) { res.skipReason = 'is-pinned'; @@ -137,7 +137,7 @@ export async function lookupUpdates( // Check that existing constraint can be satisfied const allSatisfyingVersions = allVersions.filter( (v) => - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 unconstrainedValue || versioning.matches(v.version, currentValue!) ); if (rollbackPrs && !allSatisfyingVersions.length) { @@ -158,10 +158,9 @@ export async function lookupUpdates( updateType: 'replacement', newName: dependency.replacementName, newValue: versioning.getNewValue({ - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 currentValue: currentValue!, newVersion: dependency.replacementVersion, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion rangeStrategy: rangeStrategy!, })!, }); @@ -181,40 +180,32 @@ export async function lookupUpdates( if (rangeStrategy === 'update-lockfile') { currentVersion = lockedVersion!; } + // TODO #7154 currentVersion ??= getCurrentVersion( - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion currentValue!, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion lockedVersion!, versioning, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion rangeStrategy!, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion latestVersion!, nonDeprecatedVersions - )! || + ) ?? getCurrentVersion( - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion currentValue!, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion lockedVersion!, versioning, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion rangeStrategy!, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion latestVersion!, allVersions.map((v) => v.version) )!; // istanbul ignore if - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion if (!currentVersion! && lockedVersion) { return res; } res.currentVersion = currentVersion!; if ( currentValue && - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 currentVersion! && rangeStrategy === 'pin' && !versioning.isSingleVersion(currentValue) @@ -232,17 +223,15 @@ export async function lookupUpdates( }); } // istanbul ignore if - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion if (!versioning.isVersion(currentVersion!)) { res.skipReason = 'invalid-version'; return res; } // Filter latest, unstable, etc + // TODO #7154 let filteredReleases = filterVersions( config, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion currentVersion!, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion latestVersion!, allVersions, versioning @@ -258,7 +247,7 @@ export async function lookupUpdates( for (const release of filteredReleases) { const bucket = getBucket( config, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 currentVersion!, release.version, versioning @@ -291,19 +280,19 @@ export async function lookupUpdates( const update = generateUpdate( config, versioning, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 + rangeStrategy!, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion - lockedVersion || currentVersion!, + lockedVersion ?? currentVersion!, bucket, release ); if (pendingChecks) { update.pendingChecks = pendingChecks; } - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + + // TODO #7154 if (pendingReleases!.length) { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion update.pendingVersions = pendingReleases!.map((r) => r.version); } if (!update.newValue || update.newValue === currentValue) { @@ -321,7 +310,8 @@ export async function lookupUpdates( res.isSingleVersion = true; } res.isSingleVersion = - res.isSingleVersion || !!versioning.isSingleVersion(update.newValue); + !!res.isSingleVersion || + !!versioning.isSingleVersion(update.newValue); res.updates.push(update); } @@ -352,7 +342,7 @@ export async function lookupUpdates( // digest update res.updates.push({ updateType: 'digest', - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 newValue: currentValue!, }); } @@ -363,24 +353,25 @@ export async function lookupUpdates( res.updates.push({ isPinDigest: true, updateType: 'pinDigest', - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 newValue: currentValue!, }); } } if (versioning.valueToVersion) { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 res.currentVersion = versioning.valueToVersion(res.currentVersion!); for (const update of res.updates || []) { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 update.newVersion = versioning.valueToVersion(update.newVersion!); } } // update digest for all for (const update of res.updates) { if (pinDigests || currentDigest) { + // TODO #7154 update.newDigest = - update.newDigest || (await getDigest(config, update.newValue))!; + update.newDigest ?? (await getDigest(config, update.newValue))!; } } } @@ -394,7 +385,7 @@ export async function lookupUpdates( (update) => update.newValue !== currentValue || update.isLockfileUpdate || - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 (update.newDigest && !update.newDigest.startsWith(currentDigest!)) ); // If range strategy specified in config is 'in-range-only', also strip out updates where currentValue !== newValue diff --git a/lib/workers/repository/process/lookup/rollback.ts b/lib/workers/repository/process/lookup/rollback.ts index 57cf13bb141fe9..c7440b50b80914 100644 --- a/lib/workers/repository/process/lookup/rollback.ts +++ b/lib/workers/repository/process/lookup/rollback.ts @@ -19,7 +19,7 @@ export function getRollbackUpdate( return null; } const lessThanVersions = versions.filter((v) => - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 version.isLessThanRange!(v.version, currentValue!) ); // istanbul ignore if @@ -55,15 +55,15 @@ export function getRollbackUpdate( return null; } const newValue = version.getNewValue({ - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 currentValue: currentValue!, rangeStrategy: 'replace', newVersion, }); return { bucket: 'rollback', + // TODO #7154 newMajor: version.getMajor(newVersion)!, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion newValue: newValue!, newVersion, updateType: 'rollback', diff --git a/lib/workers/repository/process/sort.ts b/lib/workers/repository/process/sort.ts index ceaabb51646cbb..2286dca3d9d29b 100644 --- a/lib/workers/repository/process/sort.ts +++ b/lib/workers/repository/process/sort.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { logger } from '../../../logger'; import type { BranchConfig } from '../../types'; @@ -17,14 +16,17 @@ export function sortBranches(branches: Partial[]): void { if (a.isVulnerabilityAlert && !b.isVulnerabilityAlert) { return -1; } + // TODO #7154 if (a.prPriority !== b.prPriority) { return b.prPriority! - a.prPriority!; } + // TODO #7154 const sortDiff = sortOrder.indexOf(a.updateType!) - sortOrder.indexOf(b.updateType!); if (sortDiff !== 0) { return sortDiff; } + // TODO #7154 // Sort by prTitle if updateType is the same return a.prTitle! < b.prTitle! ? -1 : 1; }); diff --git a/lib/workers/repository/process/vulnerabilities.ts b/lib/workers/repository/process/vulnerabilities.ts index f540b44cc64abf..9cbe6c9da79945 100644 --- a/lib/workers/repository/process/vulnerabilities.ts +++ b/lib/workers/repository/process/vulnerabilities.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ +// TODO #7154 import { Ecosystem, Osv, OsvOffline } from '@jamiemagee/osv-offline'; import pAll from 'p-all'; import { getManagerConfig, mergeChildConfig } from '../../../config'; diff --git a/lib/workers/repository/update/branch/auto-replace.spec.ts b/lib/workers/repository/update/branch/auto-replace.spec.ts index ff0a9fa2115544..d2367b1d682945 100644 --- a/lib/workers/repository/update/branch/auto-replace.spec.ts +++ b/lib/workers/repository/update/branch/auto-replace.spec.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { Fixtures } from '../../../../../test/fixtures'; import { defaultConfig } from '../../../../../test/util'; import { GlobalConfig } from '../../../../config/global'; diff --git a/lib/workers/repository/update/branch/auto-replace.ts b/lib/workers/repository/update/branch/auto-replace.ts index 2395f4dc331144..a309e4f3b27aca 100644 --- a/lib/workers/repository/update/branch/auto-replace.ts +++ b/lib/workers/repository/update/branch/auto-replace.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ +// TODO #7154 import { WORKER_FILE_UPDATE_FAILED } from '../../../../constants/error-messages'; import { logger } from '../../../../logger'; import { get } from '../../../../modules/manager'; diff --git a/lib/workers/repository/update/branch/automerge.ts b/lib/workers/repository/update/branch/automerge.ts index e634f8d7f5f75e..6aeb20a66b1f79 100644 --- a/lib/workers/repository/update/branch/automerge.ts +++ b/lib/workers/repository/update/branch/automerge.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ +// TODO #7154 import { GlobalConfig } from '../../../../config/global'; import type { RenovateConfig } from '../../../../config/types'; import { logger } from '../../../../logger'; diff --git a/lib/workers/repository/update/branch/check-existing.ts b/lib/workers/repository/update/branch/check-existing.ts index fcd39fc1efa8f4..fad8d013f2b37a 100644 --- a/lib/workers/repository/update/branch/check-existing.ts +++ b/lib/workers/repository/update/branch/check-existing.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ +// TODO #7154 import { REPOSITORY_CHANGED } from '../../../../constants/error-messages'; import { logger } from '../../../../logger'; import { Pr, platform } from '../../../../modules/platform'; diff --git a/lib/workers/repository/update/branch/commit.spec.ts b/lib/workers/repository/update/branch/commit.spec.ts index 47df38f4bb0fc0..86dd53bd5f43c8 100644 --- a/lib/workers/repository/update/branch/commit.spec.ts +++ b/lib/workers/repository/update/branch/commit.spec.ts @@ -60,7 +60,6 @@ describe('workers/repository/update/branch/commit', () => { expect(platform.commitFiles).toHaveBeenCalledTimes(1); // TODO #7154 expect( - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion mockedFunction(platform.commitFiles!).mock.calls ).toMatchSnapshot(); }); diff --git a/lib/workers/repository/update/branch/commit.ts b/lib/workers/repository/update/branch/commit.ts index e15ced2c2e3334..827d03c5ee77b4 100644 --- a/lib/workers/repository/update/branch/commit.ts +++ b/lib/workers/repository/update/branch/commit.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ +// TODO #7154 import is from '@sindresorhus/is'; import minimatch from 'minimatch'; import { GlobalConfig } from '../../../../config/global'; diff --git a/lib/workers/repository/update/branch/execute-post-upgrade-commands.ts b/lib/workers/repository/update/branch/execute-post-upgrade-commands.ts index dca6b59b34c94d..d7d7e0e4ddd013 100644 --- a/lib/workers/repository/update/branch/execute-post-upgrade-commands.ts +++ b/lib/workers/repository/update/branch/execute-post-upgrade-commands.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ +// TODO #7154 import is from '@sindresorhus/is'; import minimatch from 'minimatch'; import { GlobalConfig } from '../../../../config/global'; diff --git a/lib/workers/repository/update/branch/handle-existing.ts b/lib/workers/repository/update/branch/handle-existing.ts index e832bc1ffdd695..735ce2b242a56a 100644 --- a/lib/workers/repository/update/branch/handle-existing.ts +++ b/lib/workers/repository/update/branch/handle-existing.ts @@ -10,7 +10,7 @@ import type { BranchConfig } from '../../../types'; export async function handlepr(config: BranchConfig, pr: Pr): Promise { if (pr.state === PrState.Closed) { let content; - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 const userStrings = config.userStrings!; if (config.updateType === 'major') { content = template.compile(userStrings.ignoreMajor, config); diff --git a/lib/workers/repository/update/branch/index.ts b/lib/workers/repository/update/branch/index.ts index 6df732162e5ee9..1e8c807b312bdc 100644 --- a/lib/workers/repository/update/branch/index.ts +++ b/lib/workers/repository/update/branch/index.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ +// TODO #7154 import is from '@sindresorhus/is'; import { DateTime } from 'luxon'; import { GlobalConfig } from '../../../../config/global'; @@ -353,8 +353,8 @@ export async function processBranch( const userRebaseRequested = dependencyDashboardCheck === 'rebase' || - config.dependencyDashboardRebaseAllOpen || - config.rebaseRequested; + !!config.dependencyDashboardRebaseAllOpen || + !!config.rebaseRequested; if (userRebaseRequested) { logger.debug('Manual rebase requested via Dependency Dashboard'); diff --git a/lib/workers/repository/update/branch/reuse.ts b/lib/workers/repository/update/branch/reuse.ts index 11a8e149d7df8a..c1ac3e786fda36 100644 --- a/lib/workers/repository/update/branch/reuse.ts +++ b/lib/workers/repository/update/branch/reuse.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ +// TODO #7154 import { GlobalConfig } from '../../../../config/global'; import { logger } from '../../../../logger'; import { platform } from '../../../../modules/platform'; diff --git a/lib/workers/repository/update/pr/automerge.ts b/lib/workers/repository/update/pr/automerge.ts index 2ec9b9546c3256..fd875b9bb5b96a 100644 --- a/lib/workers/repository/update/pr/automerge.ts +++ b/lib/workers/repository/update/pr/automerge.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ +// TODO #7154 import { GlobalConfig } from '../../../../config/global'; import { logger } from '../../../../logger'; import { Pr, platform } from '../../../../modules/platform'; diff --git a/lib/workers/repository/update/pr/changelog/github/index.ts b/lib/workers/repository/update/pr/changelog/github/index.ts index f98a2aeefd5866..a32d6d3e06b5be 100644 --- a/lib/workers/repository/update/pr/changelog/github/index.ts +++ b/lib/workers/repository/update/pr/changelog/github/index.ts @@ -116,7 +116,7 @@ export async function getReleaseList( release: ChangeLogRelease ): Promise { logger.trace('github.getReleaseList()'); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 const apiBaseUrl = project.apiBaseUrl!; // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion const repository = project.repository!; diff --git a/lib/workers/repository/update/pr/changelog/gitlab/index.ts b/lib/workers/repository/update/pr/changelog/gitlab/index.ts index c24f431aacb732..2fedafb345ca90 100644 --- a/lib/workers/repository/update/pr/changelog/gitlab/index.ts +++ b/lib/workers/repository/update/pr/changelog/gitlab/index.ts @@ -100,7 +100,7 @@ export async function getReleaseList( _release: ChangeLogRelease ): Promise { logger.trace('gitlab.getReleaseNotesMd()'); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // TODO #7154 const apiBaseUrl = project.apiBaseUrl!; // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion const repository = project.repository!; diff --git a/lib/workers/repository/update/pr/changelog/release-notes.ts b/lib/workers/repository/update/pr/changelog/release-notes.ts index efc52019bf815d..964d67b4fcf2dc 100644 --- a/lib/workers/repository/update/pr/changelog/release-notes.ts +++ b/lib/workers/repository/update/pr/changelog/release-notes.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ +// TODO #7154 import URL from 'url'; import is from '@sindresorhus/is'; import { DateTime } from 'luxon'; diff --git a/lib/workers/repository/update/pr/changelog/releases.ts b/lib/workers/repository/update/pr/changelog/releases.ts index a0298f48f83813..dfcb2c8b74d7f6 100644 --- a/lib/workers/repository/update/pr/changelog/releases.ts +++ b/lib/workers/repository/update/pr/changelog/releases.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ +// TODO #7154 import { logger } from '../../../../../logger'; import { Release, diff --git a/lib/workers/repository/update/pr/changelog/source-github.ts b/lib/workers/repository/update/pr/changelog/source-github.ts index c111c7a28b1756..b081677940ee1b 100644 --- a/lib/workers/repository/update/pr/changelog/source-github.ts +++ b/lib/workers/repository/update/pr/changelog/source-github.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ +// TODO #7154 import URL from 'url'; import { GlobalConfig } from '../../../../../config/global'; import { PlatformId } from '../../../../../constants'; diff --git a/lib/workers/repository/update/pr/changelog/source-gitlab.ts b/lib/workers/repository/update/pr/changelog/source-gitlab.ts index 964ced4a93acec..2cd1b38c276109 100644 --- a/lib/workers/repository/update/pr/changelog/source-gitlab.ts +++ b/lib/workers/repository/update/pr/changelog/source-gitlab.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ +// TODO #7154 import URL from 'url'; import { logger } from '../../../../../logger'; import type { Release } from '../../../../../modules/datasource/types'; diff --git a/lib/workers/repository/updates/branch-name.ts b/lib/workers/repository/updates/branch-name.ts index abcd703f5cbb9d..d7a0845f8497fe 100644 --- a/lib/workers/repository/updates/branch-name.ts +++ b/lib/workers/repository/updates/branch-name.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ +// TODO #7154 import cleanGitRef from 'clean-git-ref'; import hasha from 'hasha'; import slugify from 'slugify'; @@ -38,7 +38,7 @@ export function generateBranchName(update: RenovateConfig): void { logger.debug( `Dependency ${update.depName} is part of group ${update.groupName}` ); - update.groupSlug = slugify(update.groupSlug || update.groupName, { + update.groupSlug = slugify(update.groupSlug ?? update.groupName, { lower: true, }); if (update.updateType === 'major' && update.separateMajorMinor) { @@ -52,8 +52,8 @@ export function generateBranchName(update: RenovateConfig): void { if (update.updateType === 'patch' && update.separateMinorPatch) { update.groupSlug = `patch-${update.groupSlug}`; } - update.branchTopic = update.group!.branchTopic || update.branchTopic; - update.branchName = update.group!.branchName || update.branchName; + update.branchTopic = update.group!.branchTopic ?? update.branchTopic; + update.branchName = update.group!.branchName ?? update.branchName; } if (update.hashedBranchLength) { @@ -83,7 +83,7 @@ export function generateBranchName(update: RenovateConfig): void { const hash = hasha(hashInput); - update.branchName = update.branchPrefix + hash.slice(0, hashLength); + update.branchName = `${update.branchPrefix}${hash.slice(0, hashLength)}`; } else { update.branchName = template.compile(update.branchName!, update); diff --git a/lib/workers/repository/updates/branchify.ts b/lib/workers/repository/updates/branchify.ts index 739cb1a7900298..409662b1099f20 100644 --- a/lib/workers/repository/updates/branchify.ts +++ b/lib/workers/repository/updates/branchify.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ +// TODO #7154 import type { Merge } from 'type-fest'; import type { RenovateConfig, ValidationMessage } from '../../../config/types'; import { addMeta, logger, removeMeta } from '../../../logger'; diff --git a/package.json b/package.json index 89f568e33b60d7..51115456ebe5ac 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "ls-lint": "ls-lint", "markdown-lint": "markdownlint-cli2", "markdown-lint-fix": "markdownlint-cli2-fix", - "null-check": "run-s generate:* \"tsc --noEmit -p tsconfig.strict.json {@}\" --", + "strict-check": "run-s generate:* \"tsc --noEmit -p tsconfig.strict.json {@}\" --", "prepare": "run-s prepare:*", "prepare:husky": "husky install", "prepare:generate": "run-s generate:*", @@ -45,7 +45,7 @@ "release:prepare": "node -r ts-node/register/transpile-only -- tools/generate-docs.ts", "release:publish": "node tools/release.mjs", "start": "node -r ts-node/register/transpile-only -- lib/renovate.ts", - "test": "run-s lint test-schema type-check null-check jest", + "test": "run-s lint test-schema type-check strict-check jest", "test-dirty": "git diff --exit-code", "test-e2e": "npm pack && cd test/e2e && yarn install --no-lockfile --ignore-optional --prod && yarn test", "test-schema": "run-s create-json-schema", diff --git a/tsconfig.app.json b/tsconfig.app.json index 2c829289c8551e..01612b0cf5c494 100644 --- a/tsconfig.app.json +++ b/tsconfig.app.json @@ -3,7 +3,6 @@ "compilerOptions": { "declaration": true, "resolveJsonModule": false, - "noImplicitAny": false, "sourceMap": true, "inlineSources": true, "importHelpers": true, diff --git a/tsconfig.json b/tsconfig.json index 8b013189c8dd52..718277526aa8d1 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,8 +1,8 @@ { "compilerOptions": { "strict": true, - "noImplicitAny": false /* TODO: fix me */, - "strictNullChecks": false /* TODO: fix me */, + "noImplicitAny": true, + "strictNullChecks": true, "outDir": "./dist", /* https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping */ "target": "es2020", diff --git a/tsconfig.strict.json b/tsconfig.strict.json index a4aad68848c2b9..67b031600b4a9f 100644 --- a/tsconfig.strict.json +++ b/tsconfig.strict.json @@ -1,8 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "strictNullChecks": true, - "noImplicitAny": true + /* TODO add new checks */ }, "exclude": [ // tsconfig.json From 10302eba68fba11b8e6aa667529d64d708a54d97 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Tue, 21 Jun 2022 14:02:49 +0200 Subject: [PATCH 155/240] refactor: fix `prefer-nullish-coalescing` (#16171) --- .eslintrc.js | 2 +- lib/config/massage.ts | 2 +- lib/config/migrate-validate.ts | 4 +- lib/config/presets/index.ts | 6 +-- lib/modules/datasource/conan/index.ts | 4 +- lib/modules/datasource/git-tags/index.ts | 2 +- lib/modules/datasource/go/releases-goproxy.ts | 2 +- lib/modules/datasource/npm/get.ts | 4 +- lib/modules/datasource/pypi/index.ts | 6 +-- lib/modules/manager/bazel/extract.ts | 2 +- lib/modules/manager/bazel/update.ts | 2 +- lib/modules/manager/bundler/extract.ts | 2 +- lib/modules/manager/composer/artifacts.ts | 10 ++--- lib/modules/manager/docker-compose/extract.ts | 2 +- lib/modules/manager/gradle/extract/catalog.ts | 6 +-- lib/modules/manager/leiningen/extract.ts | 2 +- lib/modules/manager/mix/extract.ts | 2 +- lib/modules/manager/nuget/artifacts.ts | 2 +- lib/modules/manager/poetry/update-locked.ts | 2 +- lib/modules/manager/regex/strategies.ts | 2 +- lib/modules/manager/regex/utils.ts | 2 +- lib/modules/manager/setup-cfg/extract.ts | 6 +-- .../manager/terraform/extract/kubernetes.ts | 4 +- .../manager/terraform/required-version.ts | 4 +- lib/modules/platform/bitbucket/index.spec.ts | 4 +- lib/modules/platform/gitlab/index.spec.ts | 2 +- lib/modules/versioning/conan/range.ts | 2 +- lib/modules/versioning/node/schedule.ts | 2 +- lib/modules/versioning/pep440/range.ts | 2 +- lib/util/package-rules.ts | 40 +++++++++---------- lib/workers/global/limits.ts | 2 +- lib/workers/repository/cache.ts | 2 +- .../repository/update/pr/body/index.ts | 2 +- .../repository/update/pr/code-owners.ts | 6 +-- lib/workers/repository/update/pr/index.ts | 2 +- test/website-docs.spec.ts | 2 +- 36 files changed, 75 insertions(+), 75 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 72f2ce598f782b..ffb596076a199d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -95,7 +95,7 @@ module.exports = { }, ], '@typescript-eslint/prefer-optional-chain': 2, - '@typescript-eslint/prefer-nullish-coalescing': 1, // TODO: Temporary (#7154) + '@typescript-eslint/prefer-nullish-coalescing': 2, curly: [2, 'all'], 'require-await': 2, // next 2 rules disabled due to https://github.com/microsoft/TypeScript/issues/20024 diff --git a/lib/config/massage.ts b/lib/config/massage.ts index 1b7eb50f58119e..ef3fff325a9ec7 100644 --- a/lib/config/massage.ts +++ b/lib/config/massage.ts @@ -62,7 +62,7 @@ export function massageConfig(config: RenovateConfig): RenovateConfig { delete newRule[newKey]; } }); - newRule.matchUpdateTypes = rule.matchUpdateTypes || []; + newRule.matchUpdateTypes = rule.matchUpdateTypes ?? []; newRule.matchUpdateTypes.push(key); newRule = { ...newRule, ...val }; newRules.push(newRule); diff --git a/lib/config/migrate-validate.ts b/lib/config/migrate-validate.ts index b9e58ffb2dc5b7..97433b7e923c10 100644 --- a/lib/config/migrate-validate.ts +++ b/lib/config/migrate-validate.ts @@ -36,9 +36,9 @@ export async function migrateAndValidate( if (is.nonEmptyArray(errors)) { logger.info({ errors }, 'Found renovate config errors'); } - massagedConfig.errors = (config.errors || []).concat(errors); + massagedConfig.errors = (config.errors ?? []).concat(errors); if (!config.repoIsOnboarded) { - massagedConfig.warnings = (config.warnings || []).concat(warnings); + massagedConfig.warnings = (config.warnings ?? []).concat(warnings); } return massagedConfig; } catch (err) /* istanbul ignore next */ { diff --git a/lib/config/presets/index.ts b/lib/config/presets/index.ts index 506c7f042c2dfb..64594367e69c4c 100644 --- a/lib/config/presets/index.ts +++ b/lib/config/presets/index.ts @@ -181,9 +181,9 @@ export function parsePreset(input: string): ParsedPreset { throw new Error(PRESET_INVALID); } ({ repo, presetPath, presetName, tag } = - nonScopedPresetWithSubdirRegex.exec(str)?.groups || {}); + nonScopedPresetWithSubdirRegex.exec(str)?.groups ?? {}); } else { - ({ repo, presetName, tag } = gitPresetRegex.exec(str)?.groups || {}); + ({ repo, presetName, tag } = gitPresetRegex.exec(str)?.groups ?? {}); if (presetSource === 'npm' && !repo.startsWith('renovate-config-')) { repo = `renovate-config-${repo}`; @@ -270,7 +270,7 @@ export async function resolveConfigPresets( ): Promise { let ignorePresets = clone(_ignorePresets); if (!ignorePresets || ignorePresets.length === 0) { - ignorePresets = inputConfig.ignorePresets || []; + ignorePresets = inputConfig.ignorePresets ?? []; } logger.trace( { config: inputConfig, existingPresets }, diff --git a/lib/modules/datasource/conan/index.ts b/lib/modules/datasource/conan/index.ts index 66a479686e7a1c..2889565e559719 100644 --- a/lib/modules/datasource/conan/index.ts +++ b/lib/modules/datasource/conan/index.ts @@ -44,7 +44,7 @@ export class ConanDatasource extends Datasource { json: true, }) as ConanYAML; return { - releases: Object.keys(doc?.versions || {}).map((version) => ({ + releases: Object.keys(doc?.versions ?? {}).map((version) => ({ version, })), }; @@ -80,7 +80,7 @@ export class ConanDatasource extends Datasource { logger.trace({ lookupUrl }, 'Got conan api result'); const dep: ReleaseResult = { releases: [] }; - for (const resultString of Object.values(versions.results || {})) { + for (const resultString of Object.values(versions.results ?? {})) { const fromMatch = conanDatasourceRegex.exec(resultString); if (fromMatch?.groups?.version && fromMatch?.groups?.userChannel) { const version = fromMatch.groups.version; diff --git a/lib/modules/datasource/git-tags/index.ts b/lib/modules/datasource/git-tags/index.ts index e2df233bd81376..e8773274f6147e 100644 --- a/lib/modules/datasource/git-tags/index.ts +++ b/lib/modules/datasource/git-tags/index.ts @@ -49,7 +49,7 @@ export class GitTagsDatasource extends GitDatasource { newValue?: string ): Promise { const rawRefs = await this.getRawRefs({ packageName }); - const findValue = newValue || 'HEAD'; + const findValue = newValue ?? 'HEAD'; const ref = rawRefs?.find((rawRef) => rawRef.value === findValue); if (ref) { return ref.hash; diff --git a/lib/modules/datasource/go/releases-goproxy.ts b/lib/modules/datasource/go/releases-goproxy.ts index 585476c29ae091..27dced5604d6b5 100644 --- a/lib/modules/datasource/go/releases-goproxy.ts +++ b/lib/modules/datasource/go/releases-goproxy.ts @@ -172,7 +172,7 @@ export class GoProxyDatasource extends Datasource { static parsedNoproxy: Record = {}; static parseNoproxy( - input: unknown = process.env.GONOPROXY || process.env.GOPRIVATE + input: unknown = process.env.GONOPROXY ?? process.env.GOPRIVATE ): RegExp | null { if (!is.string(input)) { return null; diff --git a/lib/modules/datasource/npm/get.ts b/lib/modules/datasource/npm/get.ts index d2b418dda59691..109b9e94857cc4 100644 --- a/lib/modules/datasource/npm/get.ts +++ b/lib/modules/datasource/npm/get.ts @@ -88,8 +88,8 @@ export async function getDependency( } const latestVersion = res.versions[res['dist-tags']?.latest ?? '']; - res.repository = res.repository || latestVersion?.repository; - res.homepage = res.homepage || latestVersion?.homepage; + res.repository ??= latestVersion?.repository; + res.homepage ??= latestVersion?.homepage; const { sourceUrl, sourceDirectory } = getPackageSource(res.repository); diff --git a/lib/modules/datasource/pypi/index.ts b/lib/modules/datasource/pypi/index.ts index be28036a106522..dae80c60cd99cc 100644 --- a/lib/modules/datasource/pypi/index.ts +++ b/lib/modules/datasource/pypi/index.ts @@ -23,7 +23,7 @@ export class PypiDatasource extends Datasource { override readonly customRegistrySupport = true; override readonly defaultRegistryUrls = [ - process.env.PIP_INDEX_URL || 'https://pypi.org/pypi/', + process.env.PIP_INDEX_URL ?? 'https://pypi.org/pypi/', ]; override readonly defaultVersioning = pep440.id; @@ -146,7 +146,7 @@ export class PypiDatasource extends Datasource { if (dep.releases) { const versions = Object.keys(dep.releases); dependency.releases = versions.map((version) => { - const releases = dep.releases?.[version] || []; + const releases = dep.releases?.[version] ?? []; const { upload_time: releaseTimestamp } = releases[0] || {}; const isDeprecated = releases.some(({ yanked }) => yanked); const result: Release = { @@ -260,7 +260,7 @@ export class PypiDatasource extends Datasource { } const versions = Object.keys(releases); dependency.releases = versions.map((version) => { - const versionReleases = releases[version] || []; + const versionReleases = releases[version] ?? []; const isDeprecated = versionReleases.some(({ yanked }) => yanked); const result: Release = { version }; if (isDeprecated) { diff --git a/lib/modules/manager/bazel/extract.ts b/lib/modules/manager/bazel/extract.ts index 8e95883a8b525e..8dd033bb0d1914 100644 --- a/lib/modules/manager/bazel/extract.ts +++ b/lib/modules/manager/bazel/extract.ts @@ -254,7 +254,7 @@ export function extractPackageFile( (currentValue || commit) ) { dep.depName = depName; - dep.currentValue = currentValue || commit?.substring(0, 7); + dep.currentValue = currentValue ?? commit?.substring(0, 7); dep.datasource = GoDatasource.id; dep.packageName = importpath; if (remote) { diff --git a/lib/modules/manager/bazel/update.ts b/lib/modules/manager/bazel/update.ts index d91bb9095168b9..93933e48b8627e 100644 --- a/lib/modules/manager/bazel/update.ts +++ b/lib/modules/manager/bazel/update.ts @@ -93,7 +93,7 @@ export async function updateDependency({ }: UpdateDependencyConfig): Promise { try { logger.debug( - `bazel.updateDependency(): ${upgrade.newValue || upgrade.newDigest}` + `bazel.updateDependency(): ${upgrade.newValue ?? upgrade.newDigest}` ); let newDef: string | undefined; if (upgrade.depType === 'container_pull' && upgrade.managerData?.def) { diff --git a/lib/modules/manager/bundler/extract.ts b/lib/modules/manager/bundler/extract.ts index e61e0816a10bf8..858c6a5ff81a8e 100644 --- a/lib/modules/manager/bundler/extract.ts +++ b/lib/modules/manager/bundler/extract.ts @@ -25,7 +25,7 @@ export async function extractPackageFile( let sourceMatch: RegExpMatchArray | null = null; for (const delimiter of delimiters) { sourceMatch = - sourceMatch || + sourceMatch ?? regEx(`^source ${delimiter}([^${delimiter}]+)${delimiter}\\s*$`).exec( line ); diff --git a/lib/modules/manager/composer/artifacts.ts b/lib/modules/manager/composer/artifacts.ts index 0ac7c6ef0a77a7..821366d7189ac1 100644 --- a/lib/modules/manager/composer/artifacts.ts +++ b/lib/modules/manager/composer/artifacts.ts @@ -47,13 +47,13 @@ function getAuthJson(): string | null { .findAll({ hostType: PlatformId.Gitlab }) ?.forEach((gitlabHostRule) => { if (gitlabHostRule?.token) { - const host = gitlabHostRule.resolvedHost || 'gitlab.com'; - authJson['gitlab-token'] = authJson['gitlab-token'] || {}; + const host = gitlabHostRule.resolvedHost ?? 'gitlab.com'; + authJson['gitlab-token'] = authJson['gitlab-token'] ?? {}; authJson['gitlab-token'][host] = gitlabHostRule.token; // https://getcomposer.org/doc/articles/authentication-for-private-packages.md#gitlab-token authJson['gitlab-domains'] = [ host, - ...(authJson['gitlab-domains'] || []), + ...(authJson['gitlab-domains'] ?? []), ]; } }); @@ -63,10 +63,10 @@ function getAuthJson(): string | null { ?.forEach((hostRule) => { const { resolvedHost, username, password, token } = hostRule; if (resolvedHost && username && password) { - authJson['http-basic'] = authJson['http-basic'] || {}; + authJson['http-basic'] = authJson['http-basic'] ?? {}; authJson['http-basic'][resolvedHost] = { username, password }; } else if (resolvedHost && token) { - authJson.bearer = authJson.bearer || {}; + authJson.bearer = authJson.bearer ?? {}; authJson.bearer[resolvedHost] = token; } }); diff --git a/lib/modules/manager/docker-compose/extract.ts b/lib/modules/manager/docker-compose/extract.ts index 503d65f7d50b60..0e8bfddb50abe2 100644 --- a/lib/modules/manager/docker-compose/extract.ts +++ b/lib/modules/manager/docker-compose/extract.ts @@ -64,7 +64,7 @@ export function extractPackageFile( // since docker-compose spec version 1.27, the 'version' key has // become optional and can no longer be used to differentiate // between v1 and v2. - const services = config.services || config; + const services = config.services ?? config; // Image name/tags for services are only eligible for update if they don't // use variables and if the image is not built locally diff --git a/lib/modules/manager/gradle/extract/catalog.ts b/lib/modules/manager/gradle/extract/catalog.ts index 1a556836964e12..61a30646a851a8 100644 --- a/lib/modules/manager/gradle/extract/catalog.ts +++ b/lib/modules/manager/gradle/extract/catalog.ts @@ -233,8 +233,8 @@ export function parseCatalog( content: string ): PackageDependency[] { const tomlContent = parse(content) as GradleCatalog; - const versions = tomlContent.versions || {}; - const libs = tomlContent.libraries || {}; + const versions = tomlContent.versions ?? {}; + const libs = tomlContent.libraries ?? {}; const libStartIndex = content.indexOf('libraries'); const libSubContent = content.slice(libStartIndex); const versionStartIndex = content.indexOf('versions'); @@ -254,7 +254,7 @@ export function parseCatalog( extractedDeps.push(dependency); } - const plugins = tomlContent.plugins || {}; + const plugins = tomlContent.plugins ?? {}; const pluginsStartIndex = content.indexOf('[plugins]'); const pluginsSubContent = content.slice(pluginsStartIndex); for (const pluginName of Object.keys(plugins)) { diff --git a/lib/modules/manager/leiningen/extract.ts b/lib/modules/manager/leiningen/extract.ts index ba22abc15de38b..0f89e5b465a845 100644 --- a/lib/modules/manager/leiningen/extract.ts +++ b/lib/modules/manager/leiningen/extract.ts @@ -127,7 +127,7 @@ function extractLeinRepos(content: string): string[] { } const repoSectionContent = repoContent.slice(0, endIdx); const matches = - repoSectionContent.match(regEx(/"https?:\/\/[^"]*"/g)) || []; + repoSectionContent.match(regEx(/"https?:\/\/[^"]*"/g)) ?? []; const urls = matches.map((x) => x.replace(regEx(/^"/), '').replace(regEx(/"$/), '') ); diff --git a/lib/modules/manager/mix/extract.ts b/lib/modules/manager/mix/extract.ts index 5b69f71f5f508f..c8b0815f65356a 100644 --- a/lib/modules/manager/mix/extract.ts +++ b/lib/modules/manager/mix/extract.ts @@ -57,7 +57,7 @@ export async function extractPackageFile( } const res: PackageFile = { deps }; const lockFileName = - (await findLocalSiblingOrParent(fileName, 'mix.lock')) || 'mix.lock'; + (await findLocalSiblingOrParent(fileName, 'mix.lock')) ?? 'mix.lock'; // istanbul ignore if if (await localPathExists(lockFileName)) { res.lockFiles = [lockFileName]; diff --git a/lib/modules/manager/nuget/artifacts.ts b/lib/modules/manager/nuget/artifacts.ts index aef764c406b209..f5c89bc99b8789 100644 --- a/lib/modules/manager/nuget/artifacts.ts +++ b/lib/modules/manager/nuget/artifacts.ts @@ -35,7 +35,7 @@ async function addSourceCmds( nugetConfigFile: string ): Promise { const registries = - (await getConfiguredRegistries(packageFileName)) || getDefaultRegistries(); + (await getConfiguredRegistries(packageFileName)) ?? getDefaultRegistries(); const result: string[] = []; for (const registry of registries) { const { username, password } = hostRules.find({ diff --git a/lib/modules/manager/poetry/update-locked.ts b/lib/modules/manager/poetry/update-locked.ts index 0bda7b89e75757..a582b11675c5c0 100644 --- a/lib/modules/manager/poetry/update-locked.ts +++ b/lib/modules/manager/poetry/update-locked.ts @@ -10,7 +10,7 @@ export function updateLockedDependency( logger.debug( `poetry.updateLockedDependency: ${depName}@${currentVersion} -> ${newVersion} [${lockFile}]` ); - const locked = extractLockFileEntries(lockFileContent || ''); + const locked = extractLockFileEntries(lockFileContent ?? ''); if (depName && locked[depName] === newVersion) { return { status: 'already-updated' }; } diff --git a/lib/modules/manager/regex/strategies.ts b/lib/modules/manager/regex/strategies.ts index 211eef7c6e3356..13f07260e011a1 100644 --- a/lib/modules/manager/regex/strategies.ts +++ b/lib/modules/manager/regex/strategies.ts @@ -79,7 +79,7 @@ export function handleRecursive( packageFile, config, index + 1, - mergeGroups(combinedGroups, match.groups || {}) + mergeGroups(combinedGroups, match.groups ?? {}) ); }) .filter(is.truthy); diff --git a/lib/modules/manager/regex/utils.ts b/lib/modules/manager/regex/utils.ts index 772c52ccb59654..9efd4946cc4ce8 100644 --- a/lib/modules/manager/regex/utils.ts +++ b/lib/modules/manager/regex/utils.ts @@ -24,7 +24,7 @@ export function createDependency( config: CustomExtractConfig, dep?: PackageDependency ): PackageDependency | null { - const dependency = dep || {}; + const dependency = dep ?? {}; const { groups, replaceString } = extractionTemplate; function updateDependency(field: ValidMatchFields, value: string): void { diff --git a/lib/modules/manager/setup-cfg/extract.ts b/lib/modules/manager/setup-cfg/extract.ts index fde51f973733f2..2b458fb180c6f3 100644 --- a/lib/modules/manager/setup-cfg/extract.ts +++ b/lib/modules/manager/setup-cfg/extract.ts @@ -6,12 +6,12 @@ import { PypiDatasource } from '../../datasource/pypi'; import type { PackageDependency, PackageFile, Result } from '../types'; function getSectionName(str: string): string { - const [, sectionName] = regEx(/^\[\s*([^\s]+)\s*]\s*$/).exec(str) || []; + const [, sectionName] = regEx(/^\[\s*([^\s]+)\s*]\s*$/).exec(str) ?? []; return sectionName; } function getSectionRecord(str: string): string { - const [, sectionRecord] = regEx(/^([^\s]+)\s+=/).exec(str) || []; + const [, sectionRecord] = regEx(/^([^\s]+)\s+=/).exec(str) ?? []; return sectionRecord; } @@ -62,7 +62,7 @@ function parseDep( const [lineNoEnvMarkers] = line.split(';').map((part) => part.trim()); const packageMatches = - pkgValRegex.exec(lineNoEnvMarkers) || pkgRegex.exec(lineNoEnvMarkers); + pkgValRegex.exec(lineNoEnvMarkers) ?? pkgRegex.exec(lineNoEnvMarkers); if (!packageMatches) { return null; diff --git a/lib/modules/manager/terraform/extract/kubernetes.ts b/lib/modules/manager/terraform/extract/kubernetes.ts index dee54e8fb0e29e..b7cb79b3d68d84 100644 --- a/lib/modules/manager/terraform/extract/kubernetes.ts +++ b/lib/modules/manager/terraform/extract/kubernetes.ts @@ -31,8 +31,8 @@ export function extractTerraformKubernetesResource( // istanbul ignore else if (is.string(line)) { // `{` will be counted with +1 and `}` with -1. Therefore if we reach braceCounter == 0. We have found the end of the terraform block - const openBrackets = (line.match(regEx(/\{/g)) || []).length; - const closedBrackets = (line.match(regEx(/\}/g)) || []).length; + const openBrackets = (line.match(regEx(/\{/g)) ?? []).length; + const closedBrackets = (line.match(regEx(/\}/g)) ?? []).length; braceCounter = braceCounter + openBrackets - closedBrackets; if (line.match(regEx(/^\s*(?:init_)?container(?:\s*\{|$)/s))) { diff --git a/lib/modules/manager/terraform/required-version.ts b/lib/modules/manager/terraform/required-version.ts index 9b6063e5489b70..f958217bc3b4ff 100644 --- a/lib/modules/manager/terraform/required-version.ts +++ b/lib/modules/manager/terraform/required-version.ts @@ -21,8 +21,8 @@ export function extractTerraformRequiredVersion( const line = lines[lineNumber]; // `{` will be counted wit +1 and `}` with -1. Therefore if we reach braceCounter == 0. We have found the end of the terraform block - const openBrackets = (line.match(regEx(/\{/g)) || []).length; - const closedBrackets = (line.match(regEx(/\}/g)) || []).length; + const openBrackets = (line.match(regEx(/\{/g)) ?? []).length; + const closedBrackets = (line.match(regEx(/\}/g)) ?? []).length; braceCounter = braceCounter + openBrackets - closedBrackets; const kvMatch = keyValueExtractionRegex.exec(line); diff --git a/lib/modules/platform/bitbucket/index.spec.ts b/lib/modules/platform/bitbucket/index.spec.ts index 306a5d385f834f..b9fdcfb80eefab 100644 --- a/lib/modules/platform/bitbucket/index.spec.ts +++ b/lib/modules/platform/bitbucket/index.spec.ts @@ -50,9 +50,9 @@ describe('modules/platform/bitbucket/index', () => { repoResp?: any, existingScope?: httpMock.Scope ): Promise { - const repository = config?.repository || 'some/repo'; + const repository = config?.repository ?? 'some/repo'; - const scope = existingScope || httpMock.scope(baseUrl); + const scope = existingScope ?? httpMock.scope(baseUrl); scope.get(`/2.0/repositories/${repository}`).reply(200, { owner: {}, diff --git a/lib/modules/platform/gitlab/index.spec.ts b/lib/modules/platform/gitlab/index.spec.ts index 2a5467d18e64c0..4292c28de1a775 100644 --- a/lib/modules/platform/gitlab/index.spec.ts +++ b/lib/modules/platform/gitlab/index.spec.ts @@ -180,7 +180,7 @@ describe('modules/platform/gitlab/index', () => { const justRepo = repo.split('/').slice(0, 2).join('/'); scope.get(`/api/v4/projects/${encodeURIComponent(repo)}`).reply( 200, - repoResp || { + repoResp ?? { default_branch: 'master', http_url_to_repo: `https://gitlab.com/${justRepo}.git`, } diff --git a/lib/modules/versioning/conan/range.ts b/lib/modules/versioning/conan/range.ts index 769fcc69cb464b..11e77a84422758 100644 --- a/lib/modules/versioning/conan/range.ts +++ b/lib/modules/versioning/conan/range.ts @@ -89,7 +89,7 @@ export function fixParsedRange(range: string): any { major, }; - let full = `${operator || ''}${major}`; + let full = `${operator ?? ''}${major}`; if (minor) { NewSemVer.minor = minor; full = `${full}.${minor}`; diff --git a/lib/modules/versioning/node/schedule.ts b/lib/modules/versioning/node/schedule.ts index b346b5af2ebb17..fb45860c004265 100644 --- a/lib/modules/versioning/node/schedule.ts +++ b/lib/modules/versioning/node/schedule.ts @@ -31,7 +31,7 @@ for (const version of Object.keys(nodeSchedule)) { export function findScheduleForCodename( codename: string ): NodeJsScheduleWithVersion | null { - return nodeCodenames.get(codename?.toUpperCase()) || null; + return nodeCodenames.get(codename?.toUpperCase()) ?? null; } export function findScheduleForVersion(version: string): NodeJsSchedule | null { diff --git a/lib/modules/versioning/pep440/range.ts b/lib/modules/versioning/pep440/range.ts index ca7efbad6ce5e3..ab112037079b31 100644 --- a/lib/modules/versioning/pep440/range.ts +++ b/lib/modules/versioning/pep440/range.ts @@ -70,7 +70,7 @@ function getFutureVersion( ): number[] { const toRelease: number[] = parseVersion(newVersion)?.release ?? []; const baseRelease: number[] = - parseVersion(baseVersion || newVersion)?.release ?? []; + parseVersion(baseVersion ?? newVersion)?.release ?? []; return baseRelease.map((_, index) => { const toPart: number = toRelease[index] ?? 0; if (index < policy) { diff --git a/lib/util/package-rules.ts b/lib/util/package-rules.ts index 64932b25108c39..5447e82fd2a9a5 100644 --- a/lib/util/package-rules.ts +++ b/lib/util/package-rules.ts @@ -29,25 +29,25 @@ function matchesRule( manager, datasource, } = inputConfig; - const unconstrainedValue = lockedVersion && is.undefined(currentValue); + const unconstrainedValue = !!lockedVersion && is.undefined(currentValue); // Setting empty arrays simplifies our logic later - const matchFiles = packageRule.matchFiles || []; - const matchPaths = packageRule.matchPaths || []; - const matchLanguages = packageRule.matchLanguages || []; - const matchBaseBranches = packageRule.matchBaseBranches || []; - const matchManagers = packageRule.matchManagers || []; - const matchDatasources = packageRule.matchDatasources || []; - const matchDepTypes = packageRule.matchDepTypes || []; - const matchPackageNames = packageRule.matchPackageNames || []; - let matchPackagePatterns = packageRule.matchPackagePatterns || []; - const matchPackagePrefixes = packageRule.matchPackagePrefixes || []; - const excludePackageNames = packageRule.excludePackageNames || []; - const excludePackagePatterns = packageRule.excludePackagePatterns || []; - const excludePackagePrefixes = packageRule.excludePackagePrefixes || []; - const matchSourceUrlPrefixes = packageRule.matchSourceUrlPrefixes || []; - const matchSourceUrls = packageRule.matchSourceUrls || []; - const matchCurrentVersion = packageRule.matchCurrentVersion || null; - const matchUpdateTypes = packageRule.matchUpdateTypes || []; + const matchFiles = packageRule.matchFiles ?? []; + const matchPaths = packageRule.matchPaths ?? []; + const matchLanguages = packageRule.matchLanguages ?? []; + const matchBaseBranches = packageRule.matchBaseBranches ?? []; + const matchManagers = packageRule.matchManagers ?? []; + const matchDatasources = packageRule.matchDatasources ?? []; + const matchDepTypes = packageRule.matchDepTypes ?? []; + const matchPackageNames = packageRule.matchPackageNames ?? []; + let matchPackagePatterns = packageRule.matchPackagePatterns ?? []; + const matchPackagePrefixes = packageRule.matchPackagePrefixes ?? []; + const excludePackageNames = packageRule.excludePackageNames ?? []; + const excludePackagePatterns = packageRule.excludePackagePatterns ?? []; + const excludePackagePrefixes = packageRule.excludePackagePrefixes ?? []; + const matchSourceUrlPrefixes = packageRule.matchSourceUrlPrefixes ?? []; + const matchSourceUrls = packageRule.matchSourceUrls ?? []; + const matchCurrentVersion = packageRule.matchCurrentVersion ?? null; + const matchUpdateTypes = packageRule.matchUpdateTypes ?? []; let positiveMatch = false; // Massage a positive patterns patch if an exclude one is present if ( @@ -269,7 +269,7 @@ function matchesRule( const compareVersion = currentValue && version.isVersion(currentValue) ? currentValue // it's a version so we can match against it - : lockedVersion || currentVersion; // need to match against this currentVersion, if available + : lockedVersion ?? currentVersion; // need to match against this currentVersion, if available if (compareVersion) { // istanbul ignore next if (version.isVersion(compareVersion)) { @@ -298,7 +298,7 @@ export function applyPackageRules( inputConfig: T ): T { let config = { ...inputConfig }; - const packageRules = config.packageRules || []; + const packageRules = config.packageRules ?? []; logger.trace( { dependency: config.depName, packageRules }, `Checking against ${packageRules.length} packageRules` diff --git a/lib/workers/global/limits.ts b/lib/workers/global/limits.ts index 6e410dd2204dcb..c81c2d5d1f16fa 100644 --- a/lib/workers/global/limits.ts +++ b/lib/workers/global/limits.ts @@ -25,7 +25,7 @@ export function setMaxLimit(key: Limit, val: unknown): void { } export function incLimitedValue(key: Limit, incBy = 1): void { - const limit = limits.get(key) || { max: null, current: 0 }; + const limit = limits.get(key) ?? { max: null, current: 0 }; limits.set(key, { ...limit, current: limit.current + incBy, diff --git a/lib/workers/repository/cache.ts b/lib/workers/repository/cache.ts index 49f0deb3bf61a1..c651af91a70435 100644 --- a/lib/workers/repository/cache.ts +++ b/lib/workers/repository/cache.ts @@ -49,7 +49,7 @@ async function generateBranchCache( ): Promise { const { branchName } = branch; try { - const sha = getBranchCommit(branchName) || null; + const sha = getBranchCommit(branchName) ?? null; let prNo = null; let parentSha = null; if (sha) { diff --git a/lib/workers/repository/update/pr/body/index.ts b/lib/workers/repository/update/pr/body/index.ts index 7e277179127c9c..4afbf92cf75939 100644 --- a/lib/workers/repository/update/pr/body/index.ts +++ b/lib/workers/repository/update/pr/body/index.ts @@ -21,7 +21,7 @@ function massageUpdateMetadata(config: BranchConfig): void { dependencyUrl, } = upgrade; let depNameLinked = upgrade.depName; - const primaryLink = homepage || sourceUrl || dependencyUrl; + const primaryLink = homepage ?? sourceUrl ?? dependencyUrl; if (primaryLink) { depNameLinked = `[${depNameLinked}](${primaryLink})`; } diff --git a/lib/workers/repository/update/pr/code-owners.ts b/lib/workers/repository/update/pr/code-owners.ts index 80f3daeb2c1ad5..081fa6797e0a0a 100644 --- a/lib/workers/repository/update/pr/code-owners.ts +++ b/lib/workers/repository/update/pr/code-owners.ts @@ -9,9 +9,9 @@ export async function codeOwnersForPr(pr: Pr): Promise { logger.debug('Searching for CODEOWNERS file'); try { const codeOwnersFile = - (await readLocalFile('CODEOWNERS', 'utf8')) || - (await readLocalFile('.github/CODEOWNERS', 'utf8')) || - (await readLocalFile('.gitlab/CODEOWNERS', 'utf8')) || + (await readLocalFile('CODEOWNERS', 'utf8')) ?? + (await readLocalFile('.github/CODEOWNERS', 'utf8')) ?? + (await readLocalFile('.gitlab/CODEOWNERS', 'utf8')) ?? (await readLocalFile('docs/CODEOWNERS', 'utf8')); if (!codeOwnersFile) { diff --git a/lib/workers/repository/update/pr/index.ts b/lib/workers/repository/update/pr/index.ts index ce4f4cf7d2d476..33a6adabbded1b 100644 --- a/lib/workers/repository/update/pr/index.ts +++ b/lib/workers/repository/update/pr/index.ts @@ -180,7 +180,7 @@ export async function ensurePr( for (const upgrade of upgrades) { const upgradeKey = `${upgrade.depType}-${upgrade.depName}-${ upgrade.manager - }-${upgrade.currentVersion || upgrade.currentValue}-${upgrade.newVersion}`; + }-${upgrade.currentVersion ?? upgrade.currentValue}-${upgrade.newVersion}`; if (processedUpgrades.includes(upgradeKey)) { continue; } diff --git a/test/website-docs.spec.ts b/test/website-docs.spec.ts index 98195ba353ce3b..a856acf2d55fc3 100644 --- a/test/website-docs.spec.ts +++ b/test/website-docs.spec.ts @@ -42,7 +42,7 @@ describe('website-docs', () => { .sort(); const selfHostExpectedOptions = options - .filter((option) => option.globalOnly || option.stage === 'global') + .filter((option) => !!option.globalOnly || option.stage === 'global') .map((option) => option.name) .sort(); From 58084bc0668148cefd6a0a353bbf940bc20473d7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 21 Jun 2022 14:10:48 +0000 Subject: [PATCH 156/240] chore(deps): update dependency prettier to v2.7.0 (#16170) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Rhys Arkins --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 51115456ebe5ac..f7ec8426ea35ee 100644 --- a/package.json +++ b/package.json @@ -291,7 +291,7 @@ "mockdate": "3.0.5", "nock": "13.2.6", "npm-run-all": "4.1.5", - "prettier": "2.6.2", + "prettier": "2.7.0", "pretty-quick": "3.1.3", "rimraf": "3.0.2", "semantic-release": "19.0.3", diff --git a/yarn.lock b/yarn.lock index 8c877d26ff09bf..6a2b981215a9cb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7975,10 +7975,10 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prettier@2.6.2: - version "2.6.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.2.tgz#e26d71a18a74c3d0f0597f55f01fb6c06c206032" - integrity sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew== +prettier@2.7.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.0.tgz#a4fdae07e5596c51c9857ea676cd41a0163879d6" + integrity sha512-nwoX4GMFgxoPC6diHvSwmK/4yU8FFH3V8XWtLQrbj4IBsK2pkYhG4kf/ljF/haaZ/aii+wNJqISrCDPgxGWDVQ== pretty-bytes@^5.1.0: version "5.6.0" From 49e5aa5b69a2439a6090b9aad21f81f646fb63cf Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 21 Jun 2022 14:23:40 +0000 Subject: [PATCH 157/240] chore(deps): update linters to v5.28.0 (#16159) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 4 +-- yarn.lock | 86 ++++++++++++---------------------------------------- 2 files changed, 22 insertions(+), 68 deletions(-) diff --git a/package.json b/package.json index f7ec8426ea35ee..1ae54462f5736c 100644 --- a/package.json +++ b/package.json @@ -259,8 +259,8 @@ "@types/url-join": "4.0.1", "@types/validate-npm-package-name": "3.0.3", "@types/xmldoc": "1.1.6", - "@typescript-eslint/eslint-plugin": "5.27.1", - "@typescript-eslint/parser": "5.27.1", + "@typescript-eslint/eslint-plugin": "5.28.0", + "@typescript-eslint/parser": "5.28.0", "aws-sdk-client-mock": "1.0.0", "callsite": "1.0.0", "conventional-changelog-conventionalcommits": "5.0.0", diff --git a/yarn.lock b/yarn.lock index 6a2b981215a9cb..34963d700fff21 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2784,14 +2784,14 @@ dependencies: "@types/node" "*" -"@typescript-eslint/eslint-plugin@5.27.1": - version "5.27.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.27.1.tgz#fdf59c905354139046b41b3ed95d1609913d0758" - integrity sha512-6dM5NKT57ZduNnJfpY81Phe9nc9wolnMCnknb1im6brWi1RYv84nbMS3olJa27B6+irUVV1X/Wb+Am0FjJdGFw== - dependencies: - "@typescript-eslint/scope-manager" "5.27.1" - "@typescript-eslint/type-utils" "5.27.1" - "@typescript-eslint/utils" "5.27.1" +"@typescript-eslint/eslint-plugin@5.28.0": + version "5.28.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.28.0.tgz#6204ac33bdd05ab27c7f77960f1023951115d403" + integrity sha512-DXVU6Cg29H2M6EybqSg2A+x8DgO9TCUBRp4QEXQHJceLS7ogVDP0g3Lkg/SZCqcvkAP/RruuQqK0gdlkgmhSUA== + dependencies: + "@typescript-eslint/scope-manager" "5.28.0" + "@typescript-eslint/type-utils" "5.28.0" + "@typescript-eslint/utils" "5.28.0" debug "^4.3.4" functional-red-black-tree "^1.0.1" ignore "^5.2.0" @@ -2806,24 +2806,16 @@ dependencies: "@typescript-eslint/utils" "5.28.0" -"@typescript-eslint/parser@5.27.1": - version "5.27.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.27.1.tgz#3a4dcaa67e45e0427b6ca7bb7165122c8b569639" - integrity sha512-7Va2ZOkHi5NP+AZwb5ReLgNF6nWLGTeUJfxdkVUAPPSaAdbWNnFZzLZ4EGGmmiCTg+AwlbE1KyUYTBglosSLHQ== +"@typescript-eslint/parser@5.28.0": + version "5.28.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.28.0.tgz#639b101cad2bfb7ae16e69710ac95c42bd4eae33" + integrity sha512-ekqoNRNK1lAcKhZESN/PdpVsWbP9jtiNqzFWkp/yAUdZvJalw2heCYuqRmM5eUJSIYEkgq5sGOjq+ZqsLMjtRA== dependencies: - "@typescript-eslint/scope-manager" "5.27.1" - "@typescript-eslint/types" "5.27.1" - "@typescript-eslint/typescript-estree" "5.27.1" + "@typescript-eslint/scope-manager" "5.28.0" + "@typescript-eslint/types" "5.28.0" + "@typescript-eslint/typescript-estree" "5.28.0" debug "^4.3.4" -"@typescript-eslint/scope-manager@5.27.1": - version "5.27.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.27.1.tgz#4d1504392d01fe5f76f4a5825991ec78b7b7894d" - integrity sha512-fQEOSa/QroWE6fAEg+bJxtRZJTH8NTskggybogHt4H9Da8zd4cJji76gA5SBlR0MgtwF7rebxTbDKB49YUCpAg== - dependencies: - "@typescript-eslint/types" "5.27.1" - "@typescript-eslint/visitor-keys" "5.27.1" - "@typescript-eslint/scope-manager@5.28.0": version "5.28.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.28.0.tgz#ef9a5c68fecde72fd2ff8a84b9c120324826c1b9" @@ -2832,38 +2824,20 @@ "@typescript-eslint/types" "5.28.0" "@typescript-eslint/visitor-keys" "5.28.0" -"@typescript-eslint/type-utils@5.27.1": - version "5.27.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.27.1.tgz#369f695199f74c1876e395ebea202582eb1d4166" - integrity sha512-+UC1vVUWaDHRnC2cQrCJ4QtVjpjjCgjNFpg8b03nERmkHv9JV9X5M19D7UFMd+/G7T/sgFwX2pGmWK38rqyvXw== +"@typescript-eslint/type-utils@5.28.0": + version "5.28.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.28.0.tgz#53ccc78fdcf0205ef544d843b84104c0e9c7ca8e" + integrity sha512-SyKjKh4CXPglueyC6ceAFytjYWMoPHMswPQae236zqe1YbhvCVQyIawesYywGiu98L9DwrxsBN69vGIVxJ4mQQ== dependencies: - "@typescript-eslint/utils" "5.27.1" + "@typescript-eslint/utils" "5.28.0" debug "^4.3.4" tsutils "^3.21.0" -"@typescript-eslint/types@5.27.1": - version "5.27.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.27.1.tgz#34e3e629501349d38be6ae97841298c03a6ffbf1" - integrity sha512-LgogNVkBhCTZU/m8XgEYIWICD6m4dmEDbKXESCbqOXfKZxRKeqpiJXQIErv66sdopRKZPo5l32ymNqibYEH/xg== - "@typescript-eslint/types@5.28.0": version "5.28.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.28.0.tgz#cffd9bcdce28db6daaa146e48a0be4387a6f4e9d" integrity sha512-2OOm8ZTOQxqkPbf+DAo8oc16sDlVR5owgJfKheBkxBKg1vAfw2JsSofH9+16VPlN9PWtv8Wzhklkqw3k/zCVxA== -"@typescript-eslint/typescript-estree@5.27.1": - version "5.27.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.27.1.tgz#7621ee78607331821c16fffc21fc7a452d7bc808" - integrity sha512-DnZvvq3TAJ5ke+hk0LklvxwYsnXpRdqUY5gaVS0D4raKtbznPz71UJGnPTHEFo0GDxqLOLdMkkmVZjSpET1hFw== - dependencies: - "@typescript-eslint/types" "5.27.1" - "@typescript-eslint/visitor-keys" "5.27.1" - debug "^4.3.4" - globby "^11.1.0" - is-glob "^4.0.3" - semver "^7.3.7" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@5.28.0": version "5.28.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.28.0.tgz#3487d158d091ca2772b285e67412ff6d9797d863" @@ -2877,18 +2851,6 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.27.1": - version "5.27.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.27.1.tgz#b4678b68a94bc3b85bf08f243812a6868ac5128f" - integrity sha512-mZ9WEn1ZLDaVrhRaYgzbkXBkTPghPFsup8zDbbsYTxC5OmqrFE7skkKS/sraVsLP3TcT3Ki5CSyEFBRkLH/H/w== - dependencies: - "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.27.1" - "@typescript-eslint/types" "5.27.1" - "@typescript-eslint/typescript-estree" "5.27.1" - eslint-scope "^5.1.1" - eslint-utils "^3.0.0" - "@typescript-eslint/utils@5.28.0", "@typescript-eslint/utils@^5.10.0": version "5.28.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.28.0.tgz#b27a136eac300a48160b36d2aad0da44a1341b99" @@ -2901,14 +2863,6 @@ eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/visitor-keys@5.27.1": - version "5.27.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.27.1.tgz#05a62666f2a89769dac2e6baa48f74e8472983af" - integrity sha512-xYs6ffo01nhdJgPieyk7HAOpjhTsx7r/oB9LWEhwAXgwn33tkr+W8DI2ChboqhZlC4q3TC6geDYPoiX8ROqyOQ== - dependencies: - "@typescript-eslint/types" "5.27.1" - eslint-visitor-keys "^3.3.0" - "@typescript-eslint/visitor-keys@5.28.0": version "5.28.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.28.0.tgz#982bb226b763c48fc1859a60de33fbf939d40a0f" From a5221f358632d1b4a5e896477dc36015c4f54ace Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 21 Jun 2022 14:37:27 +0000 Subject: [PATCH 158/240] chore(deps): update github/codeql-action action to v2.1.13 (#16169) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/codeql-analysis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 943ff43f13b87a..7c4f13c7cc466b 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -30,7 +30,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@27ea8f8fe5977c00f5b37e076ab846c5bd783b96 # tag=v2.1.12 + uses: github/codeql-action/init@d00e8c09a38ef8c1ca1091fc55ef490776d2de73 # tag=v2.1.13 with: languages: javascript @@ -40,7 +40,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@27ea8f8fe5977c00f5b37e076ab846c5bd783b96 # tag=v2.1.12 + uses: github/codeql-action/autobuild@d00e8c09a38ef8c1ca1091fc55ef490776d2de73 # tag=v2.1.13 # ℹī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -54,4 +54,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@27ea8f8fe5977c00f5b37e076ab846c5bd783b96 # tag=v2.1.12 + uses: github/codeql-action/analyze@d00e8c09a38ef8c1ca1091fc55ef490776d2de73 # tag=v2.1.13 From f023e59d8876d8cdbb643db96f9b31d5692d51bd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 21 Jun 2022 14:50:11 +0000 Subject: [PATCH 159/240] chore(deps): update dependency ts-jest to v28.0.5 (#16162) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 1ae54462f5736c..4014fd6f85ed09 100644 --- a/package.json +++ b/package.json @@ -298,7 +298,7 @@ "shelljs": "0.8.5", "strip-ansi": "6.0.1", "tmp-promise": "3.0.3", - "ts-jest": "28.0.4", + "ts-jest": "28.0.5", "ts-node": "10.8.1", "type-fest": "2.12.2", "typescript": "4.7.3", diff --git a/yarn.lock b/yarn.lock index 34963d700fff21..f4daa586348842 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9133,10 +9133,10 @@ ts-essentials@^7.0.3: resolved "https://registry.yarnpkg.com/ts-essentials/-/ts-essentials-7.0.3.tgz#686fd155a02133eedcc5362dc8b5056cde3e5a38" integrity sha512-8+gr5+lqO3G84KdiTSMRLtuyJ+nTBVRKuCrK4lidMPdVeEp0uqC875uE5NMcaA7YYMN7XsNiFQuMvasF8HT/xQ== -ts-jest@28.0.4: - version "28.0.4" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-28.0.4.tgz#0ab705a60fc4b9f3506f35e26edfa9e9c915c31b" - integrity sha512-S6uRDDdCJBvnZqyGjB4VCnwbQrbgdL8WPeP4jevVSpYsBaeGRQAIS08o3Svav2Ex+oXwLgJ/m7F24TNq62kA1A== +ts-jest@28.0.5: + version "28.0.5" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-28.0.5.tgz#31776f768fba6dfc8c061d488840ed0c8eeac8b9" + integrity sha512-Sx9FyP9pCY7pUzQpy4FgRZf2bhHY3za576HMKJFs+OnQ9jS96Du5vNsDKkyedQkik+sEabbKAnCliv9BEsHZgQ== dependencies: bs-logger "0.x" fast-json-stable-stringify "2.x" @@ -9145,7 +9145,7 @@ ts-jest@28.0.4: lodash.memoize "4.x" make-error "1.x" semver "7.x" - yargs-parser "^20.x" + yargs-parser "^21.0.1" ts-node@10.8.1: version "10.8.1" @@ -9645,12 +9645,12 @@ yargs-parser@^18.1.3: camelcase "^5.0.0" decamelize "^1.2.0" -yargs-parser@^20.2.2, yargs-parser@^20.2.3, yargs-parser@^20.x: +yargs-parser@^20.2.2, yargs-parser@^20.2.3: version "20.2.9" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== -yargs-parser@^21.0.0: +yargs-parser@^21.0.0, yargs-parser@^21.0.1: version "21.0.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.0.1.tgz#0267f286c877a4f0f728fceb6f8a3e4cb95c6e35" integrity sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg== From 1b6e16dd22dcb9f5c2088dd3a847f2bbe28cd4d0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 22 Jun 2022 01:03:52 +0000 Subject: [PATCH 160/240] chore(deps): update dependency @types/node to v16.11.40 (#16177) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 4014fd6f85ed09..1a1cb013891665 100644 --- a/package.json +++ b/package.json @@ -249,7 +249,7 @@ "@types/marshal": "0.5.1", "@types/moo": "0.5.5", "@types/nock": "10.0.3", - "@types/node": "16.11.39", + "@types/node": "16.11.40", "@types/parse-link-header": "2.0.0", "@types/semver": "7.3.9", "@types/semver-stable": "3.0.0", diff --git a/yarn.lock b/yarn.lock index f4daa586348842..cd27e385ae7fcc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2641,10 +2641,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-18.0.0.tgz#67c7b724e1bcdd7a8821ce0d5ee184d3b4dd525a" integrity sha512-cHlGmko4gWLVI27cGJntjs/Sj8th9aYwplmZFwmmgYQQvL5NUsgVJG7OddLvNfLqYS31KFN0s3qlaD9qCaxACA== -"@types/node@16.11.39": - version "16.11.39" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.39.tgz#07223cd2bc332ad9d92135e3a522eebdee3b060e" - integrity sha512-K0MsdV42vPwm9L6UwhIxMAOmcvH/1OoVkZyCgEtVu4Wx7sElGloy/W7kMBNe/oJ7V/jW9BVt1F6RahH6e7tPXw== +"@types/node@16.11.40": + version "16.11.40" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.40.tgz#bcf85f3febe74436107aeb2d3fb5fd0d30818600" + integrity sha512-7bOWglXUO6f21NG3YDI7hIpeMX3M59GG+DzZuzX2EkFKYUnRoxq3EOg4R0KNv2hxryY9M3UUqG5akwwsifrukw== "@types/node@^13.7.0": version "13.13.52" From 7dce99a91bf76f03b8a97d9222d5bb993b9ecbde Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 22 Jun 2022 01:15:36 +0000 Subject: [PATCH 161/240] chore(deps): update dependency nock to v13.2.7 (#16178) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 1a1cb013891665..f002fb3448a2cd 100644 --- a/package.json +++ b/package.json @@ -289,7 +289,7 @@ "memfs": "3.4.4", "mock-fs": "5.1.2", "mockdate": "3.0.5", - "nock": "13.2.6", + "nock": "13.2.7", "npm-run-all": "4.1.5", "prettier": "2.7.0", "pretty-quick": "3.1.3", diff --git a/yarn.lock b/yarn.lock index cd27e385ae7fcc..d1b99c7bd80e03 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7200,10 +7200,10 @@ nise@^5.1.0: just-extend "^4.0.2" path-to-regexp "^1.7.0" -nock@13.2.6: - version "13.2.6" - resolved "https://registry.yarnpkg.com/nock/-/nock-13.2.6.tgz#35e419cd9d385ffa67e59523d9699e41b29e1a03" - integrity sha512-GbyeSwSEP0FYouzETZ0l/XNm5tNcDNcXJKw3LCAb+mx8bZSwg1wEEvdL0FAyg5TkBJYiWSCtw6ag4XfmBy60FA== +nock@13.2.7: + version "13.2.7" + resolved "https://registry.yarnpkg.com/nock/-/nock-13.2.7.tgz#c93933b61df42f4f4b3a07fde946a4e209c0c168" + integrity sha512-R6NUw7RIPtKwgK7jskuKoEi4VFMqIHtV2Uu9K/Uegc4TA5cqe+oNMYslZcUmnVNQCTG6wcSqUBaGTDd7sq5srg== dependencies: debug "^4.1.0" json-stringify-safe "^5.0.1" From e46af631844ff00d22bc7dbebcafaa8fd829950d Mon Sep 17 00:00:00 2001 From: Gabriel-Ladzaretti <97394622+Gabriel-Ladzaretti@users.noreply.github.com> Date: Wed, 22 Jun 2022 05:19:15 +0300 Subject: [PATCH 162/240] fix(onboarding): Avoid workarounds descriptions in onboarding PRs (#16175) --- lib/config/presets/internal/workarounds.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/config/presets/internal/workarounds.ts b/lib/config/presets/internal/workarounds.ts index 70b4bcc1a53729..081c2c99d2ce9b 100644 --- a/lib/config/presets/internal/workarounds.ts +++ b/lib/config/presets/internal/workarounds.ts @@ -14,6 +14,7 @@ export const presets: Record = { 'workarounds:reduceRepologyServerLoad', 'workarounds:doNotUpgradeFromAlpineStableToEdge', ], + ignoreDeps: [], }, mavenCommonsAncientVersion: { description: 'Fix some problems with very old Maven commons versions', From 8901e724f30532ebe7f5da992eb70cc66e8f2df4 Mon Sep 17 00:00:00 2001 From: Jason Bedard Date: Tue, 21 Jun 2022 23:16:43 -0700 Subject: [PATCH 163/240] feat(bazel): add "maybe" macro support (#16003) --- .../manager/bazel/__fixtures__/WORKSPACE1 | 23 +++++ .../manager/bazel/__fixtures__/WORKSPACE2 | 10 ++- .../bazel/__fixtures__/repositories.bzl | 11 +++ .../bazel/__snapshots__/extract.spec.ts.snap | 88 +++++++++++++++++++ .../bazel/__snapshots__/update.spec.ts.snap | 23 +++++ lib/modules/manager/bazel/extract.spec.ts | 7 +- lib/modules/manager/bazel/extract.ts | 26 ++++-- lib/modules/manager/bazel/update.spec.ts | 87 +++++++++++++++++- 8 files changed, 263 insertions(+), 12 deletions(-) diff --git a/lib/modules/manager/bazel/__fixtures__/WORKSPACE1 b/lib/modules/manager/bazel/__fixtures__/WORKSPACE1 index 11078c7cc6f096..cc9884dd2a6d7c 100644 --- a/lib/modules/manager/bazel/__fixtures__/WORKSPACE1 +++ b/lib/modules/manager/bazel/__fixtures__/WORKSPACE1 @@ -105,6 +105,29 @@ http_archive( urls=["https://github.com/GoogleContainerTools/distroless/archive/446923c3756ceeaa75888f52fcbdd48bb314fbf8.tar.gz"] ) +load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") +maybe( + http_archive, + name = "io_bazel_rules_go", + sha256 = "2b1641428dff9018f9e85c0384f03ec6c10660d935b750e3fa1492a281a53b0f", + url = "https://github.com/bazelbuild/rules_go/releases/download/v0.29.0/rules_go-v0.29.0.zip", +) +maybe( + http_archive, + name = "bazel_gazelle", + sha256 = "de69a09dc70417580aabf20a28619bb3ef60d038470c7cf8442fafcf627c21cb", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz", + "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz", + ], +) +maybe( + go_repository, + name = "com_github_pkg_errors", + commit = "816c9085562cd7ee03e7f8188a1cfd942858cded", + importpath = "github.com/pkg/errors", +) + load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains") go_rules_dependencies() diff --git a/lib/modules/manager/bazel/__fixtures__/WORKSPACE2 b/lib/modules/manager/bazel/__fixtures__/WORKSPACE2 index 712be4f48078c5..0d82bf13789553 100644 --- a/lib/modules/manager/bazel/__fixtures__/WORKSPACE2 +++ b/lib/modules/manager/bazel/__fixtures__/WORKSPACE2 @@ -1,4 +1,5 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") http_archive( name = "GBDeviceInfo", @@ -28,4 +29,11 @@ http_archive( url = "https://github.com/nelhage/rules_boost/archive/135d46b4c9423ee7d494c78a21ff621bc73c12f3.zip", sha256 = "de8aac034cabe4a9ba5f7a33b9523862bf76c245a6c554c0e737f591bb7c7aeb", strip_prefix = "rules_boost-135d46b4c9423ee7d494c78a21ff621bc73c12f3", -) \ No newline at end of file +) + +maybe( + http_archive, + name = "io_bazel_rules_go", + sha256 = "2b1641428dff9018f9e85c0384f03ec6c10660d935b750e3fa1492a281a53b0f", + url = "https://github.com/bazelbuild/rules_go/releases/download/v0.29.0/rules_go-v0.29.0.zip", +) diff --git a/lib/modules/manager/bazel/__fixtures__/repositories.bzl b/lib/modules/manager/bazel/__fixtures__/repositories.bzl index 22e77421df7b5c..7e2819bbd949af 100644 --- a/lib/modules/manager/bazel/__fixtures__/repositories.bzl +++ b/lib/modules/manager/bazel/__fixtures__/repositories.bzl @@ -18,6 +18,7 @@ load( "http_archive", "http_file", ) +load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") load( "@io_bazel_rules_docker//toolchains/docker:toolchain.bzl", _docker_toolchain_configure = "toolchain_configure", @@ -210,6 +211,16 @@ py_library( urls = ["https://github.com/bazelbuild/bazel-skylib/archive/0.6.0.tar.gz"], ) + maybe( + http_archive, + name = "io_bazel_stardoc", + sha256 = "c9794dcc8026a30ff67cf7cf91ebe245ca294b20b071845d12c192afe243ad72", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/stardoc/releases/download/0.5.0/stardoc-0.5.0.tar.gz", + "https://github.com/bazelbuild/stardoc/releases/download/0.5.0/stardoc-0.5.0.tar.gz", + ], + ) + if "gzip" not in excludes: local_tool( name = "gzip", diff --git a/lib/modules/manager/bazel/__snapshots__/extract.spec.ts.snap b/lib/modules/manager/bazel/__snapshots__/extract.spec.ts.snap index 6c1d2bc9a1cebd..73caee37c68cbd 100644 --- a/lib/modules/manager/bazel/__snapshots__/extract.spec.ts.snap +++ b/lib/modules/manager/bazel/__snapshots__/extract.spec.ts.snap @@ -62,6 +62,25 @@ Array [ "packageName": "bazelbuild/bazel-skylib", "repo": "bazelbuild/bazel-skylib", }, + Object { + "currentValue": "0.5.0", + "datasource": "github-releases", + "depName": "io_bazel_stardoc", + "depType": "http_archive", + "managerData": Object { + "def": "maybe( + http_archive, + name = \\"io_bazel_stardoc\\", + sha256 = \\"c9794dcc8026a30ff67cf7cf91ebe245ca294b20b071845d12c192afe243ad72\\", + urls = [ + \\"https://mirror.bazel.build/github.com/bazelbuild/stardoc/releases/download/0.5.0/stardoc-0.5.0.tar.gz\\", + \\"https://github.com/bazelbuild/stardoc/releases/download/0.5.0/stardoc-0.5.0.tar.gz\\", + ], + )", + }, + "packageName": "bazelbuild/stardoc", + "repo": "bazelbuild/stardoc", + }, ] `; @@ -131,6 +150,22 @@ Array [ "packageName": "nelhage/rules_boost", "repo": "nelhage/rules_boost", }, + Object { + "currentValue": "v0.29.0", + "datasource": "github-releases", + "depName": "io_bazel_rules_go", + "depType": "http_archive", + "managerData": Object { + "def": "maybe( + http_archive, + name = \\"io_bazel_rules_go\\", + sha256 = \\"2b1641428dff9018f9e85c0384f03ec6c10660d935b750e3fa1492a281a53b0f\\", + url = \\"https://github.com/bazelbuild/rules_go/releases/download/v0.29.0/rules_go-v0.29.0.zip\\", +)", + }, + "packageName": "bazelbuild/rules_go", + "repo": "bazelbuild/rules_go", + }, ] `; @@ -323,6 +358,59 @@ Array [ "packageName": "GoogleContainerTools/distroless", "repo": "GoogleContainerTools/distroless", }, + Object { + "currentValue": "v0.29.0", + "datasource": "github-releases", + "depName": "io_bazel_rules_go", + "depType": "http_archive", + "managerData": Object { + "def": "maybe( + http_archive, + name = \\"io_bazel_rules_go\\", + sha256 = \\"2b1641428dff9018f9e85c0384f03ec6c10660d935b750e3fa1492a281a53b0f\\", + url = \\"https://github.com/bazelbuild/rules_go/releases/download/v0.29.0/rules_go-v0.29.0.zip\\", +)", + }, + "packageName": "bazelbuild/rules_go", + "repo": "bazelbuild/rules_go", + }, + Object { + "currentValue": "v0.24.0", + "datasource": "github-releases", + "depName": "bazel_gazelle", + "depType": "http_archive", + "managerData": Object { + "def": "maybe( + http_archive, + name = \\"bazel_gazelle\\", + sha256 = \\"de69a09dc70417580aabf20a28619bb3ef60d038470c7cf8442fafcf627c21cb\\", + urls = [ + \\"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz\\", + \\"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz\\", + ], +)", + }, + "packageName": "bazelbuild/bazel-gazelle", + "repo": "bazelbuild/bazel-gazelle", + }, + Object { + "currentDigest": "816c9085562cd7ee03e7f8188a1cfd942858cded", + "currentDigestShort": "816c908", + "currentValue": "v0.0.0", + "datasource": "go", + "depName": "com_github_pkg_errors", + "depType": "go_repository", + "digestOneAndOnly": true, + "managerData": Object { + "def": "maybe( + go_repository, + name = \\"com_github_pkg_errors\\", + commit = \\"816c9085562cd7ee03e7f8188a1cfd942858cded\\", + importpath = \\"github.com/pkg/errors\\", +)", + }, + "packageName": "github.com/pkg/errors", + }, Object { "currentDigest": "sha256:d5a717649fd93ea5b9c430d7f84e4c37ba219eb53bd73ed1d4a5a98e9edd84a7", "currentValue": "latest", diff --git a/lib/modules/manager/bazel/__snapshots__/update.spec.ts.snap b/lib/modules/manager/bazel/__snapshots__/update.spec.ts.snap index bd6d620020c764..86e80709fb25d2 100644 --- a/lib/modules/manager/bazel/__snapshots__/update.spec.ts.snap +++ b/lib/modules/manager/bazel/__snapshots__/update.spec.ts.snap @@ -108,6 +108,29 @@ http_archive( urls=[\\"https://github.com/GoogleContainerTools/distroless/archive/446923c3756ceeaa75888f52fcbdd48bb314fbf8.tar.gz\\"] ) +load(\\"@bazel_tools//tools/build_defs/repo:utils.bzl\\", \\"maybe\\") +maybe( + http_archive, + name = \\"io_bazel_rules_go\\", + sha256 = \\"2b1641428dff9018f9e85c0384f03ec6c10660d935b750e3fa1492a281a53b0f\\", + url = \\"https://github.com/bazelbuild/rules_go/releases/download/v0.29.0/rules_go-v0.29.0.zip\\", +) +maybe( + http_archive, + name = \\"bazel_gazelle\\", + sha256 = \\"de69a09dc70417580aabf20a28619bb3ef60d038470c7cf8442fafcf627c21cb\\", + urls = [ + \\"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz\\", + \\"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz\\", + ], +) +maybe( + go_repository, + name = \\"com_github_pkg_errors\\", + commit = \\"816c9085562cd7ee03e7f8188a1cfd942858cded\\", + importpath = \\"github.com/pkg/errors\\", +) + load(\\"@io_bazel_rules_go//go:def.bzl\\", \\"go_rules_dependencies\\", \\"go_register_toolchains\\") go_rules_dependencies() diff --git a/lib/modules/manager/bazel/extract.spec.ts b/lib/modules/manager/bazel/extract.spec.ts index dc3605204dcadd..c83e26c77df27b 100644 --- a/lib/modules/manager/bazel/extract.spec.ts +++ b/lib/modules/manager/bazel/extract.spec.ts @@ -15,7 +15,7 @@ describe('modules/manager/bazel/extract', () => { it('extracts multiple types of dependencies', () => { const res = extractPackageFile(Fixtures.get('WORKSPACE1')); - expect(res?.deps).toHaveLength(14); + expect(res?.deps).toHaveLength(17); expect(res?.deps).toMatchSnapshot(); }); @@ -26,6 +26,7 @@ describe('modules/manager/bazel/extract', () => { { packageName: 'nelhage/rules_boost' }, { packageName: 'lmirosevic/GBDeviceInfo' }, { packageName: 'nelhage/rules_boost' }, + { packageName: 'bazelbuild/rules_go' }, ]); }); @@ -47,6 +48,10 @@ describe('modules/manager/bazel/extract', () => { currentValue: '0.6.0', packageName: 'bazelbuild/bazel-skylib', }, + { + currentValue: '0.5.0', + packageName: 'bazelbuild/stardoc', + }, ]); }); diff --git a/lib/modules/manager/bazel/extract.ts b/lib/modules/manager/bazel/extract.ts index 8dd033bb0d1914..0833ecd38132b3 100644 --- a/lib/modules/manager/bazel/extract.ts +++ b/lib/modules/manager/bazel/extract.ts @@ -73,13 +73,16 @@ const lexer = moo.states({ }, def: { match: new RegExp( - [ - 'container_pull', - 'http_archive', - 'http_file', - 'go_repository', - 'git_repository', - ].join('|') + '(?:' + + [ + 'container_pull', + 'http_archive', + 'http_file', + 'go_repository', + 'git_repository', + 'maybe', + ].join('|') + + ')\\s*\\(' ), }, unknown: moo.fallback, @@ -168,8 +171,7 @@ export function extractPackageFile( const deps: PackageDependency[] = []; definitions.forEach((def) => { logger.debug({ def }, 'Checking bazel definition'); - const [depType] = def.split('(', 1); - const dep: PackageDependency = { depType, managerData: { def } }; + let [depType] = def.split('(', 1); let depName: string | undefined; let importpath: string | undefined; let remote: string | undefined; @@ -226,6 +228,12 @@ export function extractPackageFile( [, importpath] = match; } logger.debug({ dependency: depName, remote, currentValue }); + + if (depType === 'maybe') { + depType = def.split('(', 2).pop()!.split(',', 1).pop()!.trim(); + } + + const dep: PackageDependency = { depType, managerData: { def } }; if ( depType === 'git_repository' && depName && diff --git a/lib/modules/manager/bazel/update.spec.ts b/lib/modules/manager/bazel/update.spec.ts index 2df19ebdbf8970..97156d79f9d4ed 100644 --- a/lib/modules/manager/bazel/update.spec.ts +++ b/lib/modules/manager/bazel/update.spec.ts @@ -22,7 +22,7 @@ describe('modules/manager/bazel/update', () => { jest.resetAllMocks(); }); - it('updates tag', async () => { + it('updates git_repository tag', async () => { const upgrade = { depName: 'build_bazel_rules_nodejs', depType: 'git_repository', @@ -39,6 +39,24 @@ describe('modules/manager/bazel/update', () => { expect(res).not.toEqual(content); }); + it('updates maybe(git_repository) tag', async () => { + const upgrade = { + depName: 'build_bazel_rules_nodejs', + depType: 'git_repository', + managerData: { + def: `maybe(\n git_repository,\n name = "build_bazel_rules_nodejs",\n remote = "https://github.com/bazelbuild/rules_nodejs.git",\n tag = "0.1.8",\n)`, + }, + currentValue: '0.1.8', + newValue: '0.2.0', + }; + const res = await updateDependency({ + fileContent: content, + upgrade, + }); + expect(res).not.toEqual(content); + expect(res).toMatch(/maybe\([\n\s]*git_repository,/); + }); + it('updates container_pull deptype and preserves comment', async () => { const upgrade = { depName: 'hasura', @@ -232,6 +250,32 @@ http_archive( expect(res).toBeNull(); }); + it('errors for maybe(http_archive) without urls', async () => { + const upgrade = { + depName: 'bazel_skylib', + depType: 'http_archive', + repo: 'bazelbuild/bazel-skylib', + managerData: { + def: + ` +maybe( + http_archive, + name = "bazel_skylib", + sha256 = "b5f6abe419da897b7901f90cbab08af958b97a8f3575b0d3dd062ac7ce78541f", + strip_prefix = "bazel-skylib-0.5.0", +) + `.trim() + '\n', + }, + currentValue: '0.5.0', + newValue: '0.6.2', + }; + const res = await updateDependency({ + fileContent: content, + upgrade, + }); + expect(res).toBeNull(); + }); + it('updates http_archive with urls array', async () => { const upgrade = { depName: 'bazel_skylib', @@ -270,5 +314,46 @@ http_archive( expect(res?.indexOf('0.5.0')).toBe(-1); expect(res?.indexOf('0.6.2')).not.toBe(-1); }); + + it('updates maybe(http_archive) with urls array', async () => { + const upgrade = { + depName: 'bazel_skylib', + depType: 'http_archive', + repo: 'bazelbuild/bazel-skylib', + managerData: { + def: + ` +maybe( + http_archive, + name = "bazel_skylib", + sha256 = "b5f6abe419da897b7901f90cbab08af958b97a8f3575b0d3dd062ac7ce78541f", + strip_prefix = "bazel-skylib-0.5.0", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/archive/0.5.0.tar.gz", + "https://github.com/bazelbuild/bazel-skylib/archive/0.5.0.tar.gz", + ], +) + `.trim() + '\n', + }, + currentValue: '0.5.0', + newValue: '0.6.2', + }; + httpMock + .scope('https://github.com') + .get('/bazelbuild/bazel-skylib/archive/0.6.2.tar.gz') + .reply(200, Readable.from(['foo'])); + httpMock + .scope('https://mirror.bazel.build') + .get('/github.com/bazelbuild/bazel-skylib/archive/0.6.2.tar.gz') + .reply(200, Readable.from(['foo'])); + const res = await updateDependency({ + fileContent: content, + upgrade, + }); + expect(res).not.toEqual(content); + expect(res?.indexOf('0.5.0')).toBe(-1); + expect(res?.indexOf('0.6.2')).not.toBe(-1); + expect(res).toMatch(/maybe\([\n\s]*http_archive,/); + }); }); }); From 890ec819724dcf4bb425ead0cc3de821ff87300b Mon Sep 17 00:00:00 2001 From: Tobias Date: Wed, 22 Jun 2022 10:31:06 +0200 Subject: [PATCH 164/240] docs: Add instructions for setting up Google Container/Artifact Registry authentication (#16160) --- docs/usage/docker.md | 102 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 101 insertions(+), 1 deletion(-) diff --git a/docs/usage/docker.md b/docs/usage/docker.md index d4950cb00c506b..920f04370f862d 100644 --- a/docs/usage/docker.md +++ b/docs/usage/docker.md @@ -246,7 +246,107 @@ module.exports = { }; ``` -#### Google Container Registry +#### Google Container Registry / Google Artifact Registry + +##### Using long-lived service account credentials + +To access Google Container Registry (deprecated) or Google Artifact Registry you can use the JSON service account directly with `Basic` auth using `_json_key` as username and the service account as password. + +Because JSON in JSON wrapping makes things more complex, avoid it completely by encoding the JSON service account beforehand. + +Google Artifact Registry, but not Google Container Registry, supports `_json_key_base64` and a base64 encoded service account natively. +If all your dependencies are on Google Artifact Registry, you can base64 encode and use the service account directly: + +1. Download your JSON service account and store it on your machine. Make sure that the service account has read (and only read) permissions to your artifacts. +1. Base64 encode the service account credentials using `cat service-account.json | base64` +1. Add the encoded service account to your configuration file + + 1. If you want to add it to your self-hosted configuration file: + + ```json + { + "hostRules": [ + { + "matchHost": "europe-docker.pkg.dev", + "authType": "Basic", + "username": "_json_key_base64", + "password": "" + } + ] + } + ``` + + 1. If you want to add it to your repository renovate configuration file, [encrypt](https://docs.renovatebot.com/configuration-options/#encrypted) it and then add it: + + ```json + { + "hostRules": [ + { + "matchHost": "europe-docker.pkg.dev", + "authType": "Basic", + "username": "_json_key_base64", + "encrypted": { + "password": "" + } + } + ] + } + ``` + +If you have dependencies on Google Container Registry (and Artifact Registry) you need to use `_json_key` and a slightly different encoding: + +1. Download your JSON service account and store it on your machine. Make sure that the service account has read (and only read) permissions to your artifacts. +1. Open the file and prefix the content with `_json_key:`. The file should look like this: + + ``` + _json_key:{ + "type": "service_account", + "project_id": "sample-project", + "private_key_id": "5786ff7e615522b932a2a37b4a6f9645c4316dbd", + "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDaOkxZut9uDUHV\n...\n/PWs0Wa2z5+IawMD7nO63+b6\n-----END PRIVATE KEY-----\n", + "client_email": "renovate-lookup@sample-project.iam.gserviceaccount.com", + "client_id": "115429165445403928973", + "auth_uri": "https://accounts.google.com/o/oauth2/auth", + "token_uri": "https://oauth2.googleapis.com/token", + "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", + "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/renovate-lookup%40sample-project.iam.gserviceaccount.com" + } + ``` + +1. Base64 encode the prefixed service account credentials using `cat prefixed-service-account.json | base64` +1. Add the prefixed and encoded service account to your configuration file + + 1. If you want to add it to your self-hosted configuration file: + + ```json + { + "hostRules": [ + { + "matchHost": "europe-docker.pkg.dev", + "authType": "Basic", + "token": "" + } + ] + } + ``` + + 1. If you want to add it to your repository renovate configuration file, [encrypt](https://docs.renovatebot.com/configuration-options/#encrypted) it and then add it: + + ```json + { + "hostRules": [ + { + "matchHost": "europe-docker.pkg.dev", + "authType": "Basic", + "encrypted": { + "token": "" + } + } + ] + } + ``` + +##### Using short-lived access tokens Assume you are running GitLab CI in the Google Cloud, and you are storing your Docker images in the Google Container Registry (GCR). From bf2c14a53ead433902458dd7cc95ecadd884aaab Mon Sep 17 00:00:00 2001 From: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Date: Wed, 22 Jun 2022 11:16:08 +0200 Subject: [PATCH 165/240] ci(prettier): use cache option (#16110) * ci(prettier): use cache option * Fix caching for the lint command Co-authored-by: Michael Kriese * Revert to yarn.lock from main Co-authored-by: Michael Kriese --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index f002fb3448a2cd..bd1c4826e2328b 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "clean-cache": "node tools/clean-cache.mjs", "compile:ts": "tsc -p tsconfig.app.json", "config-validator": "node -r ts-node/register/transpile-only -- lib/config-validator.ts", - "create-json-schema": "node -r ts-node/register/transpile-only -- tools/generate-schema.ts && prettier --write \"renovate-schema.json\"", + "create-json-schema": "node -r ts-node/register/transpile-only -- tools/generate-schema.ts && prettier --write --cache \"renovate-schema.json\"", "debug": "node --inspect-brk -r ts-node/register/transpile-only -- lib/renovate.ts", "doc-fix": "run-s markdown-lint-fix prettier-fix", "doc-fence-check": "node tools/check-fenced-code.mjs", @@ -40,8 +40,8 @@ "prepare:re2": "node tools/check-re2.mjs", "prestart": "run-s generate:* ", "pretest": "run-s generate:* ", - "prettier": "prettier --check \"**/*.{ts,js,mjs,json,md,yml}\"", - "prettier-fix": "prettier --write \"**/*.{ts,js,mjs,json,md,yml}\"", + "prettier": "prettier --cache --check \"**/*.{ts,js,mjs,json,md,yml}\"", + "prettier-fix": "prettier --write --cache \"**/*.{ts,js,mjs,json,md,yml}\"", "release:prepare": "node -r ts-node/register/transpile-only -- tools/generate-docs.ts", "release:publish": "node tools/release.mjs", "start": "node -r ts-node/register/transpile-only -- lib/renovate.ts", From 8ce54366e169daf62749267d78633dce540ad845 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Goetz?= Date: Wed, 22 Jun 2022 11:37:01 +0200 Subject: [PATCH 166/240] docs: Add note about allowPostUpgradeCommandTemplating to postUpgradeTasks (#15439) --- docs/usage/configuration-options.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index df4b2c46e16cb5..7c195a4bad0255 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -1941,6 +1941,8 @@ The `postUpgradeTasks` configuration consists of three fields: A list of commands that are executed after Renovate has updated a dependency but before the commit is made. +You can use variable templating in your commands if [`allowPostUpgradeCommandTemplating`](https://docs.renovatebot.com/self-hosted-configuration/#allowpostupgradecommandtemplating) is enabled. + ### fileFilters A list of glob-style matchers that determine which files will be included in the final commit made by Renovate. From dc34060cedc70f3a2d10a0804b4833d5b075e2d0 Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Wed, 22 Jun 2022 12:56:55 +0300 Subject: [PATCH 167/240] fix(onboarding): warnings for external host errors (#15587) Co-authored-by: Rhys Arkins --- lib/workers/repository/process/fetch.spec.ts | 66 ++++++++++++++++++++ lib/workers/repository/process/fetch.ts | 25 ++++++-- 2 files changed, 87 insertions(+), 4 deletions(-) diff --git a/lib/workers/repository/process/fetch.spec.ts b/lib/workers/repository/process/fetch.spec.ts index 284a06c42d15e0..f641ea1a4f2d41 100644 --- a/lib/workers/repository/process/fetch.spec.ts +++ b/lib/workers/repository/process/fetch.spec.ts @@ -1,6 +1,7 @@ import { RenovateConfig, getConfig, mocked } from '../../../../test/util'; import { MavenDatasource } from '../../../modules/datasource/maven'; import type { PackageFile } from '../../../modules/manager/types'; +import { ExternalHostError } from '../../../types/errors/external-host-error'; import { fetchUpdates } from './fetch'; import * as lookup from './lookup'; @@ -141,5 +142,70 @@ describe('workers/repository/process/fetch', () => { await fetchUpdates(config, packageFiles); expect(packageFiles.maven[0].deps[0].updates).toHaveLength(2); }); + + it('throws lookup errors for onboarded repos', async () => { + config.rangeStrategy = 'auto'; + const packageFiles: any = { + maven: [ + { + packageFile: 'pom.xml', + deps: [{ datasource: MavenDatasource.id, depName: 'bbb' }], + }, + ], + }; + lookupUpdates.mockRejectedValueOnce(new Error('some error')); + + await expect( + fetchUpdates({ ...config, repoIsOnboarded: true }, packageFiles) + ).rejects.toThrow(); + }); + + it('throws lookup errors for not onboarded repos', async () => { + config.rangeStrategy = 'auto'; + const packageFiles: any = { + maven: [ + { + packageFile: 'pom.xml', + deps: [{ datasource: MavenDatasource.id, depName: 'bbb' }], + }, + ], + }; + lookupUpdates.mockRejectedValueOnce(new Error('some error')); + + await expect( + fetchUpdates({ ...config, repoIsOnboarded: true }, packageFiles) + ).rejects.toThrow(); + }); + + it('produces external host warnings for not onboarded repos', async () => { + config.rangeStrategy = 'auto'; + const packageFiles: any = { + maven: [ + { + packageFile: 'pom.xml', + deps: [{ datasource: MavenDatasource.id, depName: 'bbb' }], + }, + ], + }; + const err = new ExternalHostError(new Error('some error')); + lookupUpdates.mockRejectedValueOnce(err); + + await fetchUpdates({ ...config, repoIsOnboarded: false }, packageFiles); + + expect(packageFiles).toMatchObject({ + maven: [ + { + deps: [ + { + depName: 'bbb', + warnings: [ + { topic: 'Lookup Error', message: 'bbb: some error' }, + ], + }, + ], + }, + ], + }); + }); }); }); diff --git a/lib/workers/repository/process/fetch.ts b/lib/workers/repository/process/fetch.ts index 38e690b12ce69d..2bb90311aa87b0 100644 --- a/lib/workers/repository/process/fetch.ts +++ b/lib/workers/repository/process/fetch.ts @@ -9,6 +9,7 @@ import type { PackageDependency, PackageFile, } from '../../../modules/manager/types'; +import { ExternalHostError } from '../../../types/errors/external-host-error'; import { clone } from '../../../util/clone'; import { applyPackageRules } from '../../../util/package-rules'; import { PackageFiles } from '../package-files'; @@ -47,10 +48,26 @@ async function fetchDepUpdates( dep.skipReason = 'disabled'; } else { if (depConfig.datasource) { - dep = { - ...dep, - ...(await lookupUpdates(depConfig as LookupUpdateConfig)), - }; + try { + dep = { + ...dep, + ...(await lookupUpdates(depConfig as LookupUpdateConfig)), + }; + } catch (err) { + if ( + packageFileConfig.repoIsOnboarded || + !(err instanceof ExternalHostError) + ) { + throw err; + } + + const cause = err.err; + dep.warnings ??= []; + dep.warnings.push({ + topic: 'Lookup Error', + message: `${depName}: ${cause.message}`, + }); + } } dep.updates = dep.updates ?? []; } From 07b98a90ff6030c9546d56615da9ec51eb7b6e3f Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Wed, 22 Jun 2022 12:06:22 +0200 Subject: [PATCH 168/240] chore: improve/lower extract logging (#16181) --- lib/modules/manager/dockerfile/extract.ts | 4 +++- lib/modules/manager/gomod/extract.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/modules/manager/dockerfile/extract.ts b/lib/modules/manager/dockerfile/extract.ts index 3eae1cd46dfbd5..95d6d514ad1bf9 100644 --- a/lib/modules/manager/dockerfile/extract.ts +++ b/lib/modules/manager/dockerfile/extract.ts @@ -294,7 +294,9 @@ export function extractPackageFile(content: string): PackageFile | null { } if (fromMatch.groups?.name) { - logger.debug('Found a multistage build stage name'); + logger.debug( + `Found a multistage build stage name: ${fromMatch.groups.name}` + ); stageNames.push(fromMatch.groups.name); } if (fromImage === 'scratch') { diff --git a/lib/modules/manager/gomod/extract.ts b/lib/modules/manager/gomod/extract.ts index 8d91306a1d0246..ad2f8984492578 100644 --- a/lib/modules/manager/gomod/extract.ts +++ b/lib/modules/manager/gomod/extract.ts @@ -74,7 +74,7 @@ export function extractPackageFile(content: string): PackageFile | null { dep.managerData!.multiLine = true; deps.push(dep); } else if (line.trim() !== ')') { - logger.debug(`No multi-line match: ${line}`); + logger.trace(`No multi-line match: ${line}`); } } while (line.trim() !== ')'); } From aeec0f411ee0bd30cc9df61e8658d1f3718b5452 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Wed, 22 Jun 2022 12:20:34 +0200 Subject: [PATCH 169/240] chore: enforce ts as cast (#16164) --- .eslintrc.js | 6 ++++++ docs/development/best-practices.md | 1 + 2 files changed, 7 insertions(+) diff --git a/.eslintrc.js b/.eslintrc.js index ffb596076a199d..31c4faa44113d2 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -71,11 +71,17 @@ module.exports = { // disallow direct `nock` module usage as it causes memory issues. // disallow `parse-link-header` to allow override ENV https://github.com/thlorenz/parse-link-header#environmental-variables + // disallow `path` in favor of `upath` 'no-restricted-imports': [ 2, { paths: ['nock', 'parse-link-header', 'path'] }, ], + '@typescript-eslint/consistent-type-assertions': [ + 'error', + { assertionStyle: 'as', objectLiteralTypeAssertions: 'allow' }, + ], + // Makes no sense to allow type inference for expression parameters, but require typing the response '@typescript-eslint/explicit-function-return-type': [ 'error', diff --git a/docs/development/best-practices.md b/docs/development/best-practices.md index fb72949dedf83f..b9155bbdd9a177 100644 --- a/docs/development/best-practices.md +++ b/docs/development/best-practices.md @@ -11,6 +11,7 @@ Follow these best practices when you're working on our code. - Always add unit tests for full code coverage - Only use `istanbul` comments for unreachable code coverage that is needed for `codecov` completion - Use descriptive `istanbul` comments +- Avoid cast or prefer `x as T` instead of `x` cast. ```ts // istanbul ignore next: can never happen From dca5f9d11bdfa794a400ae17b04cd7c1f0edcaa5 Mon Sep 17 00:00:00 2001 From: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Date: Wed, 22 Jun 2022 12:37:26 +0200 Subject: [PATCH 170/240] docs(docker): rewrite GCR/GAR section (#16180) --- docs/usage/docker.md | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/docs/usage/docker.md b/docs/usage/docker.md index 920f04370f862d..c9b15050175bef 100644 --- a/docs/usage/docker.md +++ b/docs/usage/docker.md @@ -225,7 +225,7 @@ module.exports = { }; ``` -You can add additional host rules, read the [hostrules documentation](https://docs.renovatebot.com/configuration-options/#hostrules) for more information. +You can add additional host rules, read the [`hostRules` documentation](https://docs.renovatebot.com/configuration-options/#hostrules) for more information. #### Self-hosted Docker registry @@ -250,15 +250,19 @@ module.exports = { ##### Using long-lived service account credentials -To access Google Container Registry (deprecated) or Google Artifact Registry you can use the JSON service account directly with `Basic` auth using `_json_key` as username and the service account as password. +To access the Google Container Registry (deprecated) or the Google Artifact Registry, use the JSON service account with `Basic` authentication, and use the: -Because JSON in JSON wrapping makes things more complex, avoid it completely by encoding the JSON service account beforehand. +- `_json_key` as username +- full Google Cloud Platform service account JSON as password -Google Artifact Registry, but not Google Container Registry, supports `_json_key_base64` and a base64 encoded service account natively. -If all your dependencies are on Google Artifact Registry, you can base64 encode and use the service account directly: +To avoid JSON-in-JSON wrapping, which can cause problems, encode the JSON service account beforehand. -1. Download your JSON service account and store it on your machine. Make sure that the service account has read (and only read) permissions to your artifacts. -1. Base64 encode the service account credentials using `cat service-account.json | base64` +Google Container Registry does not natively support `_json_key_base64` and a base64 encoded service account. +Google Artifact Registry supports `_json_key_base64` and a base64 encoded service account natively. +If all your dependencies are on the Google Artifact Registry, you can base64 encode and use the service account directly: + +1. Download your JSON service account and store it on your machine. Make sure that the service account has `read` (and only `read`) permissions to your artifacts +1. Base64 encode the service account credentials by running `cat service-account.json | base64` 1. Add the encoded service account to your configuration file 1. If you want to add it to your self-hosted configuration file: @@ -276,7 +280,7 @@ If all your dependencies are on Google Artifact Registry, you can base64 encode } ``` - 1. If you want to add it to your repository renovate configuration file, [encrypt](https://docs.renovatebot.com/configuration-options/#encrypted) it and then add it: + 1. If you want to add it to your repository Renovate configuration file, [encrypt](https://docs.renovatebot.com/configuration-options/#encrypted) it and then add it: ```json { @@ -295,7 +299,7 @@ If all your dependencies are on Google Artifact Registry, you can base64 encode If you have dependencies on Google Container Registry (and Artifact Registry) you need to use `_json_key` and a slightly different encoding: -1. Download your JSON service account and store it on your machine. Make sure that the service account has read (and only read) permissions to your artifacts. +1. Download your JSON service account and store it on your machine. Make sure that the service account has `read` (and only `read`) permissions to your artifacts 1. Open the file and prefix the content with `_json_key:`. The file should look like this: ``` @@ -313,7 +317,7 @@ If you have dependencies on Google Container Registry (and Artifact Registry) yo } ``` -1. Base64 encode the prefixed service account credentials using `cat prefixed-service-account.json | base64` +1. Base64 encode the prefixed service account credentials by running `cat prefixed-service-account.json | base64` 1. Add the prefixed and encoded service account to your configuration file 1. If you want to add it to your self-hosted configuration file: @@ -330,7 +334,7 @@ If you have dependencies on Google Container Registry (and Artifact Registry) yo } ``` - 1. If you want to add it to your repository renovate configuration file, [encrypt](https://docs.renovatebot.com/configuration-options/#encrypted) it and then add it: + 1. If you want to add it to your repository Renovate configuration file, [encrypt](https://docs.renovatebot.com/configuration-options/#encrypted) it and then add it: ```json { From b9a400aa9fa61fd1640dc9f320a4a72bcded1faf Mon Sep 17 00:00:00 2001 From: Johannes Feichtner Date: Wed, 22 Jun 2022 13:10:34 +0200 Subject: [PATCH 171/240] feat(gradle): add interpolation for local name variable in registry URL (#16136) --- lib/modules/manager/gradle/extract.spec.ts | 9 ++++- lib/modules/manager/gradle/parser.spec.ts | 41 ++++++++++---------- lib/modules/manager/gradle/parser.ts | 44 +++++++++++++++++++++- 3 files changed, 71 insertions(+), 23 deletions(-) diff --git a/lib/modules/manager/gradle/extract.spec.ts b/lib/modules/manager/gradle/extract.spec.ts index 88ad473a74ccd3..d31b8633f2424c 100644 --- a/lib/modules/manager/gradle/extract.spec.ts +++ b/lib/modules/manager/gradle/extract.spec.ts @@ -199,6 +199,10 @@ describe('modules/manager/gradle/extract', () => { maven { url = "\${repositoryBaseURL}/repository-build" } + maven { + name = "baz" + url = "\${repositoryBaseURL}/\${name}" + } } dependencies { @@ -230,13 +234,14 @@ describe('modules/manager/gradle/extract', () => { depName: 'com.google.protobuf:protobuf-java', currentValue: '2.17.0', managerData: { - fileReplacePosition: 227, + fileReplacePosition: 335, packageFile: 'build.gradle', }, - fileReplacePosition: 227, + fileReplacePosition: 335, registryUrls: [ 'https://repo.maven.apache.org/maven2', 'https://dummy.org/whatever/repository-build', + 'https://dummy.org/whatever/baz', ], }, ], diff --git a/lib/modules/manager/gradle/parser.spec.ts b/lib/modules/manager/gradle/parser.spec.ts index 779d9bf10a0c43..358384df5df273 100644 --- a/lib/modules/manager/gradle/parser.spec.ts +++ b/lib/modules/manager/gradle/parser.spec.ts @@ -107,26 +107,27 @@ describe('modules/manager/gradle/parser', () => { describe('registryUrls', () => { test.each` - def | input | url - ${''} | ${'url ""'} | ${null} - ${''} | ${'url "#!@"'} | ${null} - ${''} | ${'url "https://example.com"'} | ${'https://example.com'} - ${'base="https://foo.bar"'} | ${'url "${base}/baz"'} | ${'https://foo.bar/baz'} - ${''} | ${'url("https://example.com")'} | ${'https://example.com'} - ${'base="https://foo.bar"'} | ${'url("${base}/baz")'} | ${'https://foo.bar/baz'} - ${''} | ${'mavenCentral()'} | ${MAVEN_REPO} - ${''} | ${'jcenter()'} | ${JCENTER_REPO} - ${''} | ${'google()'} | ${GOOGLE_REPO} - ${''} | ${'google { content { includeGroup "foo" } }'} | ${GOOGLE_REPO} - ${''} | ${'gradlePluginPortal()'} | ${GRADLE_PLUGIN_PORTAL_REPO} - ${''} | ${'maven("https://foo.bar/baz/qux")'} | ${'https://foo.bar/baz/qux'} - ${'base="https://foo.bar"'} | ${'maven("${base}/baz/qux")'} | ${'https://foo.bar/baz/qux'} - ${''} | ${'maven { url = uri("https://foo.bar/baz")'} | ${'https://foo.bar/baz'} - ${'base="https://foo.bar"'} | ${'maven { url = uri("${base}/baz")'} | ${'https://foo.bar/baz'} - ${''} | ${"maven { url 'https://foo.bar/baz'"} | ${'https://foo.bar/baz'} - ${'base="https://foo.bar"'} | ${'maven { url "${base}/baz"'} | ${'https://foo.bar/baz'} - ${''} | ${"maven { url = 'https://foo.bar/baz'"} | ${'https://foo.bar/baz'} - ${'base="https://foo.bar"'} | ${'maven { url = "${base}/baz"'} | ${'https://foo.bar/baz'} + def | input | url + ${''} | ${'url ""'} | ${null} + ${''} | ${'url "#!@"'} | ${null} + ${''} | ${'url "https://example.com"'} | ${'https://example.com'} + ${'base="https://foo.bar"'} | ${'url "${base}/baz"'} | ${'https://foo.bar/baz'} + ${''} | ${'url("https://example.com")'} | ${'https://example.com'} + ${'base="https://foo.bar"'} | ${'url("${base}/baz")'} | ${'https://foo.bar/baz'} + ${''} | ${'mavenCentral()'} | ${MAVEN_REPO} + ${''} | ${'jcenter()'} | ${JCENTER_REPO} + ${''} | ${'google()'} | ${GOOGLE_REPO} + ${''} | ${'google { content { includeGroup "foo" } }'} | ${GOOGLE_REPO} + ${''} | ${'gradlePluginPortal()'} | ${GRADLE_PLUGIN_PORTAL_REPO} + ${''} | ${'maven("https://foo.bar/baz/qux")'} | ${'https://foo.bar/baz/qux'} + ${'base="https://foo.bar"'} | ${'maven("${base}/baz/qux")'} | ${'https://foo.bar/baz/qux'} + ${''} | ${'maven { url = uri("https://foo.bar/baz")'} | ${'https://foo.bar/baz'} + ${'base="https://foo.bar"'} | ${'maven { url = uri("${base}/baz")'} | ${'https://foo.bar/baz'} + ${''} | ${"maven { url 'https://foo.bar/baz'"} | ${'https://foo.bar/baz'} + ${'base="https://foo.bar"'} | ${'maven { url "${base}/baz"'} | ${'https://foo.bar/baz'} + ${''} | ${"maven { url = 'https://foo.bar/baz'"} | ${'https://foo.bar/baz'} + ${'base="https://foo.bar"'} | ${'maven { url = "${base}/baz"'} | ${'https://foo.bar/baz'} + ${'base="https://foo.bar"'} | ${'maven { name = "baz"\nurl = "${base}/${name}"'} | ${'https://foo.bar/baz'} `('$def | $input', ({ def, input, url }) => { const expected = [url].filter(Boolean); const { urls } = parseGradle([def, input].join('\n')); diff --git a/lib/modules/manager/gradle/parser.ts b/lib/modules/manager/gradle/parser.ts index cb33ef3c111c9d..3f5d30940b7ccd 100644 --- a/lib/modules/manager/gradle/parser.ts +++ b/lib/modules/manager/gradle/parser.ts @@ -278,10 +278,21 @@ function processCustomRegistryUrl({ tokenMap, variables, }: SyntaxHandlerInput): SyntaxHandlerOutput { + let localVariables = variables; + if (tokenMap.keyToken?.value === 'name') { + localVariables = { + ...variables, + name: { + key: 'name', + value: tokenMap.valToken.value, + }, + }; + } + let registryUrl: string | null = tokenMap.registryUrl?.value; if (tokenMap.registryUrl?.type === TokenType.StringInterpolation) { const token = tokenMap.registryUrl as StringInterpolation; - registryUrl = interpolateString(token.children, variables); + registryUrl = interpolateString(token.children, localVariables); } try { @@ -556,6 +567,37 @@ const matcherConfigs: SyntaxMatchConfig[] = [ ], handler: processCustomRegistryUrl, }, + { + // maven { name = "baz"; url = "https://maven.springframework.org/${name}" } + matchers: [ + { + matchType: TokenType.Word, + matchValue: 'maven', + }, + { matchType: TokenType.LeftBrace }, + { + matchType: TokenType.Word, + matchValue: 'name', + tokenMapKey: 'keyToken', + }, + { matchType: TokenType.Assignment }, + { + matchType: [TokenType.String, TokenType.StringInterpolation], + tokenMapKey: 'valToken', + }, + { + matchType: TokenType.Word, + matchValue: 'url', + }, + { matchType: TokenType.Assignment }, + { + matchType: [TokenType.String, TokenType.StringInterpolation], + tokenMapKey: 'registryUrl', + }, + endOfInstruction, + ], + handler: processCustomRegistryUrl, + }, { // maven { url = "https://maven.springframework.org/release" matchers: [ From 8595079ce9771867cf73f7e50c24b938bcd916d4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 22 Jun 2022 18:22:24 +0000 Subject: [PATCH 172/240] chore(deps): update node.js to 5635fa6 (#16186) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .devcontainer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 38ff4b752b4ab9..bf5ce0aa3e5e5e 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM containerbase/node:14.19.3@sha256:5a9f04fac80c82662be7bf2e28d22e1c5b1dbd6e3c17eca804ddef539d504f64 +FROM containerbase/node:14.19.3@sha256:5635fa6ae50860f74933fd04ffdae624b3423a8c2dcf32a72f0266335f580ed9 USER root From 713f0f955e262e256df70d74241446374870e350 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 22 Jun 2022 18:35:52 +0000 Subject: [PATCH 173/240] chore(deps): update dependency @types/node to v16.11.41 (#16187) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index bd1c4826e2328b..103cd69281b415 100644 --- a/package.json +++ b/package.json @@ -249,7 +249,7 @@ "@types/marshal": "0.5.1", "@types/moo": "0.5.5", "@types/nock": "10.0.3", - "@types/node": "16.11.40", + "@types/node": "16.11.41", "@types/parse-link-header": "2.0.0", "@types/semver": "7.3.9", "@types/semver-stable": "3.0.0", diff --git a/yarn.lock b/yarn.lock index d1b99c7bd80e03..b3b15c1795ab71 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2641,10 +2641,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-18.0.0.tgz#67c7b724e1bcdd7a8821ce0d5ee184d3b4dd525a" integrity sha512-cHlGmko4gWLVI27cGJntjs/Sj8th9aYwplmZFwmmgYQQvL5NUsgVJG7OddLvNfLqYS31KFN0s3qlaD9qCaxACA== -"@types/node@16.11.40": - version "16.11.40" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.40.tgz#bcf85f3febe74436107aeb2d3fb5fd0d30818600" - integrity sha512-7bOWglXUO6f21NG3YDI7hIpeMX3M59GG+DzZuzX2EkFKYUnRoxq3EOg4R0KNv2hxryY9M3UUqG5akwwsifrukw== +"@types/node@16.11.41": + version "16.11.41" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.41.tgz#88eb485b1bfdb4c224d878b7832239536aa2f813" + integrity sha512-mqoYK2TnVjdkGk8qXAVGc/x9nSaTpSrFaGFm43BUH3IdoBV0nta6hYaGmdOvIMlbHJbUEVen3gvwpwovAZKNdQ== "@types/node@^13.7.0": version "13.13.52" From 7f474f720e31561ba96f94562d38d23ea318b269 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 22 Jun 2022 21:39:58 +0000 Subject: [PATCH 174/240] chore(deps): update dependency @actions/core to v1.9.0 (#16191) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 103cd69281b415..dbb7c8ef465470 100644 --- a/package.json +++ b/package.json @@ -217,7 +217,7 @@ "re2": "1.17.7" }, "devDependencies": { - "@actions/core": "1.8.2", + "@actions/core": "1.9.0", "@jest/globals": "28.1.1", "@jest/reporters": "28.1.1", "@jest/test-result": "28.1.1", diff --git a/yarn.lock b/yarn.lock index b3b15c1795ab71..0b429f82d30997 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,14 +2,7 @@ # yarn lockfile v1 -"@actions/core@1.8.2": - version "1.8.2" - resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.8.2.tgz#67539d669ae9b751430469e9ae4d83e0525973ac" - integrity sha512-FXcBL7nyik8K5ODeCKlxi+vts7torOkoDAKfeh61EAkAy1HAvwn9uVzZBY0f15YcQTcZZ2/iSGBFHEuioZWfDA== - dependencies: - "@actions/http-client" "^2.0.1" - -"@actions/core@^1.2.6": +"@actions/core@1.9.0", "@actions/core@^1.2.6": version "1.9.0" resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.9.0.tgz#20c1baac5d4bd2508ba1fc3e5f3fc4b8a80d4082" integrity sha512-5pbM693Ih59ZdUhgk+fts+bUWTnIdHV3kwOSr+QIoFHMLg7Gzhwm0cifDY/AG68ekEJAkHnQVpcy4f6GjmzBCA== From 4b40d0a338ce66d9d72d6a4ce2e329d47d8dcc2a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 22 Jun 2022 21:52:21 +0000 Subject: [PATCH 175/240] chore(deps): update dependency @types/semver to v7.3.10 (#16190) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index dbb7c8ef465470..27984ca789a6f9 100644 --- a/package.json +++ b/package.json @@ -251,7 +251,7 @@ "@types/nock": "10.0.3", "@types/node": "16.11.41", "@types/parse-link-header": "2.0.0", - "@types/semver": "7.3.9", + "@types/semver": "7.3.10", "@types/semver-stable": "3.0.0", "@types/semver-utils": "1.1.1", "@types/shelljs": "0.8.11", diff --git a/yarn.lock b/yarn.lock index 0b429f82d30997..b831c319b9d4f1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2686,12 +2686,7 @@ resolved "https://registry.yarnpkg.com/@types/semver-utils/-/semver-utils-1.1.1.tgz#4260b9ce13344725069a1ff86bd2f4d6c70a443e" integrity sha512-WLZZQdwo5P+H6R+bDDCFqFSlP5Jtk6gyXpE0R0KAVQbcMGmxpVsNX8dah640hY4+PpRG2+Ph3dcwDHzrOAOZ7A== -"@types/semver@7.3.9": - version "7.3.9" - resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.9.tgz#152c6c20a7688c30b967ec1841d31ace569863fc" - integrity sha512-L/TMpyURfBkf+o/526Zb6kd/tchUP3iBDEPjqjb+U2MAJhVRxxrmr2fwpe08E7QsV7YLcpq0tUaQ9O9x97ZIxQ== - -"@types/semver@^7.1.0": +"@types/semver@7.3.10", "@types/semver@^7.1.0": version "7.3.10" resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.10.tgz#5f19ee40cbeff87d916eedc8c2bfe2305d957f73" integrity sha512-zsv3fsC7S84NN6nPK06u79oWgrPVd0NvOyqgghV1haPaFcVxIrP4DLomRwGAXk0ui4HZA7mOcSFL98sMVW9viw== From d727a4da95019c6b6e1a6b652ffdf7ffd90e9c3a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 23 Jun 2022 00:43:01 +0000 Subject: [PATCH 176/240] chore(deps): update github/codeql-action action to v2.1.14 (#16195) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/codeql-analysis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 7c4f13c7cc466b..607569d19753d5 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -30,7 +30,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@d00e8c09a38ef8c1ca1091fc55ef490776d2de73 # tag=v2.1.13 + uses: github/codeql-action/init@41a4ada31ba866a7f1196b9602703a89edd69e22 # tag=v2.1.14 with: languages: javascript @@ -40,7 +40,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@d00e8c09a38ef8c1ca1091fc55ef490776d2de73 # tag=v2.1.13 + uses: github/codeql-action/autobuild@41a4ada31ba866a7f1196b9602703a89edd69e22 # tag=v2.1.14 # ℹī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -54,4 +54,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@d00e8c09a38ef8c1ca1091fc55ef490776d2de73 # tag=v2.1.13 + uses: github/codeql-action/analyze@41a4ada31ba866a7f1196b9602703a89edd69e22 # tag=v2.1.14 From bce8dcc4e4a8ce4a0f8c54ad483131d462a5dc3e Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Thu, 23 Jun 2022 10:07:43 +0300 Subject: [PATCH 177/240] fix(github): Correct submodule updates for `platformCommit=true` (#16198) --- lib/util/git/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util/git/index.ts b/lib/util/git/index.ts index 303b53d8a01707..783b00fa45df7f 100644 --- a/lib/util/git/index.ts +++ b/lib/util/git/index.ts @@ -1108,7 +1108,7 @@ export async function clearRenovateRefs(): Promise { } const treeItemRegex = regEx( - /^(?\d{6})\s+(?blob|tree)\s+(?[0-9a-f]{40})\s+(?.*)$/ + /^(?\d{6})\s+(?blob|tree|commit)\s+(?[0-9a-f]{40})\s+(?.*)$/ ); const treeShaRegex = regEx(/tree\s+(?[0-9a-f]{40})\s*/); From 3d96c7c5a1c3bd5098484d04f5dee96b1942c7e9 Mon Sep 17 00:00:00 2001 From: Tobias Date: Thu, 23 Jun 2022 09:39:31 +0200 Subject: [PATCH 178/240] feat(config): print hostRules when `printConfig=true` (#15699) --- docs/usage/configuration-options.md | 5 +++++ docs/usage/self-hosted-configuration.md | 5 ----- lib/config/options/index.ts | 3 +-- lib/workers/repository/init/index.ts | 6 +++++- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index 7c195a4bad0255..a0a8e74d29dc86 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -2116,6 +2116,11 @@ Here's an example of how you would define PR priority so that devDependencies ar The PR title is important for some of Renovate's matching algorithms (e.g. determining whether to recreate a PR or not) so ideally don't modify it much. +## printConfig + +This option is useful for troubleshooting, particularly if using presets. +e.g. run `renovate foo/bar --print-config > config.log` and the fully-resolved config will be included in the log file. + ## pruneBranchAfterAutomerge By default Renovate deletes, or "prunes", the branch after automerging. diff --git a/docs/usage/self-hosted-configuration.md b/docs/usage/self-hosted-configuration.md index 0ab15970d53771..15011fea85b193 100644 --- a/docs/usage/self-hosted-configuration.md +++ b/docs/usage/self-hosted-configuration.md @@ -487,11 +487,6 @@ CI jobs are usually triggered by these events: pull-request creation, pull-reque Set as an integer. Default is no limit. -## printConfig - -This option is useful for troubleshooting, particularly if using presets. -e.g. run `renovate foo/bar --print-config > config.log` and the fully-resolved config will be included in the log file. - ## privateKey This private key is used to decrypt config files. diff --git a/lib/config/options/index.ts b/lib/config/options/index.ts index af5c1e2f3eaeaf..25ba3c862c1f93 100644 --- a/lib/config/options/index.ts +++ b/lib/config/options/index.ts @@ -262,9 +262,8 @@ const options: RenovateOptions[] = [ { name: 'printConfig', description: - 'If enabled, Renovate logs the fullly resolved config for each repo, plus the fully resolved presets.', + 'If enabled, Renovate logs the fully resolved config for each repo, plus the fully resolved presets.', type: 'boolean', - globalOnly: true, default: false, }, { diff --git a/lib/workers/repository/init/index.ts b/lib/workers/repository/init/index.ts index ce75de4b3f1cf6..3cb42748dae61c 100644 --- a/lib/workers/repository/init/index.ts +++ b/lib/workers/repository/init/index.ts @@ -5,6 +5,7 @@ import { logger } from '../../../logger'; import { platform } from '../../../modules/platform'; import { clone } from '../../../util/clone'; import { setUserRepoConfig } from '../../../util/git'; +import { getAll } from '../../../util/host-rules'; import { checkIfConfigured } from '../configured'; import { PackageFiles } from '../package-files'; import { initApis } from './apis'; @@ -41,7 +42,10 @@ export async function initRepo( config = await detectVulnerabilityAlerts(config); // istanbul ignore if if (config.printConfig) { - logger.info({ config }, 'Full resolved config including presets'); + logger.info( + { config, hostRules: getAll() }, + 'Full resolved config and hostRules including presets' + ); } return config; } From 9b5d90feea379d1ad519172a37765a4fdd3bc530 Mon Sep 17 00:00:00 2001 From: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Date: Thu, 23 Jun 2022 12:44:06 +0200 Subject: [PATCH 179/240] fix(node): update node.js schedule (#16201) --- data/node-js-schedule.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/node-js-schedule.json b/data/node-js-schedule.json index c79995a3aaa219..853060b4e70759 100644 --- a/data/node-js-schedule.json +++ b/data/node-js-schedule.json @@ -87,7 +87,7 @@ "start": "2021-04-20", "lts": "2021-10-26", "maintenance": "2022-10-18", - "end": "2024-04-30", + "end": "2023-09-11", "codename": "Gallium" }, "v17": { From 84228b1b12a9926e1019b6030519c02665c09b61 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 23 Jun 2022 12:51:57 +0000 Subject: [PATCH 180/240] chore(deps): update dependency prettier to v2.7.1 (#16205) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 27984ca789a6f9..1d06930df55b52 100644 --- a/package.json +++ b/package.json @@ -291,7 +291,7 @@ "mockdate": "3.0.5", "nock": "13.2.7", "npm-run-all": "4.1.5", - "prettier": "2.7.0", + "prettier": "2.7.1", "pretty-quick": "3.1.3", "rimraf": "3.0.2", "semantic-release": "19.0.3", diff --git a/yarn.lock b/yarn.lock index b831c319b9d4f1..4a18228fc157e2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7917,10 +7917,10 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prettier@2.7.0: - version "2.7.0" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.0.tgz#a4fdae07e5596c51c9857ea676cd41a0163879d6" - integrity sha512-nwoX4GMFgxoPC6diHvSwmK/4yU8FFH3V8XWtLQrbj4IBsK2pkYhG4kf/ljF/haaZ/aii+wNJqISrCDPgxGWDVQ== +prettier@2.7.1: + version "2.7.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" + integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g== pretty-bytes@^5.1.0: version "5.6.0" From ee52021a9d185b67cf9b947ab79ac1d8692ae66c Mon Sep 17 00:00:00 2001 From: Gabriel-Ladzaretti <97394622+Gabriel-Ladzaretti@users.noreply.github.com> Date: Thu, 23 Jun 2022 17:25:55 +0300 Subject: [PATCH 181/240] fix(core/dashboard): GitHub error "maximum is 65536 characters" (#16208) --- .../repository/dependency-dashboard.spec.ts | 46 +++++++++++++++++++ .../repository/dependency-dashboard.ts | 2 +- 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/lib/workers/repository/dependency-dashboard.spec.ts b/lib/workers/repository/dependency-dashboard.spec.ts index 8fb40454cde2b9..2deacf4f168860 100644 --- a/lib/workers/repository/dependency-dashboard.spec.ts +++ b/lib/workers/repository/dependency-dashboard.spec.ts @@ -10,23 +10,54 @@ import { } from '../../../test/util'; import { GlobalConfig } from '../../config/global'; import { PlatformId } from '../../constants'; +import type { + PackageDependency, + PackageFile, +} from '../../modules/manager/types'; import type { Platform } from '../../modules/platform'; +import { massageMarkdown } from '../../modules/platform/github'; import { BranchConfig, BranchResult, BranchUpgradeConfig } from '../types'; import * as dependencyDashboard from './dependency-dashboard'; import { PackageFiles } from './package-files'; type PrUpgrade = BranchUpgradeConfig; +const massageMdSpy = jest.spyOn(platform, 'massageMarkdown'); let config: RenovateConfig; beforeEach(() => { jest.clearAllMocks(); + massageMdSpy.mockImplementation(massageMarkdown); config = getConfig(); config.platform = PlatformId.Github; config.errors = []; config.warnings = []; }); +function genRandString(length: number): string { + let result = ''; + const chars = 'abcdefghijklmnopqrstuvwxyz'; + const charsLen = chars.length; + for (let i = 0; i < length; i++) { + result += chars.charAt(Math.floor(Math.random() * charsLen)); + } + return result; +} + +function genRandPackageFile( + depsNum: number, + depNameLen: number +): Record { + const deps: PackageDependency[] = []; + for (let i = 0; i < depsNum; i++) { + deps.push({ + depName: genRandString(depNameLen), + currentVersion: '1.0.0', + }); + } + return { npm: [{ packageFile: 'package.json', deps }] }; +} + async function dryRun( branches: BranchConfig[], platform: jest.Mocked, @@ -666,6 +697,21 @@ describe('workers/repository/dependency-dashboard', () => { // same with dry run await dryRun(branches, platform); }); + + it('truncates the body of a really big repo', async () => { + const branches: BranchConfig[] = []; + const truncatedLength = 60000; + const packageFilesBigRepo = genRandPackageFile(100, 700); + PackageFiles.add('main', packageFilesBigRepo); + await dependencyDashboard.ensureDependencyDashboard(config, branches); + expect(platform.ensureIssue).toHaveBeenCalledTimes(1); + expect(platform.ensureIssue.mock.calls[0][0].body).toHaveLength( + truncatedLength + ); + + // same with dry run + await dryRun(branches, platform); + }); }); }); }); diff --git a/lib/workers/repository/dependency-dashboard.ts b/lib/workers/repository/dependency-dashboard.ts index 7289c6b79ec61c..6aea032c04c99c 100644 --- a/lib/workers/repository/dependency-dashboard.ts +++ b/lib/workers/repository/dependency-dashboard.ts @@ -358,7 +358,7 @@ export async function ensureDependencyDashboard( await platform.ensureIssue({ title: config.dependencyDashboardTitle!, reuseTitle, - body: issueBody, + body: platform.massageMarkdown(issueBody), labels: config.dependencyDashboardLabels, confidential: config.confidential, }); From 29a272c78fb2b9a31be24a44be63691b27ab654b Mon Sep 17 00:00:00 2001 From: Karl-Johan Grahn <6355577+karl-johan-grahn@users.noreply.github.com> Date: Thu, 23 Jun 2022 19:36:01 +0200 Subject: [PATCH 182/240] feat(helm-manager): allow either tag or version for images in helm charts (#16058) * update Allow either tag or version for images in helm charts * undo * lint * undo * exports * rewrite * add spaces for lint * chore: prettier fix Co-authored-by: Rhys Arkins Co-authored-by: Michael Kriese --- lib/modules/manager/helm-values/extract.ts | 2 +- lib/modules/manager/helm-values/readme.md | 4 ++++ lib/modules/manager/helm-values/types.ts | 19 +++++++++++++++++-- lib/modules/manager/helm-values/util.ts | 5 ++++- 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/lib/modules/manager/helm-values/extract.ts b/lib/modules/manager/helm-values/extract.ts index 670d8fe2ff57be..ba58044b151ef0 100644 --- a/lib/modules/manager/helm-values/extract.ts +++ b/lib/modules/manager/helm-values/extract.ts @@ -46,7 +46,7 @@ function findDependencies( let registry = currentItem.registry; registry = registry ? `${registry}/` : ''; const repository = String(currentItem.repository); - const tag = String(currentItem.tag); + const tag = `${currentItem.tag ?? currentItem.version}`; packageDependencies.push(getHelmDep({ repository, tag, registry })); } else if (matchesHelmValuesInlineImage(key, value)) { packageDependencies.push(getDep(value)); diff --git a/lib/modules/manager/helm-values/readme.md b/lib/modules/manager/helm-values/readme.md index a604f2f0c886ae..c77852fca1bedb 100644 --- a/lib/modules/manager/helm-values/readme.md +++ b/lib/modules/manager/helm-values/readme.md @@ -7,6 +7,10 @@ image: tag: v1.0.0 registry: registry.example.com # optional key, will default to "docker.io" +image: + repository: 'some-docker/dependency' + version: v1.0.0 + coreImage: registry: docker.io repository: bitnami/harbor-core diff --git a/lib/modules/manager/helm-values/types.ts b/lib/modules/manager/helm-values/types.ts index b507048353b0d1..50dbe42b439ccd 100644 --- a/lib/modules/manager/helm-values/types.ts +++ b/lib/modules/manager/helm-values/types.ts @@ -1,5 +1,20 @@ -export type HelmDockerImageDependency = { +export interface HelmDockerImageDependencyBasic { registry?: string; repository: string; +} + +export interface HelmDockerImageDependencyTag + extends HelmDockerImageDependencyBasic { tag: string; -}; + version?: never; +} + +export interface HelmDockerImageDependencyVersion + extends HelmDockerImageDependencyBasic { + version: string; + tag?: never; +} + +export type HelmDockerImageDependency = + | HelmDockerImageDependencyTag + | HelmDockerImageDependencyVersion; diff --git a/lib/modules/manager/helm-values/util.ts b/lib/modules/manager/helm-values/util.ts index e88874edcfdaff..58322e176f7aa8 100644 --- a/lib/modules/manager/helm-values/util.ts +++ b/lib/modules/manager/helm-values/util.ts @@ -15,6 +15,9 @@ const parentKeyRe = regEx(/image$/i); * image: * repository: 'something' * tag: v1.0.0 + * image: + * repository: 'something' + * version: v1.0.0 * renovateImage: * repository: 'something' * tag: v1.0.0 @@ -28,7 +31,7 @@ export function matchesHelmValuesDockerHeuristic( data && typeof data === 'object' && hasKey('repository', data) && - hasKey('tag', data) + (hasKey('tag', data) || hasKey('version', data)) ); } From 9c51ff6733a54b469eab32edaedf3af7cda0d8e3 Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Fri, 24 Jun 2022 11:07:34 +0300 Subject: [PATCH 183/240] feat(manager/helm): make change log url retrieval more flexible (#16210) * feat(helm): improve fallback on sourceUrl selection * fix(helm): use home and source from latest release instead of the first. Otherwise those fields can't be ever changed. * test(helm): test charts with no home metadata * test(helm): test releases semver sorting * fix(helm): select last release by semver * Apply suggestions from code review Co-authored-by: Michael Kriese * fix(type): make homeMatch keys optional * Fixes Co-authored-by: Stefano Zaninetta Co-authored-by: Michael Kriese --- .../datasource/helm/__fixtures__/index.yaml | 70 +++++++++++++++++++ .../datasource/helm/__fixtures__/sample.yaml | 17 +++++ lib/modules/datasource/helm/common.spec.ts | 12 ++-- lib/modules/datasource/helm/common.ts | 47 +++++++++---- lib/modules/datasource/helm/index.spec.ts | 18 +++++ lib/modules/datasource/helm/index.ts | 8 ++- 6 files changed, 151 insertions(+), 21 deletions(-) diff --git a/lib/modules/datasource/helm/__fixtures__/index.yaml b/lib/modules/datasource/helm/__fixtures__/index.yaml index 870b7b419e4b23..6f8c60e89091cc 100644 --- a/lib/modules/datasource/helm/__fixtures__/index.yaml +++ b/lib/modules/datasource/helm/__fixtures__/index.yaml @@ -1872,3 +1872,73 @@ entries: urls: - https://charts.helm.sh/stable/packages/ambassador-1.0.0.tgz version: 1.0.0 + cluster-autoscaler: + - apiVersion: v2 + appVersion: 1.21.1 + created: "2021-12-14T18:07:21.619018562Z" + description: Scales Kubernetes worker nodes within autoscaling groups. + digest: 5685825bce34653919c9d23ca833b99f2ba359aad6dc89afacdf32208c4d0e16 + home: https://www.autoscaler.io/9.10.9 + icon: https://github.com/kubernetes/kubernetes/raw/master/logo/logo.png + maintainers: + - email: e.bailey@sportradar.com + name: yurrriq + - email: mgoodness@gmail.com + name: mgoodness + - email: guyjtempleton@googlemail.com + name: gjtempleton + - email: scott.crooks@gmail.com + name: sc250024 + name: cluster-autoscaler + sources: + - https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler#9.10.9 + type: application + urls: + - cluster-autoscaler-9.10.9.tgz + version: 9.10.9 + - apiVersion: v2 + appVersion: 1.21.1 + created: "2021-12-22T11:20:10.489588334Z" + description: Scales Kubernetes worker nodes within autoscaling groups. + digest: 0da701c485890b77ec45853aa3b5ad8644ff7c71d6cd2d5ee65ee54d118ca99b + home: https://www.autoscaler.io/9.11.0 + icon: https://github.com/kubernetes/kubernetes/raw/master/logo/logo.png + maintainers: + - email: e.bailey@sportradar.com + name: yurrriq + - email: mgoodness@gmail.com + name: mgoodness + - email: guyjtempleton@googlemail.com + name: gjtempleton + - email: scott.crooks@gmail.com + name: sc250024 + name: cluster-autoscaler + sources: + - https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler#9.11.0 + type: application + urls: + - cluster-autoscaler-9.11.0.tgz + version: 9.11.0 + - apiVersion: v2 + appVersion: 1.21.1 + created: "2021-11-01T22:54:28.760738726Z" + description: Scales Kubernetes worker nodes within autoscaling groups. + digest: 446efc118d134bb3dbc2d30ff10a07bbcaa33726bdabc60ebf2a5fd8b1871392 + home: https://www.autoscaler.io/9.10.8 + icon: https://github.com/kubernetes/kubernetes/raw/master/logo/logo.png + maintainers: + - email: e.bailey@sportradar.com + name: yurrriq + - email: mgoodness@gmail.com + name: mgoodness + - email: guyjtempleton@googlemail.com + name: gjtempleton + - email: scott.crooks@gmail.com + name: sc250024 + name: cluster-autoscaler + sources: + - https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler#9.10.8 + type: application + urls: + - cluster-autoscaler-9.10.8.tgz + version: 9.10.8 diff --git a/lib/modules/datasource/helm/__fixtures__/sample.yaml b/lib/modules/datasource/helm/__fixtures__/sample.yaml index 9e3c6d97bb1041..9e2afe89d98762 100644 --- a/lib/modules/datasource/helm/__fixtures__/sample.yaml +++ b/lib/modules/datasource/helm/__fixtures__/sample.yaml @@ -93,3 +93,20 @@ entries: - home: urls: - some.tgz + dummy-no-home: + - description: dummy chart without home metadata + name: dummy-no-home + sources: + - https://github.com/dummyorg/dummymonorepo/tree/main/charts/dummy-no-home + version: 0.0.42 + urls: + - some.tgz + dummy-no-chart-repo: + - description: dummy chart without a valid chart repo URL + name: dummy-no-chart-repo + home: https://github.com/dummyorg/dummymonorepo/tree/main/charts/dummy-no-chart-repo + sources: + - https://some.test + version: 0.0.42 + urls: + - some.tgz diff --git a/lib/modules/datasource/helm/common.spec.ts b/lib/modules/datasource/helm/common.spec.ts index 48d4d0906d23a6..d0f33613d65134 100644 --- a/lib/modules/datasource/helm/common.spec.ts +++ b/lib/modules/datasource/helm/common.spec.ts @@ -11,11 +11,13 @@ const repo = load(loadFixture('sample.yaml'), { describe('modules/datasource/helm/common', () => { describe('findSourceUrl', () => { test.each` - input | output - ${'airflow'} | ${{ sourceUrl: 'https://github.com/bitnami/charts', sourceDirectory: 'bitnami/airflow' }} - ${'coredns'} | ${{ sourceUrl: 'https://github.com/coredns/helm', sourceDirectory: undefined }} - ${'pgadmin4'} | ${{ sourceUrl: 'https://github.com/rowanruseler/helm-charts', sourceDirectory: undefined }} - ${'dummy'} | ${{}} + input | output + ${'airflow'} | ${{ sourceUrl: 'https://github.com/bitnami/charts', sourceDirectory: 'bitnami/airflow' }} + ${'coredns'} | ${{ sourceUrl: 'https://github.com/coredns/helm', sourceDirectory: undefined }} + ${'pgadmin4'} | ${{ sourceUrl: 'https://github.com/rowanruseler/helm-charts', sourceDirectory: undefined }} + ${'dummy-no-home'} | ${{ sourceUrl: 'https://github.com/dummyorg/dummymonorepo', sourceDirectory: 'charts/dummy-no-home' }} + ${'dummy-no-chart-repo'} | ${{ sourceUrl: 'https://github.com/dummyorg/dummymonorepo', sourceDirectory: 'charts/dummy-no-chart-repo' }} + ${'dummy'} | ${{}} `( '$input -> $output', ({ input, output }: { input: string; output: string }) => { diff --git a/lib/modules/datasource/helm/common.ts b/lib/modules/datasource/helm/common.ts index 4dfc00984b2648..0a82fd9988693d 100644 --- a/lib/modules/datasource/helm/common.ts +++ b/lib/modules/datasource/helm/common.ts @@ -16,13 +16,11 @@ export function findSourceUrl(release: HelmRelease): RepoSource { return { sourceUrl: releaseMatch[1] }; } - if (release.home) { - const githubUrlMatch = githubUrl.exec(release.home); - if (githubUrlMatch?.groups && chartRepo.test(githubUrlMatch?.groups.repo)) { - return { - sourceUrl: githubUrlMatch.groups.url, - sourceDirectory: githubUrlMatch.groups.path, - }; + const homeMatchGroups = release.home && githubUrl.exec(release.home)?.groups; + if (homeMatchGroups) { + const { url: sourceUrl, path: sourceDirectory, repo } = homeMatchGroups; + if (chartRepo.test(repo)) { + return { sourceUrl, sourceDirectory }; } } @@ -31,15 +29,36 @@ export function findSourceUrl(release: HelmRelease): RepoSource { } for (const url of release.sources) { - const githubUrlMatch = githubUrl.exec(url); - if (githubUrlMatch?.groups && chartRepo.test(githubUrlMatch?.groups.repo)) { - return { - sourceUrl: githubUrlMatch.groups.url, - sourceDirectory: githubUrlMatch.groups.path, - }; + const githubUrlMatchGroups = githubUrl.exec(url)?.groups; + if (githubUrlMatchGroups) { + const { + url: sourceUrl, + path: sourceDirectory, + repo, + } = githubUrlMatchGroups; + if (chartRepo.test(repo)) { + return { sourceUrl, sourceDirectory }; + } + } + } + + // fallback: if neither home nor sources are a chart repo URL, use githubUrl (if present) + if (homeMatchGroups) { + const { url: sourceUrl, path: sourceDirectory } = homeMatchGroups; + if (sourceUrl && sourceDirectory) { + return { sourceUrl, sourceDirectory }; + } + } + + for (const source of release.sources) { + const firstSourceMatch = githubUrl.exec(source)?.groups; + if (firstSourceMatch) { + const { url: sourceUrl, path: sourceDirectory } = firstSourceMatch; + if (sourceUrl && sourceDirectory) { + return { sourceUrl, sourceDirectory }; + } } } - // fallback return { sourceUrl: release.sources[0] }; } diff --git a/lib/modules/datasource/helm/index.spec.ts b/lib/modules/datasource/helm/index.spec.ts index 54ea10e1198a18..3d03c3b992bef8 100644 --- a/lib/modules/datasource/helm/index.spec.ts +++ b/lib/modules/datasource/helm/index.spec.ts @@ -189,5 +189,23 @@ describe('modules/datasource/helm/index', () => { releases: expect.toBeArrayOfSize(27), }); }); + + it('returns home and source metadata of the most recent version', async () => { + httpMock + .scope('https://example-repository.com') + .get('/index.yaml') + .reply(200, indexYaml); + const releases = await getPkgReleases({ + datasource: HelmDatasource.id, + depName: 'cluster-autoscaler', + registryUrls: ['https://example-repository.com'], + }); + expect(releases).not.toBeNull(); + expect(releases).toMatchObject({ + homepage: 'https://www.autoscaler.io/9.11.0', + sourceDirectory: 'cluster-autoscaler#9.11.0', + sourceUrl: 'https://github.com/kubernetes/autoscaler', + }); + }); }); }); diff --git a/lib/modules/datasource/helm/index.ts b/lib/modules/datasource/helm/index.ts index 6b0018f698bd88..2d719d5ebd3b3c 100644 --- a/lib/modules/datasource/helm/index.ts +++ b/lib/modules/datasource/helm/index.ts @@ -1,5 +1,6 @@ import is from '@sindresorhus/is'; import { load } from 'js-yaml'; +import { gt } from 'semver'; import { logger } from '../../../logger'; import { cache } from '../../../util/cache/package/decorator'; import { ensureTrailingSlash } from '../../../util/url'; @@ -62,9 +63,12 @@ export class HelmDatasource extends Datasource { } const result: HelmRepositoryData = {}; for (const [name, releases] of Object.entries(doc.entries)) { - const { sourceUrl, sourceDirectory } = findSourceUrl(releases[0]); + const latestRelease = releases.sort((r0, r1) => + gt(r0.version, r1.version) ? -1 : 1 + )[0]; + const { sourceUrl, sourceDirectory } = findSourceUrl(latestRelease); result[name] = { - homepage: releases[0].home, + homepage: latestRelease.home, sourceUrl, sourceDirectory, releases: releases.map((release) => ({ From 54c35dbbd4903bd8e4d96a99a5946ad81b4d718f Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Fri, 24 Jun 2022 10:21:08 +0200 Subject: [PATCH 184/240] fix(config): apply secrets to global hostRules (#16217) * fix(config): apply secrets to global hostRules Closes #16215 * fix import ordering Co-authored-by: Michael Kriese --- lib/workers/global/initialize.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/workers/global/initialize.ts b/lib/workers/global/initialize.ts index 45558a690bd88e..81d603f34cd9dc 100644 --- a/lib/workers/global/initialize.ts +++ b/lib/workers/global/initialize.ts @@ -1,6 +1,7 @@ import os from 'os'; import fs from 'fs-extra'; import upath from 'upath'; +import { applySecretsToConfig } from '../../config/secrets'; import type { AllConfig, RenovateConfig } from '../../config/types'; import { logger } from '../../logger'; import { initPlatform } from '../../modules/platform'; @@ -46,6 +47,7 @@ async function checkVersions(): Promise { function setGlobalHostRules(config: RenovateConfig): void { if (config.hostRules) { logger.debug('Setting global hostRules'); + applySecretsToConfig(config, undefined, false); config.hostRules.forEach((rule) => hostRules.add(rule)); } } From cfc8b0b859afa97268c5b3a1d83922964a0f9cb3 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Fri, 24 Jun 2022 11:32:41 +0200 Subject: [PATCH 185/240] fix(config): add missing `globalOnly` flags (#16202) --- lib/config/options/index.ts | 9 +++++++++ test/website-docs.spec.ts | 3 +-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/config/options/index.ts b/lib/config/options/index.ts index 25ba3c862c1f93..e9c2c29b8a84d1 100644 --- a/lib/config/options/index.ts +++ b/lib/config/options/index.ts @@ -241,6 +241,7 @@ const options: RenovateOptions[] = [ stage: 'global', type: 'boolean', default: true, + globalOnly: true, }, { name: 'draftPR', @@ -281,6 +282,7 @@ const options: RenovateOptions[] = [ 'If set, this Redis URL will be used for caching instead of the file system.', stage: 'global', type: 'string', + globalOnly: true, }, { name: 'baseDir', @@ -288,6 +290,7 @@ const options: RenovateOptions[] = [ 'The base directory for Renovate to store local files, including repository files and cache. If left empty, Renovate will create its own temporary directory to use.', stage: 'global', type: 'string', + globalOnly: true, }, { name: 'cacheDir', @@ -341,6 +344,7 @@ const options: RenovateOptions[] = [ description: 'Log file path.', stage: 'global', type: 'string', + globalOnly: true, }, { name: 'logFileLevel', @@ -348,6 +352,7 @@ const options: RenovateOptions[] = [ stage: 'global', type: 'string', default: 'debug', + globalOnly: true, }, { name: 'logContext', @@ -689,6 +694,7 @@ const options: RenovateOptions[] = [ stage: 'global', type: 'boolean', default: false, + globalOnly: true, }, { name: 'autodiscoverFilter', @@ -696,6 +702,7 @@ const options: RenovateOptions[] = [ stage: 'global', type: 'string', default: null, + globalOnly: true, }, { name: 'prCommitsPerRunLimit', @@ -704,6 +711,7 @@ const options: RenovateOptions[] = [ stage: 'global', type: 'integer', default: 0, + globalOnly: true, }, { name: 'repositories', @@ -711,6 +719,7 @@ const options: RenovateOptions[] = [ stage: 'global', type: 'array', cli: false, + globalOnly: true, }, { name: 'baseBranches', diff --git a/test/website-docs.spec.ts b/test/website-docs.spec.ts index a856acf2d55fc3..3895146656303c 100644 --- a/test/website-docs.spec.ts +++ b/test/website-docs.spec.ts @@ -33,7 +33,6 @@ describe('website-docs', () => { .match(/\n## (.*?)\n/g) ?.map((match) => match.substring(4, match.length - 1)); const expectedOptions = options - .filter((option) => option.stage !== 'global') .filter((option) => option.releaseStatus !== 'unpublished') .filter((option) => !option.globalOnly) .filter((option) => !option.parent) @@ -42,7 +41,7 @@ describe('website-docs', () => { .sort(); const selfHostExpectedOptions = options - .filter((option) => !!option.globalOnly || option.stage === 'global') + .filter((option) => !!option.globalOnly) .map((option) => option.name) .sort(); From 9d35b9df0752bbb960632a07ba790d62c04e9d6c Mon Sep 17 00:00:00 2001 From: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Date: Fri, 24 Jun 2022 12:42:07 +0200 Subject: [PATCH 186/240] docs(nuget): rewrite readme (#16179) --- lib/modules/manager/nuget/readme.md | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/lib/modules/manager/nuget/readme.md b/lib/modules/manager/nuget/readme.md index 9ee0df70d66bb3..dd4e8dccdf1b6c 100644 --- a/lib/modules/manager/nuget/readme.md +++ b/lib/modules/manager/nuget/readme.md @@ -1,5 +1,21 @@ -The `nuget` configuration object is used to control settings for the NuGet package manager. -The NuGet package manager supports a SDK-style `.csproj`/`.fsproj`/`.vbproj`/`.props`/`.targets` format, as described [here](https://natemcmaster.com/blog/2017/03/09/vs2015-to-vs2017-upgrade/). -This means that .NET Core projects are all supported but any .NET Framework projects need to be updated to the new `.csproj`/`.fsproj`/`.vbproj`/`.props`/`.targets` format in order to be detected and supported by Renovate. +Use [`packageRules`](https://docs.renovatebot.com/configuration-options/#packagerules) to control the behavior of the NuGet package manager. -The NuGet manager also supports `global.json` and `dotnet-tools.json` SDK files. +The NuGet package manager supports these SDK-style files and formats: + +- `.csproj` +- `.fsproj` +- `.vbproj` +- `.props` +- `.targets` +- `global.json` +- `dotnet-tools.json` + +.NET Core projects are supported by default. + +For Renovate to work with .NET Framework projects, you need to update these files so they match the new SDK-style format: + +- `.csproj` +- `.fsproj` +- `.vbproj` +- `.props` +- `.targets` From 146512ba93d62a174d3e6841a9a042b0bdc3c4a8 Mon Sep 17 00:00:00 2001 From: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Date: Fri, 24 Jun 2022 13:07:58 +0200 Subject: [PATCH 187/240] docs(self-hosted config): improve unicodeEmoji section (#16219) --- docs/usage/self-hosted-configuration.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/usage/self-hosted-configuration.md b/docs/usage/self-hosted-configuration.md index 15011fea85b193..232e8239e24c02 100644 --- a/docs/usage/self-hosted-configuration.md +++ b/docs/usage/self-hosted-configuration.md @@ -686,7 +686,8 @@ This is currently applicable to `npm` and `lerna`/`npm` only, and only used in c ## unicodeEmoji -If enabled emoji shortcodes (`:warning:`) are replaced with their Unicode equivalents (`⚠ī¸`). +If enabled emoji shortcodes are replaced with their Unicode equivalents. +For example: `:warning:` will be replaced with `⚠ī¸`. ## username From a1b157428652a2d0301d84821de1f41078601e70 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 24 Jun 2022 12:30:49 +0000 Subject: [PATCH 188/240] chore(deps): update dependency @types/jest to v28.1.2 (#16221) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 34 +++++++++++++++++----------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index 1d06930df55b52..21342a1ac3832b 100644 --- a/package.json +++ b/package.json @@ -239,7 +239,7 @@ "@types/github-url-from-git": "1.5.1", "@types/global-agent": "2.1.1", "@types/ini": "1.3.31", - "@types/jest": "28.1.1", + "@types/jest": "28.1.2", "@types/js-yaml": "4.0.5", "@types/json-dup-key-validator": "1.0.0", "@types/linkify-markdown": "1.0.1", diff --git a/yarn.lock b/yarn.lock index 4a18228fc157e2..b095bd2c26572f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2520,13 +2520,13 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/jest@28.1.1": - version "28.1.1" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-28.1.1.tgz#8c9ba63702a11f8c386ee211280e8b68cb093cd1" - integrity sha512-C2p7yqleUKtCkVjlOur9BWVA4HgUQmEj/HWCt5WzZ5mLXrWnyIfl0wGuArc+kBXsy0ZZfLp+7dywB4HtSVYGVA== +"@types/jest@28.1.2": + version "28.1.2" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-28.1.2.tgz#c678569bb2d8e5474dd88f0851613611aeed9809" + integrity sha512-5dNM7mMuIrCtNJsFfvUO/5xCrG8swuT2c7ND+sl3XwlwxJf3k7e7o+PRvcFN/iIm8XhCqHqxLOj9yutDDOJoRg== dependencies: - jest-matcher-utils "^27.0.0" - pretty-format "^27.0.0" + jest-matcher-utils "^28.0.0" + pretty-format "^28.0.0" "@types/js-yaml@4.0.5": version "4.0.5" @@ -5965,7 +5965,7 @@ jest-matcher-utils@28.1.0: jest-get-type "^28.0.2" pretty-format "^28.1.0" -jest-matcher-utils@^27.0.0, jest-matcher-utils@^28.0.0, jest-matcher-utils@^28.1.1: +jest-matcher-utils@^28.0.0, jest-matcher-utils@^28.1.1: version "28.1.1" resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-28.1.1.tgz#a7c4653c2b782ec96796eb3088060720f1e29304" integrity sha512-NPJPRWrbmR2nAJ+1nmnfcKKzSwgfaciCCrYZzVnNoxVoyusYWIjkBMNvu0RHJe7dNj4hH3uZOPZsQA+xAYWqsw== @@ -7927,16 +7927,6 @@ pretty-bytes@^5.1.0: resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb" integrity sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg== -pretty-format@^27.0.0, pretty-format@^28.0.0, pretty-format@^28.1.0, pretty-format@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-28.1.1.tgz#f731530394e0f7fcd95aba6b43c50e02d86b95cb" - integrity sha512-wwJbVTGFHeucr5Jw2bQ9P+VYHyLdAqedFLEkdQUVaBF/eiidDwH5OpilINq4mEfhbCjLnirt6HTTDhv1HaTIQw== - dependencies: - "@jest/schemas" "^28.0.2" - ansi-regex "^5.0.1" - ansi-styles "^5.0.0" - react-is "^18.0.0" - pretty-format@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.5.1.tgz#2181879fdea51a7a5851fb39d920faa63f01d88e" @@ -7946,6 +7936,16 @@ pretty-format@^27.5.1: ansi-styles "^5.0.0" react-is "^17.0.1" +pretty-format@^28.0.0, pretty-format@^28.1.0, pretty-format@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-28.1.1.tgz#f731530394e0f7fcd95aba6b43c50e02d86b95cb" + integrity sha512-wwJbVTGFHeucr5Jw2bQ9P+VYHyLdAqedFLEkdQUVaBF/eiidDwH5OpilINq4mEfhbCjLnirt6HTTDhv1HaTIQw== + dependencies: + "@jest/schemas" "^28.0.2" + ansi-regex "^5.0.1" + ansi-styles "^5.0.0" + react-is "^18.0.0" + pretty-quick@3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/pretty-quick/-/pretty-quick-3.1.3.tgz#15281108c0ddf446675157ca40240099157b638e" From 037ed81544562e7a7f80c8bee4285b763dc3a95d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 24 Jun 2022 18:42:52 +0000 Subject: [PATCH 189/240] chore(deps): update dependency typescript to v4.7.4 (#16226) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 21342a1ac3832b..872a2dd8cfffcd 100644 --- a/package.json +++ b/package.json @@ -301,7 +301,7 @@ "ts-jest": "28.0.5", "ts-node": "10.8.1", "type-fest": "2.12.2", - "typescript": "4.7.3", + "typescript": "4.7.4", "unified": "9.2.2" }, "resolutions": { diff --git a/yarn.lock b/yarn.lock index b095bd2c26572f..35ec78245c846b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9264,10 +9264,10 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" -typescript@4.7.3: - version "4.7.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.3.tgz#8364b502d5257b540f9de4c40be84c98e23a129d" - integrity sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA== +typescript@4.7.4: + version "4.7.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235" + integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ== uc.micro@^1.0.1, uc.micro@^1.0.5: version "1.0.6" From 9f0195443fdb95d01287914b9e543e4a487fd68f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 24 Jun 2022 21:29:59 +0000 Subject: [PATCH 190/240] chore(deps): update dependency eslint to v8.18.0 (#16228) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 872a2dd8cfffcd..bb276b452232b5 100644 --- a/package.json +++ b/package.json @@ -267,7 +267,7 @@ "cross-env": "7.0.3", "diff": "5.1.0", "emojibase-data": "7.0.1", - "eslint": "8.17.0", + "eslint": "8.18.0", "eslint-config-prettier": "8.5.0", "eslint-formatter-gha": "1.4.1", "eslint-import-resolver-typescript": "2.7.1", diff --git a/yarn.lock b/yarn.lock index 35ec78245c846b..dbd1c341aba35d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4494,10 +4494,10 @@ eslint-visitor-keys@^3.3.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== -eslint@8.17.0: - version "8.17.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.17.0.tgz#1cfc4b6b6912f77d24b874ca1506b0fe09328c21" - integrity sha512-gq0m0BTJfci60Fz4nczYxNAlED+sMcihltndR8t9t1evnU/azx53x3t2UHXC/uRjcbvRw/XctpaNygSTcQD+Iw== +eslint@8.18.0: + version "8.18.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.18.0.tgz#78d565d16c993d0b73968c523c0446b13da784fd" + integrity sha512-As1EfFMVk7Xc6/CvhssHUjsAQSkpfXvUGMFC3ce8JDe6WvqCgRrLOBQbVpsBFr1X1V+RACOadnzVvcUS5ni2bA== dependencies: "@eslint/eslintrc" "^1.3.0" "@humanwhocodes/config-array" "^0.9.2" From 1f778166e58a056b41271e943c2fee4b09d2dd02 Mon Sep 17 00:00:00 2001 From: Alan Ross-Ross <11589230+alanrossx2@users.noreply.github.com> Date: Sat, 25 Jun 2022 01:38:19 -0400 Subject: [PATCH 191/240] feat(bumpVersion): add prerelease semver level (#15626) --- docs/usage/configuration-options.md | 2 +- lib/config/options/index.ts | 2 +- .../manager/maven/__fixtures__/prerelease.pom.xml | 6 ++++++ lib/modules/manager/maven/update.spec.ts | 12 ++++++++++++ 4 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 lib/modules/manager/maven/__fixtures__/prerelease.pom.xml diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index a0a8e74d29dc86..d244610892a925 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -320,7 +320,7 @@ Currently this setting supports `helmv3`, `npm`, `maven` and `sbt` only, so rais Its purpose is if you want Renovate to update the `version` field within your package file any time it updates dependencies within. Usually this is for automatic release purposes, so that you don't need to add another step after Renovate before you can release a new version. -Configure this value to `"patch"`, `"minor"` or `"major"` to have Renovate update the version in your edited package file. +Configure this value to `"prerelease"`, `"patch"`, `"minor"` or `"major"` to have Renovate update the version in your edited package file. e.g. if you wish Renovate to always increase the target `package.json` version with a patch update, configure this to `"patch"`. For `npm` only you can also configure this field to `"mirror:x"` where `x` is the name of a package in the `package.json`. diff --git a/lib/config/options/index.ts b/lib/config/options/index.ts index e9c2c29b8a84d1..a5b945ad1ce9da 100644 --- a/lib/config/options/index.ts +++ b/lib/config/options/index.ts @@ -1250,7 +1250,7 @@ const options: RenovateOptions[] = [ name: 'bumpVersion', description: 'Bump the version in the package file being updated.', type: 'string', - allowedValues: ['major', 'minor', 'patch'], + allowedValues: ['major', 'minor', 'patch', 'prerelease'], supportedManagers: ['helmv3', 'npm', 'maven', 'sbt'], }, // Major/Minor/Patch diff --git a/lib/modules/manager/maven/__fixtures__/prerelease.pom.xml b/lib/modules/manager/maven/__fixtures__/prerelease.pom.xml new file mode 100644 index 00000000000000..456a22e1e24e2f --- /dev/null +++ b/lib/modules/manager/maven/__fixtures__/prerelease.pom.xml @@ -0,0 +1,6 @@ + + 4.0.0 + com.mycompany.app + my-app + 1.0.0-1 + \ No newline at end of file diff --git a/lib/modules/manager/maven/update.spec.ts b/lib/modules/manager/maven/update.spec.ts index dbe881f8d9260b..6e735018fe4668 100644 --- a/lib/modules/manager/maven/update.spec.ts +++ b/lib/modules/manager/maven/update.spec.ts @@ -5,6 +5,7 @@ import * as pomUpdater from '.'; const simpleContent = Fixtures.get(`simple.pom.xml`); const minimumContent = Fixtures.get(`minimum.pom.xml`); +const prereleaseContent = Fixtures.get(`prerelease.pom.xml`); describe('modules/manager/maven/update', () => { describe('bumpPackageVersion', () => { @@ -63,5 +64,16 @@ describe('modules/manager/maven/update', () => { ); expect(bumpedContent).toEqual(simpleContent); }); + + it('bumps pom.xml version with prerelease semver level', () => { + const { bumpedContent } = pomUpdater.bumpPackageVersion( + prereleaseContent, + '1.0.0-1', + 'prerelease' + ); + + const project = new XmlDocument(bumpedContent!); + expect(project.valueWithPath('version')).toBe('1.0.0-2'); + }); }); }); From 26cf208e2cf3b66f6dacd31a7c8c0e35570a35eb Mon Sep 17 00:00:00 2001 From: Gabriel-Ladzaretti <97394622+Gabriel-Ladzaretti@users.noreply.github.com> Date: Sat, 25 Jun 2022 11:10:35 +0300 Subject: [PATCH 192/240] docs(core/config): Experimental feature handling (#16183) --- docs/usage/self-hosted-configuration.md | 4 -- lib/config/options/index.ts | 1 + lib/config/types.ts | 8 ++- test/website-docs.spec.ts | 1 - tools/docs/config.ts | 76 +++++++++++++++++++++++-- 5 files changed, 77 insertions(+), 13 deletions(-) diff --git a/docs/usage/self-hosted-configuration.md b/docs/usage/self-hosted-configuration.md index 232e8239e24c02..998f6d9a2b1819 100644 --- a/docs/usage/self-hosted-configuration.md +++ b/docs/usage/self-hosted-configuration.md @@ -610,10 +610,6 @@ Set this to `"enabled"` to have Renovate maintain a JSON file cache per-reposito Set to `"reset"` if you ever need to bypass the cache and have it overwritten. JSON files will be stored inside the `cacheDir` beside the existing file-based package cache. - -!!! warning - This is an experimental feature and may be modified or removed in a future non-major release. - ## requireConfig By default, Renovate needs a Renovate config file in each repository where it runs before it will propose any dependency updates. diff --git a/lib/config/options/index.ts b/lib/config/options/index.ts index a5b945ad1ce9da..aabe34a1955013 100644 --- a/lib/config/options/index.ts +++ b/lib/config/options/index.ts @@ -223,6 +223,7 @@ const options: RenovateOptions[] = [ allowedValues: ['disabled', 'enabled', 'reset'], stage: 'repository', default: 'disabled', + experimental: true, }, { name: 'force', diff --git a/lib/config/types.ts b/lib/config/types.ts index 9fde0ac3300c7a..186b3cb50decc8 100644 --- a/lib/config/types.ts +++ b/lib/config/types.ts @@ -341,9 +341,13 @@ export interface RenovateOptionBase { // used by tests relatedOptions?: string[]; - releaseStatus?: 'alpha' | 'beta' | 'unpublished'; - stage?: RenovateConfigStage; + + experimental?: boolean; + + experimentalDescription?: string; + + experimentalIssues?: number[]; } export interface RenovateArrayOption< diff --git a/test/website-docs.spec.ts b/test/website-docs.spec.ts index 3895146656303c..b398d2bb6471ee 100644 --- a/test/website-docs.spec.ts +++ b/test/website-docs.spec.ts @@ -33,7 +33,6 @@ describe('website-docs', () => { .match(/\n## (.*?)\n/g) ?.map((match) => match.substring(4, match.length - 1)); const expectedOptions = options - .filter((option) => option.releaseStatus !== 'unpublished') .filter((option) => !option.globalOnly) .filter((option) => !option.parent) .filter((option) => !option.autogenerated) diff --git a/tools/docs/config.ts b/tools/docs/config.ts index 7a2a412424bc46..110773c666440d 100644 --- a/tools/docs/config.ts +++ b/tools/docs/config.ts @@ -1,10 +1,12 @@ import stringify from 'json-stringify-pretty-compact'; import { getOptions } from '../../lib/config/options'; +import { getManagerList } from '../../lib/modules/manager'; import { getCliName } from '../../lib/workers/global/config/parse/cli'; import { getEnvName } from '../../lib/workers/global/config/parse/env'; import { readFile, updateFile } from '../utils'; const options = getOptions(); +const managers = new Set(getManagerList()); /** * Merge string arrays one by one @@ -86,6 +88,9 @@ function genTable(obj: [string, string][], type: string, def: any): string { 'allowString', 'admin', 'globalOnly', + 'experimental', + 'experimentalDescription', + 'experimentalIssues', ]; obj.forEach(([key, val]) => { const el = [key, val]; @@ -142,13 +147,59 @@ function genTable(obj: [string, string][], type: string, def: any): string { } function stringifyArrays(el: Record): void { + const ignoredKeys = ['default', 'experimentalIssues']; + for (const [key, value] of Object.entries(el)) { - if (key !== 'default' && Array.isArray(value)) { + if (!ignoredKeys.includes(key) && Array.isArray(value)) { el[key] = value.join(', '); } } } +function genExperimentalMsg(el: Record): string { + const ghIssuesUrl = 'https://github.com/renovatebot/renovate/issues/'; + let warning = + '\n\n!!! warning "This feature is flagged as experimental"\n'; + + if (el.experimentalDescription) { + warning += indent`${2}${el.experimentalDescription}`; + } else { + warning += indent`${2}Experimental features might be changed or even removed at any time.`; + } + + const issues = el.experimentalIssues ?? []; + if (issues.length > 0) { + warning += `
To track this feature visit the following GitHub ${ + issues.length > 1 ? 'issues' : 'issue' + } `; + warning += + (issues + .map((issue: number) => `[#${issue}](${ghIssuesUrl}${issue})`) + .join(', ') as string) + '.'; + } + + return warning + '\n'; +} + +function indexMarkdown(lines: string[]): Record { + const indexed: Record = {}; + + let optionName = ''; + let start = 0; + for (const [i, line] of lines.entries()) { + if (line.startsWith('## ') || line.startsWith('### ')) { + if (optionName) { + indexed[optionName] = [start, i - 1]; + } + start = i; + optionName = line.split(' ')[1]; + } + } + indexed[optionName] = [start, lines.length - 1]; + + return indexed; +} + export async function generateConfig(dist: string, bot = false): Promise { let configFile = `configuration-options.md`; if (bot) { @@ -159,15 +210,24 @@ export async function generateConfig(dist: string, bot = false): Promise { '\n' ); + const indexed = indexMarkdown(configOptionsRaw); + options - .filter((option) => option.releaseStatus !== 'unpublished') + .filter( + (option) => !!option.globalOnly === bot && !managers.has(option.name) + ) .forEach((option) => { - // TODO: fix types (#9610) + // TODO: fix types (#7154,#9610) const el: Record = { ...option }; - let headerIndex = configOptionsRaw.indexOf(`## ${option.name}`); - if (headerIndex === -1) { - headerIndex = configOptionsRaw.indexOf(`### ${option.name}`); + + if (!indexed[option.name]) { + throw new Error( + `Config option "${option.name}" is missing an entry in ${configFile}` + ); } + + const [headerIndex, footerIndex] = indexed[option.name]; + el.cli = getCliName(option); el.env = getEnvName(option); stringifyArrays(el); @@ -175,6 +235,10 @@ export async function generateConfig(dist: string, bot = false): Promise { configOptionsRaw[headerIndex] += `\n${option.description}\n\n` + genTable(Object.entries(el), option.type, option.default); + + if (el.experimental) { + configOptionsRaw[footerIndex] += genExperimentalMsg(el); + } }); await updateFile(`${dist}/${configFile}`, configOptionsRaw.join('\n')); From 92057df4b4d64ec2dbfce9ec415c3ebb49836612 Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Sat, 25 Jun 2022 10:39:37 +0200 Subject: [PATCH 193/240] fix(nuget): filter project references for non empty strings (#16232) Closes #16231 --- lib/modules/manager/nuget/package-tree.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/modules/manager/nuget/package-tree.ts b/lib/modules/manager/nuget/package-tree.ts index 1a9537f6a30fe8..cce82fb5c870b4 100644 --- a/lib/modules/manager/nuget/package-tree.ts +++ b/lib/modules/manager/nuget/package-tree.ts @@ -1,3 +1,4 @@ +import is from '@sindresorhus/is'; import Graph from 'graph-data-structure'; import minimatch from 'minimatch'; import upath from 'upath'; @@ -46,7 +47,8 @@ export async function getDependentPackageFiles( .childrenNamed('ItemGroup') .map((ig) => ig.childrenNamed('ProjectReference')) .flat() - .map((pf) => pf.attr['Include']); + .map((pf) => pf.attr['Include']) + .filter(is.nonEmptyString); const projectReferences = projectReferenceAttributes.map((a) => upath.normalize(a) From 8e9d9245b346e4c4ed98d6f2fca8e6fd9d5e0a23 Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Sat, 25 Jun 2022 16:43:01 +0300 Subject: [PATCH 194/240] feat(clojure): Support dependencies in `bb.edn` (#16234) --- lib/modules/manager/deps-edn/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/modules/manager/deps-edn/index.ts b/lib/modules/manager/deps-edn/index.ts index 599293213a6841..56aec50fd53aee 100644 --- a/lib/modules/manager/deps-edn/index.ts +++ b/lib/modules/manager/deps-edn/index.ts @@ -5,7 +5,7 @@ import { extractPackageFile } from './extract'; export { extractPackageFile }; export const defaultConfig = { - fileMatch: ['(^|/)deps\\.edn$'], + fileMatch: ['(^|/)(?:deps|bb)\\.edn$'], versioning: mavenVersioning.id, }; From b8b9314c03b6a7b190e61c7d27afe41125054e4e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 25 Jun 2022 15:26:42 +0000 Subject: [PATCH 195/240] build(deps): update dependency simple-git to v3.8.0 (#16237) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index bb276b452232b5..c99cfa091b87ab 100644 --- a/package.json +++ b/package.json @@ -204,7 +204,7 @@ "semver-stable": "3.0.0", "semver-utils": "1.1.4", "shlex": "2.1.0", - "simple-git": "3.7.1", + "simple-git": "3.8.0", "slugify": "1.6.5", "traverse": "0.6.6", "tslib": "2.4.0", diff --git a/yarn.lock b/yarn.lock index dbd1c341aba35d..4cceaaca3aa1dd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8606,14 +8606,14 @@ signale@^1.2.1: figures "^2.0.0" pkg-conf "^2.1.0" -simple-git@3.7.1: - version "3.7.1" - resolved "https://registry.yarnpkg.com/simple-git/-/simple-git-3.7.1.tgz#cb85c59da4da3d69792d206dd28cfbd803941fac" - integrity sha512-+Osjtsumbtew2y9to0pOYjNzSIr4NkKGBg7Po5SUtjQhaJf2QBmiTX/9E9cv9rmc7oUiSGFIB9e7ys5ibnT9+A== +simple-git@3.8.0: + version "3.8.0" + resolved "https://registry.yarnpkg.com/simple-git/-/simple-git-3.8.0.tgz#d93500f3d792cec365420c80ddc6cb782edf737d" + integrity sha512-nbR1PufcbvCaW90CiAXC1mM7OnEqLzjSOnySnq7Sd2kcVG6GxSa+DhxhFmCgxLv4kWCKmZagkCZSjfNAQTZwaw== dependencies: "@kwsites/file-exists" "^1.1.1" "@kwsites/promise-deferred" "^1.1.1" - debug "^4.3.3" + debug "^4.3.4" sinon@^11.1.1: version "11.1.2" From b1dbec712baf6db3a963c5717a3171900f1b516b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 25 Jun 2022 22:01:17 +0000 Subject: [PATCH 196/240] chore(deps): update dependency memfs to v3.4.6 (#16243) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index c99cfa091b87ab..2672ef1c7efb23 100644 --- a/package.json +++ b/package.json @@ -286,7 +286,7 @@ "jest-mock-extended": "2.0.6", "jest-silent-reporter": "0.5.0", "markdownlint-cli2": "0.4.0", - "memfs": "3.4.4", + "memfs": "3.4.6", "mock-fs": "5.1.2", "mockdate": "3.0.5", "nock": "13.2.7", diff --git a/yarn.lock b/yarn.lock index 4cceaaca3aa1dd..67452e08cc3f7b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4852,7 +4852,7 @@ fs-minipass@^2.0.0, fs-minipass@^2.1.0: dependencies: minipass "^3.0.0" -fs-monkey@1.0.3: +fs-monkey@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/fs-monkey/-/fs-monkey-1.0.3.tgz#ae3ac92d53bb328efe0e9a1d9541f6ad8d48e2d3" integrity sha512-cybjIfiiE+pTWicSCLFHSrXZ6EilF30oh91FDP9S2B051prEa7QWfrVTQm10/dDpswBDXZugPa1Ogu8Yh+HV0Q== @@ -6835,12 +6835,12 @@ mdurl@^1.0.1: resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" integrity sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g== -memfs@3.4.4: - version "3.4.4" - resolved "https://registry.yarnpkg.com/memfs/-/memfs-3.4.4.tgz#e8973cd8060548916adcca58a248e7805c715e89" - integrity sha512-W4gHNUE++1oSJVn8Y68jPXi+mkx3fXR5ITE/Ubz6EQ3xRpCN5k2CQ4AUR8094Z7211F876TyoBACGsIveqgiGA== +memfs@3.4.6: + version "3.4.6" + resolved "https://registry.yarnpkg.com/memfs/-/memfs-3.4.6.tgz#74097983d27c82b973665885dc75f27a65174510" + integrity sha512-rH9mjopto6Wkr7RFuH9l9dk3qb2XGOcYKr7xMhaYqfzuJqOqhRrcFvfD7JMuPj6SLmPreh5+6eAuv36NFAU+Mw== dependencies: - fs-monkey "1.0.3" + fs-monkey "^1.0.3" memorystream@^0.3.1: version "0.3.1" From ca8b206bc1872db0c97f66ef7a19a065ccdc6143 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 25 Jun 2022 22:18:10 +0000 Subject: [PATCH 197/240] build(deps): update dependency find-packages to v9.0.4 (#16242) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 42 +++++++++++++++++++++--------------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/package.json b/package.json index 2672ef1c7efb23..c9e58ec28a2d8d 100644 --- a/package.json +++ b/package.json @@ -167,7 +167,7 @@ "emojibase-regex": "6.0.1", "extract-zip": "2.0.1", "fast-safe-stringify": "2.1.1", - "find-packages": "9.0.3", + "find-packages": "9.0.4", "find-up": "5.0.0", "fs-extra": "10.1.0", "git-url-parse": "11.6.0", diff --git a/yarn.lock b/yarn.lock index 67452e08cc3f7b..f81a90b00b9de7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2013,15 +2013,15 @@ dependencies: graceful-fs "^4.2.6" -"@pnpm/read-project-manifest@3.0.3": - version "3.0.3" - resolved "https://registry.yarnpkg.com/@pnpm/read-project-manifest/-/read-project-manifest-3.0.3.tgz#bd0b31c0974ca45f66a13fec8c31d332c7cbd959" - integrity sha512-gkiv/CrU/cM4iPrqRThAp3c/gBAe8qwNnK4pXYmeqTeKe+Wnzrjpg9x4l0L+jYPpV2I/OvmucMnU3a5anMRksQ== +"@pnpm/read-project-manifest@3.0.4": + version "3.0.4" + resolved "https://registry.yarnpkg.com/@pnpm/read-project-manifest/-/read-project-manifest-3.0.4.tgz#111e315b32c2f951a53dd029249d1463ccf503ad" + integrity sha512-YtPdr82a1mrgQJefX3XZ8mp8yl9h50HTvyl3eqHjiZUB53ey1iFvkSzd9UjAeq2opeAnWeUK8JlMW/10KkUS1g== dependencies: "@pnpm/error" "3.0.1" "@pnpm/graceful-fs" "2.0.0" - "@pnpm/types" "8.1.0" - "@pnpm/write-project-manifest" "3.0.2" + "@pnpm/types" "8.2.0" + "@pnpm/write-project-manifest" "3.0.3" detect-indent "^6.0.0" fast-deep-equal "^3.1.3" is-windows "^1.0.2" @@ -2031,17 +2031,17 @@ sort-keys "^4.2.0" strip-bom "^4.0.0" -"@pnpm/types@8.1.0": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@pnpm/types/-/types-8.1.0.tgz#14488c184230aafae14886720bfc04871c95ad71" - integrity sha512-1AnX21D0vDE2yiNT85EWY9mEASgfPPNDun3bknLWULNjTfGCfiItZcTfmW4+hUgvFcoIW5PiTkpjxSMzHJ2BvA== +"@pnpm/types@8.2.0": + version "8.2.0" + resolved "https://registry.yarnpkg.com/@pnpm/types/-/types-8.2.0.tgz#752d19befb91e3358df303c44a3e0d8a6c5ff20b" + integrity sha512-Lr976vR4mezo3iL4bwGXyZFaDuVhkoko1Dr159mj+/GrqghiVmZFSZQQZNkfWEvMq1v3NSCTtPPzMTZASKJzCg== -"@pnpm/write-project-manifest@3.0.2": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@pnpm/write-project-manifest/-/write-project-manifest-3.0.2.tgz#c7b52727c3bdbf91159ed021d7253c876c9923a4" - integrity sha512-+yJQaoSkM9Nfaj5Zf/whAWwYkVwn4XFMdIV9xklJiScSf3Qd9QpFBdi2NIlxxgZwC9eEQSwj6xO3Z+jnPpyl4w== +"@pnpm/write-project-manifest@3.0.3": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@pnpm/write-project-manifest/-/write-project-manifest-3.0.3.tgz#1722e412bbffe12456ecfeaddf5f9ec1eb945403" + integrity sha512-nQBL/6iXTDOI3pYIUEb0VQLhjvgklpdstKP1fup5NuYUsvlNProVnWxHVxaU3y7kdAFcHGrHXJY4twLRX+pk8Q== dependencies: - "@pnpm/types" "8.1.0" + "@pnpm/types" "8.2.0" json5 "^2.1.3" write-file-atomic "^3.0.3" write-yaml-file "^4.2.0" @@ -4754,13 +4754,13 @@ filter-obj@^1.1.0: resolved "https://registry.yarnpkg.com/filter-obj/-/filter-obj-1.1.0.tgz#9b311112bc6c6127a16e016c6c5d7f19e0805c5b" integrity sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ== -find-packages@9.0.3: - version "9.0.3" - resolved "https://registry.yarnpkg.com/find-packages/-/find-packages-9.0.3.tgz#bd2e18a056a83a3c6a4dea54b15964e6065d20a3" - integrity sha512-GkH9OzuxG4s4IkHKukmrKu7pAL2NGGI9TCCskRpUCiWjLfiSoezWJPmqMV8xafH9pxw73gkmWAG2pZqsVSWZ9Q== +find-packages@9.0.4: + version "9.0.4" + resolved "https://registry.yarnpkg.com/find-packages/-/find-packages-9.0.4.tgz#f6429c8cf5dae0062d621360b8b7284c6ce7427a" + integrity sha512-+C7ND27Yv2L1ZyJFN1SV1Odkeo0YS8xIN6TPD3AMAIqtCe30BsPyOkYuhKLO5/Q7mtc14IIOmD1DP8+v3CYcpQ== dependencies: - "@pnpm/read-project-manifest" "3.0.3" - "@pnpm/types" "8.1.0" + "@pnpm/read-project-manifest" "3.0.4" + "@pnpm/types" "8.2.0" fast-glob "^3.2.4" p-filter "^2.1.0" From bdc7655a8d4f77d39ced708cac238cb926bef2f8 Mon Sep 17 00:00:00 2001 From: Maxime Brunet Date: Sat, 25 Jun 2022 21:34:26 -0700 Subject: [PATCH 198/240] docs(stabilityDays): suppress branch/PR creation with `internalChecksFilter="strict"` (#16240) --- docs/usage/configuration-options.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index d244610892a925..dc16dc99a99b8b 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -2700,7 +2700,7 @@ There are a couple of uses for `stabilityDays`: #### Suppress branch/PR creation for X days -If you combine `stabilityDays=3` and `prCreation="not-pending"` then Renovate will hold back from creating branches until 3 or more days have elapsed since the version was released. +If you combine `stabilityDays=3` and `internalChecksFilter="strict"` then Renovate will hold back from creating branches until 3 or more days have elapsed since the version was released. It's recommended that you enable `dependencyDashboard=true` so you don't lose visibility of these pending PRs. #### Prevent holding broken npm packages From 3b0c2afe8a373b93b810186ac2c021dc5a0342df Mon Sep 17 00:00:00 2001 From: Maksim Date: Sun, 26 Jun 2022 06:47:55 +0200 Subject: [PATCH 199/240] fix: commit message (#16239) --- .../repository/model/commit-message.ts | 4 ++ .../model/semantic-commit-message.spec.ts | 9 ++++ .../repository/updates/generate.spec.ts | 34 +++++++++++- lib/workers/repository/updates/generate.ts | 53 ++++++++----------- 4 files changed, 68 insertions(+), 32 deletions(-) diff --git a/lib/workers/repository/model/commit-message.ts b/lib/workers/repository/model/commit-message.ts index 0344e5b6471fc0..b909f5bc1d837d 100644 --- a/lib/workers/repository/model/commit-message.ts +++ b/lib/workers/repository/model/commit-message.ts @@ -60,6 +60,10 @@ export abstract class CommitMessage { this._footer = this.normalizeInput(value); } + get subject(): string { + return this._subject; + } + set subject(value: string) { this._subject = this.normalizeInput(value); this._subject = this._subject?.replace( diff --git a/lib/workers/repository/model/semantic-commit-message.spec.ts b/lib/workers/repository/model/semantic-commit-message.spec.ts index ffff30f3258f54..e2629fcc02edd3 100644 --- a/lib/workers/repository/model/semantic-commit-message.spec.ts +++ b/lib/workers/repository/model/semantic-commit-message.spec.ts @@ -25,6 +25,15 @@ describe('workers/repository/model/semantic-commit-message', () => { expect(message.toString()).toBe('fix(scope): test'); }); + it('should transform to lowercase only first letter', () => { + const message = new SemanticCommitMessage(); + message.subject = 'Update My Org dependencies'; + message.type = 'fix'; + message.scope = 'deps '; + + expect(message.toString()).toBe('fix(deps): update My Org dependencies'); + }); + it('should create instance from string without scope', () => { const instance = SemanticCommitMessage.fromString('feat: ticket 123'); diff --git a/lib/workers/repository/updates/generate.spec.ts b/lib/workers/repository/updates/generate.spec.ts index a6fa8195bf381b..87d7c55786962a 100644 --- a/lib/workers/repository/updates/generate.spec.ts +++ b/lib/workers/repository/updates/generate.spec.ts @@ -506,7 +506,7 @@ describe('workers/repository/updates/generate', () => { } as BranchUpgradeConfig, ]; const res = generateBranchConfig(branch); - expect(res.prTitle).toBe('chore(): update dependency some-dep to v1.2.0'); + expect(res.prTitle).toBe('chore: update dependency some-dep to v1.2.0'); }); it('scopes monorepo commits with nested package files using parent directory', () => { @@ -915,5 +915,37 @@ describe('workers/repository/updates/generate', () => { '`1.1.1` (+1)', ]); }); + + it('fixes commit message with body', () => { + const branch: BranchUpgradeConfig[] = [ + { + manager: 'some-manager', + branchName: 'some-branch', + commitMessage: 'update to vv1.2.0', + commitBody: 'some body', + }, + ]; + const res = generateBranchConfig(branch); + expect(res.commitMessage).toBe('Update to v1.2.0\n\nsome body'); + }); + + it('generates semantic commit message properly', () => { + const branch: BranchUpgradeConfig[] = [ + { + ...defaultConfig, + manager: 'some-manager', + branchName: 'some-branch', + semanticCommits: 'enabled', + semanticCommitType: 'chore', + semanticCommitScope: 'deps', + depName: 'some-dep', + newValue: '1.2.0', + } as BranchUpgradeConfig, + ]; + const res = generateBranchConfig(branch); + expect(res.commitMessage).toBe( + 'chore(deps): update dependency some-dep to 1.2.0' + ); + }); }); }); diff --git a/lib/workers/repository/updates/generate.ts b/lib/workers/repository/updates/generate.ts index 04af7f203a1bee..2f6c7c2826e609 100644 --- a/lib/workers/repository/updates/generate.ts +++ b/lib/workers/repository/updates/generate.ts @@ -6,11 +6,12 @@ import semver from 'semver'; import { mergeChildConfig } from '../../../config'; import { CONFIG_SECRETS_EXPOSED } from '../../../constants/error-messages'; import { logger } from '../../../logger'; -import { newlineRegex, regEx } from '../../../util/regex'; +import { regEx } from '../../../util/regex'; import { sanitize } from '../../../util/sanitize'; import * as template from '../../../util/template'; import type { BranchConfig, BranchUpgradeConfig } from '../../types'; -import { CommitMessage } from '../model/commit-message'; +import { CommitMessageFactory } from '../model/commit-message-factory'; +import { SemanticCommitMessage } from '../model/semantic-commit-message'; function isTypesGroup(branchUpgrades: BranchUpgradeConfig[]): boolean { return ( @@ -167,28 +168,27 @@ export function generateBranchConfig( } else if (semver.valid(toVersions[0])) { upgrade.isRange = false; } + const commitMessageFactory = new CommitMessageFactory(upgrade); + const commitMessage = commitMessageFactory.create(); // Use templates to generate strings - if (upgrade.semanticCommits === 'enabled' && !upgrade.commitMessagePrefix) { + if ( + SemanticCommitMessage.is(commitMessage) && + upgrade.semanticCommitScope + ) { logger.trace('Upgrade has semantic commits enabled'); - let semanticPrefix = upgrade.semanticCommitType; - if (upgrade.semanticCommitScope) { - semanticPrefix += `(${template.compile( - upgrade.semanticCommitScope, - upgrade - )})`; - } - upgrade.commitMessagePrefix = CommitMessage.formatPrefix(semanticPrefix!); - upgrade.toLowerCase = - regEx(/[A-Z]/).exec(upgrade.semanticCommitType!) === null && - !upgrade.semanticCommitType!.startsWith(':'); + commitMessage.scope = template.compile( + upgrade.semanticCommitScope, + upgrade + ); } // Compile a few times in case there are nested templates - upgrade.commitMessage = template.compile( + commitMessage.subject = template.compile( upgrade.commitMessage ?? '', upgrade ); - upgrade.commitMessage = template.compile(upgrade.commitMessage, upgrade); - upgrade.commitMessage = template.compile(upgrade.commitMessage, upgrade); + commitMessage.subject = template.compile(commitMessage.subject, upgrade); + commitMessage.subject = template.compile(commitMessage.subject, upgrade); + upgrade.commitMessage = commitMessage.toString(); // istanbul ignore if if (upgrade.commitMessage !== sanitize(upgrade.commitMessage)) { logger.debug( @@ -197,23 +197,14 @@ export function generateBranchConfig( ); throw new Error(CONFIG_SECRETS_EXPOSED); } - upgrade.commitMessage = upgrade.commitMessage.trim(); // Trim exterior whitespace - upgrade.commitMessage = upgrade.commitMessage.replace(regEx(/\s+/g), ' '); // Trim extra whitespace inside string - upgrade.commitMessage = upgrade.commitMessage.replace( + commitMessage.subject = commitMessage.subject.replace( regEx(/to vv(\d)/), 'to v$1' ); - if (upgrade.toLowerCase) { - // We only need to lowercase the first line - const splitMessage = upgrade.commitMessage.split(newlineRegex); - splitMessage[0] = splitMessage[0].toLowerCase(); - upgrade.commitMessage = splitMessage.join('\n'); - } + upgrade.commitMessage = commitMessage.toString(); if (upgrade.commitBody) { - upgrade.commitMessage = `${upgrade.commitMessage}\n\n${template.compile( - upgrade.commitBody, - upgrade - )}`; + commitMessage.body = template.compile(upgrade.commitBody, upgrade); + upgrade.commitMessage = commitMessage.toString(); } logger.trace(`commitMessage: ` + JSON.stringify(upgrade.commitMessage)); if (upgrade.prTitle) { @@ -235,7 +226,7 @@ export function generateBranchConfig( upgrade.prTitle = upgrade.prTitle.toLowerCase(); } } else { - [upgrade.prTitle] = upgrade.commitMessage.split(newlineRegex); + upgrade.prTitle = commitMessage.title; } upgrade.prTitle += upgrade.hasBaseBranches ? ' ({{baseBranch}})' : ''; if (upgrade.isGroup) { From aa8fa2d43621e5146f5b1d88ab4372cb1b3c891d Mon Sep 17 00:00:00 2001 From: Gabriel-Ladzaretti <97394622+Gabriel-Ladzaretti@users.noreply.github.com> Date: Sun, 26 Jun 2022 12:42:02 +0300 Subject: [PATCH 200/240] build(tools/clean-cache): fix upath import (#16245) * fix(tools/clean-cache): fix upath import * fix(tools/clean-cache): fix upath import --- tools/clean-cache.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/clean-cache.mjs b/tools/clean-cache.mjs index a3474ad9028d83..962f0109a5de0b 100644 --- a/tools/clean-cache.mjs +++ b/tools/clean-cache.mjs @@ -1,11 +1,11 @@ import { tmpdir } from 'os'; import { remove } from 'fs-extra'; -import { join } from 'upath'; +import upath from 'upath'; // eslint-disable-next-line @typescript-eslint/no-floating-promises (async () => { const tmpDir = process.env.RENOVATE_TMPDIR ?? tmpdir(); - const renovateDir = join(tmpDir, 'renovate'); + const renovateDir = upath.join(tmpDir, 'renovate'); // eslint-disable-next-line no-console console.log('Removing ' + renovateDir); await remove(renovateDir); From e987069a3aa392183c64a4ff8c4845d124762239 Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Sun, 26 Jun 2022 13:31:52 +0300 Subject: [PATCH 201/240] fix(helm): Use `semver-coerced` for determining latest release (#16229) --- lib/modules/datasource/helm/index.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/modules/datasource/helm/index.ts b/lib/modules/datasource/helm/index.ts index 2d719d5ebd3b3c..81372fe73b1546 100644 --- a/lib/modules/datasource/helm/index.ts +++ b/lib/modules/datasource/helm/index.ts @@ -1,6 +1,5 @@ import is from '@sindresorhus/is'; import { load } from 'js-yaml'; -import { gt } from 'semver'; import { logger } from '../../../logger'; import { cache } from '../../../util/cache/package/decorator'; import { ensureTrailingSlash } from '../../../util/url'; @@ -63,9 +62,17 @@ export class HelmDatasource extends Datasource { } const result: HelmRepositoryData = {}; for (const [name, releases] of Object.entries(doc.entries)) { - const latestRelease = releases.sort((r0, r1) => - gt(r0.version, r1.version) ? -1 : 1 - )[0]; + let latestRelease = releases[releases.length - 1]; + const sortedReleases = releases + .filter(({ version }) => helmVersioning.api.isValid(version)) + .sort((r0, r1) => + helmVersioning.api.sortVersions(r0.version, r1.version) + ); + const latestSortedRelease = sortedReleases[sortedReleases.length - 1]; + if (latestSortedRelease) { + latestRelease = latestSortedRelease; + } + const { sourceUrl, sourceDirectory } = findSourceUrl(latestRelease); result[name] = { homepage: latestRelease.home, From adec3d44abf00084444f5c651461f59176789ab6 Mon Sep 17 00:00:00 2001 From: Sebastian Poxhofer Date: Sun, 26 Jun 2022 19:00:34 +0200 Subject: [PATCH 202/240] docs(configuration-options): fix indentation of regexManager parameters (#16222) --- docs/usage/configuration-options.md | 42 ++++++++++++++--------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index dc16dc99a99b8b..09d3cf2bc44373 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -2230,27 +2230,6 @@ If the `versioning` field is missing, then Renovate defaults to using `semver` v For more details and examples, see our [documentation for the `regex` manager](/modules/manager/regex/). For template fields, use the triple brace `{{{ }}}` notation to avoid Handlebars escaping any special characters. -## registryAliases - -You can use the `registryAliases` object to set registry aliases. -This feature only works with these managers: - -- `helm-requirements` -- `helmv3` -- `helmfile` - -The managers listed above all have this default registryAlias: - -```json -{ - "registryAliases": { - "stable": "https://charts.helm.sh/stable" - } -} -``` - -Alias values must be properly formatted URIs. - ### matchStrings `matchStrings` should each be a valid regular expression, optionally with named capture groups. @@ -2497,6 +2476,27 @@ This will lead to following update where `1.21-alpine` is the newest version of image: my.new.registry/aRepository/andImage:1.21-alpine ``` +## registryAliases + +You can use the `registryAliases` object to set registry aliases. +This feature only works with these managers: + +- `helm-requirements` +- `helmv3` +- `helmfile` + +The managers listed above all have this default registryAlias: + +```json +{ + "registryAliases": { + "stable": "https://charts.helm.sh/stable" + } +} +``` + +Alias values must be properly formatted URIs. + ## registryUrls Usually Renovate is able to either (a) use the default registries for a datasource, or (b) automatically detect during the manager extract phase which custom registries are in use. From cb7cf476710bb9fc0b9eb91a7bf25f06bc1a07ca Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 27 Jun 2022 01:32:49 +0000 Subject: [PATCH 203/240] docs: update references to renovate/renovate to v32.99.5 (#16247) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- docs/usage/docker.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/docker.md b/docs/usage/docker.md index c9b15050175bef..b5a43c4bfd9d69 100644 --- a/docs/usage/docker.md +++ b/docs/usage/docker.md @@ -371,7 +371,7 @@ To get access to the token a custom Renovate Docker image is needed that include The Dockerfile to create such an image can look like this: ```Dockerfile -FROM renovate/renovate:32.90.0 +FROM renovate/renovate:32.99.5 # Include the "Docker tip" which you can find here https://cloud.google.com/sdk/docs/install # under "Installation" for "Debian/Ubuntu" RUN ... From 64f67974802fc8509328c1c0e521068ab122706e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 27 Jun 2022 01:45:46 +0000 Subject: [PATCH 204/240] chore(deps): lock file maintenance (#16248) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 427 +++++++++++++++++++++++------------------------------- 1 file changed, 181 insertions(+), 246 deletions(-) diff --git a/yarn.lock b/yarn.lock index f81a90b00b9de7..c2c7bae7d5b6e4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1344,7 +1344,7 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@gar/promisify@^1.0.1", "@gar/promisify@^1.1.3": +"@gar/promisify@^1.1.3": version "1.1.3" resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6" integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw== @@ -1628,28 +1628,28 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/gen-mapping@^0.3.0": - version "0.3.1" - resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.1.tgz#cf92a983c83466b8c0ce9124fadeaf09f7c66ea9" - integrity sha512-GcHwniMlA2z+WFPWuY8lp3fsza0I8xPFMWL5+n8LYyP6PSvPrXf4+n8stDHZY2DM0zy9sVkRDy1jDI4XGzYVqg== + version "0.3.2" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz#c1aedc61e853f2bb9f5dfe6d4442d3b565b253b9" + integrity sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A== dependencies: - "@jridgewell/set-array" "^1.0.0" + "@jridgewell/set-array" "^1.0.1" "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.9" "@jridgewell/resolve-uri@^3.0.3": - version "3.0.7" - resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.0.7.tgz#30cd49820a962aff48c8fffc5cd760151fca61fe" - integrity sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA== + version "3.0.8" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.0.8.tgz#687cc2bbf243f4e9a868ecf2262318e2658873a1" + integrity sha512-YK5G9LaddzGbcucK4c8h5tWFmMPBvRZ/uyWmN1/SbBdIvqGUdWGkJ5BAaccgs6XbzVLsqbPJrBSFwKv3kT9i7w== -"@jridgewell/set-array@^1.0.0": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.1.tgz#36a6acc93987adcf0ba50c66908bd0b70de8afea" - integrity sha512-Ct5MqZkLGEXTVmQYbGtx9SVqD2fqwvdubdps5D3djjAkgkKwT918VNOz65pEHFaYTeWcukmJmH5SwsA9Tn2ObQ== +"@jridgewell/set-array@^1.0.0", "@jridgewell/set-array@^1.0.1": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" + integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== "@jridgewell/sourcemap-codec@^1.4.10": - version "1.4.13" - resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz#b6461fb0c2964356c469e115f504c95ad97ab88c" - integrity sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w== + version "1.4.14" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" + integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== "@jridgewell/trace-mapping@0.3.9": version "0.3.9" @@ -1659,10 +1659,10 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" -"@jridgewell/trace-mapping@^0.3.7", "@jridgewell/trace-mapping@^0.3.9": - version "0.3.13" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.13.tgz#dcfe3e95f224c8fe97a87a5235defec999aa92ea" - integrity sha512-o1xbKhp9qnIAoHJSWd6KlCZfqslL4valSF81H8ImioOAxluWYWOpWkpyktY2vnt4tbrX9XYaxovq6cgowaJp2w== +"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.7", "@jridgewell/trace-mapping@^0.3.9": + version "0.3.14" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz#b231a081d8f66796e475ad588a1ef473112701ed" + integrity sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ== dependencies: "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" @@ -1711,9 +1711,9 @@ fastq "^1.6.0" "@npmcli/arborist@^5.0.0", "@npmcli/arborist@^5.0.4": - version "5.2.1" - resolved "https://registry.yarnpkg.com/@npmcli/arborist/-/arborist-5.2.1.tgz#4f38187cb694946f551a825df17e6efd565b8946" - integrity sha512-DNyTHov3lU7PtCGHABzrPqQOUiBdiYzZ5dLv3D0RD5I9KbmhTLcZI/rv3ddZY0K9vpDE/R+R48b+cU/dUkL0Tw== + version "5.2.3" + resolved "https://registry.yarnpkg.com/@npmcli/arborist/-/arborist-5.2.3.tgz#3cc5d7b4bcf9783c41b6beec908d3de9592b4952" + integrity sha512-2ywCfbN3ibONJ2t9Ke0CXIHa20yJH6/e3Kta3ZNabnFjm+5Amr+rw5qL52mVQBKxEB+pfSiZDsnqwyKyyj0JTQ== dependencies: "@isaacs/string-locale-compare" "^1.1.0" "@npmcli/installed-package-contents" "^1.0.7" @@ -1723,7 +1723,7 @@ "@npmcli/name-from-folder" "^1.0.1" "@npmcli/node-gyp" "^2.0.0" "@npmcli/package-json" "^2.0.0" - "@npmcli/run-script" "^3.0.0" + "@npmcli/run-script" "^4.1.3" bin-links "^3.0.0" cacache "^16.0.6" common-ancestor-path "^1.0.1" @@ -1737,7 +1737,7 @@ npm-pick-manifest "^7.0.0" npm-registry-fetch "^13.0.0" npmlog "^6.0.2" - pacote "^13.0.5" + pacote "^13.6.1" parse-conflict-json "^2.0.1" proc-log "^2.0.0" promise-all-reject-late "^1.0.0" @@ -1776,14 +1776,6 @@ dependencies: ansi-styles "^4.3.0" -"@npmcli/fs@^1.0.0": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@npmcli/fs/-/fs-1.1.1.tgz#72f719fe935e687c56a4faecf3c03d06ba593257" - integrity sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ== - dependencies: - "@gar/promisify" "^1.0.1" - semver "^7.3.5" - "@npmcli/fs@^2.1.0": version "2.1.0" resolved "https://registry.yarnpkg.com/@npmcli/fs/-/fs-2.1.0.tgz#f2a21c28386e299d1a9fae8051d35ad180e33109" @@ -1835,14 +1827,6 @@ pacote "^13.0.3" semver "^7.3.5" -"@npmcli/move-file@^1.0.1": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@npmcli/move-file/-/move-file-1.1.2.tgz#1a82c3e372f7cae9253eb66d72543d6b8685c674" - integrity sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg== - dependencies: - mkdirp "^1.0.4" - rimraf "^3.0.2" - "@npmcli/move-file@^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@npmcli/move-file/-/move-file-2.0.0.tgz#417f585016081a0184cef3e38902cd917a9bbd02" @@ -1875,14 +1859,14 @@ dependencies: infer-owner "^1.0.4" -"@npmcli/run-script@^3.0.0", "@npmcli/run-script@^3.0.1": - version "3.0.3" - resolved "https://registry.yarnpkg.com/@npmcli/run-script/-/run-script-3.0.3.tgz#66afa6e0c4c3484056195f295fa6c1d1a45ddf58" - integrity sha512-ZXL6qgC5NjwfZJ2nET+ZSLEz/PJgJ/5CU90C2S66dZY4Jw73DasS4ZCXuy/KHWYP0imjJ4VtA+Gebb5BxxKp9Q== +"@npmcli/run-script@^4.1.0", "@npmcli/run-script@^4.1.3": + version "4.1.3" + resolved "https://registry.yarnpkg.com/@npmcli/run-script/-/run-script-4.1.3.tgz#b89a3f861d740379892f9b2c44f8bb66dd7b577c" + integrity sha512-xb47c2KMkn6ERw2AwPPGKIITbWoXOT1yDV5rU3SYeC1vksYOodbgN0pnOptIVnRgS2e9G8R7BVDVm8lWp92unQ== dependencies: "@npmcli/node-gyp" "^2.0.0" "@npmcli/promise-spawn" "^3.0.0" - node-gyp "^8.4.1" + node-gyp "^9.0.0" read-package-json-fast "^2.0.3" "@octokit/auth-token@^2.4.4": @@ -1923,17 +1907,17 @@ "@octokit/types" "^6.0.3" universal-user-agent "^6.0.0" -"@octokit/openapi-types@^12.1.0": - version "12.1.0" - resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-12.1.0.tgz#a68b60e969f26dee0eb7d127c65a84967f2d3a6e" - integrity sha512-kQzJh3ZUv3lDpi6M+uekMRHULvf9DlWoI1XgKN6nPeGDzkSgtkhVq1MMz3bFKQ6H6GbdC3ZqG/a6VzKhIx0VeA== +"@octokit/openapi-types@^12.4.0": + version "12.4.0" + resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-12.4.0.tgz#fd8bf5db72bd566c5ba2cb76754512a9ebe66e71" + integrity sha512-Npcb7Pv30b33U04jvcD7l75yLU0mxhuX2Xqrn51YyZ5WTkF04bpbxLaZ6GcaTqu03WZQHoO/Gbfp95NGRueDUA== "@octokit/plugin-paginate-rest@^2.16.8": - version "2.18.0" - resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.18.0.tgz#e412977782690a4134b0a4aa2f536cca7a2ca125" - integrity sha512-n5/AzIoy5Wzp85gqzSbR+dWQDHlyHZrGijnDfLh452547Ynu0hCvszH7EfRE0eqM5ZjfkplO0k+q+P8AAIIJEA== + version "2.19.0" + resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.19.0.tgz#b52eae6ecacfa1f5583dc2cc0985cfbed3ca78b0" + integrity sha512-hQ4Qysg2hNmEMuZeJkvyzM4eSZiTifOKqYAMsW8FnxFKowhuwWICSgBQ9Gn9GpUmgKB7qaf1hFvMjYaTAg5jQA== dependencies: - "@octokit/types" "^6.35.0" + "@octokit/types" "^6.36.0" "@octokit/plugin-request-log@^1.0.4": version "1.0.4" @@ -1941,11 +1925,11 @@ integrity sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA== "@octokit/plugin-rest-endpoint-methods@^5.12.0": - version "5.14.0" - resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.14.0.tgz#758e01ac40998e607feaea7f80220c69990814ae" - integrity sha512-MRnMs4Dcm1OSaz/g/RLr4YY9otgysS7vN5SUkHGd7t+R8323cHsHFoEWHYPSmgUC0BieHRhvnCRWb4i3Pl+Lgg== + version "5.15.0" + resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.15.0.tgz#6c8251b55c33315a6e53e5b55654f72023ed5049" + integrity sha512-Gsw9+Xm56jVhfbJoy4pt6eOOyf8/3K6CAnx1Sl7U2GhZWcg8MR6YgXWnpfdF69S2ViMXLA7nfvTDAsZpFlkLRw== dependencies: - "@octokit/types" "^6.35.0" + "@octokit/types" "^6.36.0" deprecation "^2.3.1" "@octokit/request-error@^2.0.5", "@octokit/request-error@^2.1.0": @@ -1979,12 +1963,12 @@ "@octokit/plugin-request-log" "^1.0.4" "@octokit/plugin-rest-endpoint-methods" "^5.12.0" -"@octokit/types@^6.0.3", "@octokit/types@^6.16.1", "@octokit/types@^6.35.0": - version "6.35.0" - resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.35.0.tgz#11cd9a679c32b4a6c36459ae2ec3ac4de0104f71" - integrity sha512-DhLfdUuv3H37u6jBDfkwamypx3HflHg29b26nbA6iVFYkAlZ5cMEtu/9pQoihGnQE5M7jJFnNo25Rr1UwQNF8Q== +"@octokit/types@^6.0.3", "@octokit/types@^6.16.1", "@octokit/types@^6.36.0": + version "6.37.1" + resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.37.1.tgz#600a9c9643f696ba68f229c8d71abbc1040ad6a6" + integrity sha512-Q1hXSP2YumHkDdD+V4wFKr7vJ9+8tjocixrTSb75JzJ4GpjSyu5B4kpgrXxO6GOs4nOmVyRwRgS4/RO/Lf9oEA== dependencies: - "@octokit/openapi-types" "^12.1.0" + "@octokit/openapi-types" "^12.4.0" "@openpgp/web-stream-tools@0.0.10": version "0.0.10" @@ -2319,11 +2303,6 @@ "@thi.ng/arrays" "^1.0.3" "@thi.ng/checks" "^2.9.11" -"@tootallnate/once@1": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" - integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== - "@tootallnate/once@2": version "2.0.0" resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" @@ -2450,9 +2429,9 @@ "@types/json-schema" "*" "@types/estree@*": - version "0.0.51" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.51.tgz#cfd70924a25a3fd32b218e5e420e6897e1ac4f40" - integrity sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ== + version "0.0.52" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.52.tgz#7f1f57ad5b741f3d5b210d3b1f145640d89bf8fe" + integrity sha512-BZWrtCU0bMVAIliIV+HJO1f1PR41M7NKjfxrFJwwhKI1KwhwOxYw1SXg9ao+CIMt774nFuGiG6eU+udtbEI9oQ== "@types/fs-extra@9.0.13": version "9.0.13" @@ -2788,11 +2767,11 @@ tsutils "^3.21.0" "@typescript-eslint/experimental-utils@^5.3.0": - version "5.28.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.28.0.tgz#bdd4ad11c6f5803a193ed0b2220a7749de98e080" - integrity sha512-pPQ1Ng4qezQijXBBfYlogcOPnMs1q14l8C4fWJJ4PnFla4MA2b2oBfdkf02r1lNak2tpBVNJxvey9oWlPQWc4w== + version "5.29.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.29.0.tgz#abed79020f623ac4fb76c7fdf917552a17171704" + integrity sha512-H4fqOVYiH6R15NjtMO2LVBZgzXgzjdPEXYb7x/meg4QbXsptLxdq8YlHK2NZOFKipuInY4sAPY5a6SQ/53s3dw== dependencies: - "@typescript-eslint/utils" "5.28.0" + "@typescript-eslint/utils" "5.29.0" "@typescript-eslint/parser@5.28.0": version "5.28.0" @@ -2812,6 +2791,14 @@ "@typescript-eslint/types" "5.28.0" "@typescript-eslint/visitor-keys" "5.28.0" +"@typescript-eslint/scope-manager@5.29.0": + version "5.29.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.29.0.tgz#2a6a32e3416cb133e9af8dcf54bf077a916aeed3" + integrity sha512-etbXUT0FygFi2ihcxDZjz21LtC+Eps9V2xVx09zFoN44RRHPrkMflidGMI+2dUs821zR1tDS6Oc9IXxIjOUZwA== + dependencies: + "@typescript-eslint/types" "5.29.0" + "@typescript-eslint/visitor-keys" "5.29.0" + "@typescript-eslint/type-utils@5.28.0": version "5.28.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.28.0.tgz#53ccc78fdcf0205ef544d843b84104c0e9c7ca8e" @@ -2826,6 +2813,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.28.0.tgz#cffd9bcdce28db6daaa146e48a0be4387a6f4e9d" integrity sha512-2OOm8ZTOQxqkPbf+DAo8oc16sDlVR5owgJfKheBkxBKg1vAfw2JsSofH9+16VPlN9PWtv8Wzhklkqw3k/zCVxA== +"@typescript-eslint/types@5.29.0": + version "5.29.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.29.0.tgz#7861d3d288c031703b2d97bc113696b4d8c19aab" + integrity sha512-X99VbqvAXOMdVyfFmksMy3u8p8yoRGITgU1joBJPzeYa0rhdf5ok9S56/itRoUSh99fiDoMtarSIJXo7H/SnOg== + "@typescript-eslint/typescript-estree@5.28.0": version "5.28.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.28.0.tgz#3487d158d091ca2772b285e67412ff6d9797d863" @@ -2839,7 +2831,20 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.28.0", "@typescript-eslint/utils@^5.10.0": +"@typescript-eslint/typescript-estree@5.29.0": + version "5.29.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.29.0.tgz#e83d19aa7fd2e74616aab2f25dfbe4de4f0b5577" + integrity sha512-mQvSUJ/JjGBdvo+1LwC+GY2XmSYjK1nAaVw2emp/E61wEVYEyibRHCqm1I1vEKbXCpUKuW4G7u9ZCaZhJbLoNQ== + dependencies: + "@typescript-eslint/types" "5.29.0" + "@typescript-eslint/visitor-keys" "5.29.0" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + semver "^7.3.7" + tsutils "^3.21.0" + +"@typescript-eslint/utils@5.28.0": version "5.28.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.28.0.tgz#b27a136eac300a48160b36d2aad0da44a1341b99" integrity sha512-E60N5L0fjv7iPJV3UGc4EC+A3Lcj4jle9zzR0gW7vXhflO7/J29kwiTGITA2RlrmPokKiZbBy2DgaclCaEUs6g== @@ -2851,6 +2856,18 @@ eslint-scope "^5.1.1" eslint-utils "^3.0.0" +"@typescript-eslint/utils@5.29.0", "@typescript-eslint/utils@^5.10.0": + version "5.29.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.29.0.tgz#775046effd5019667bd086bcf326acbe32cd0082" + integrity sha512-3Eos6uP1nyLOBayc/VUdKZikV90HahXE5Dx9L5YlSd/7ylQPXhLk1BYb29SDgnBnTp+jmSZUU0QxUiyHgW4p7A== + dependencies: + "@types/json-schema" "^7.0.9" + "@typescript-eslint/scope-manager" "5.29.0" + "@typescript-eslint/types" "5.29.0" + "@typescript-eslint/typescript-estree" "5.29.0" + eslint-scope "^5.1.1" + eslint-utils "^3.0.0" + "@typescript-eslint/visitor-keys@5.28.0": version "5.28.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.28.0.tgz#982bb226b763c48fc1859a60de33fbf939d40a0f" @@ -2859,6 +2876,14 @@ "@typescript-eslint/types" "5.28.0" eslint-visitor-keys "^3.3.0" +"@typescript-eslint/visitor-keys@5.29.0": + version "5.29.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.29.0.tgz#7a4749fa7ef5160c44a451bf060ac1dc6dfb77ee" + integrity sha512-Hpb/mCWsjILvikMQoZIE3voc9wtQcS0A9FUw3h8bhr9UxBdtI/tw1ZDZUOXHXLOVMedKCH5NxyzATwnU78bWCQ== + dependencies: + "@typescript-eslint/types" "5.29.0" + eslint-visitor-keys "^3.3.0" + "@yarnpkg/core@3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@yarnpkg/core/-/core-3.1.0.tgz#6bfc9b906df0d128e4627efe9c2d830c30610d48" @@ -2993,7 +3018,7 @@ agent-base@6, agent-base@^6.0.2: dependencies: debug "4" -agentkeepalive@^4.1.3, agentkeepalive@^4.2.1: +agentkeepalive@^4.2.1: version "4.2.1" resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-4.2.1.tgz#a7975cbb9f83b367f06c90cc51ff28fe7d499717" integrity sha512-Zn4cw2NEqd+9fiSVWMscnjyQ1a8Yfoc5oBajLeo5w+YBHgDUcEBY2hS4YpTz6iN5f/2zQiktcuM6tS8x1p9dpA== @@ -3354,15 +3379,14 @@ braces@^3.0.1, braces@^3.0.2: fill-range "^7.0.1" browserslist@^4.20.2: - version "4.20.4" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.20.4.tgz#98096c9042af689ee1e0271333dbc564b8ce4477" - integrity sha512-ok1d+1WpnU24XYN7oC3QWgTyMhY/avPJ/r9T00xxvUOIparA/gc+UPUMaod3i+G6s+nI2nUb9xZ5k794uIwShw== + version "4.21.0" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.0.tgz#7ab19572361a140ecd1e023e2c1ed95edda0cefe" + integrity sha512-UQxE0DIhRB5z/zDz9iA03BOfxaN2+GQdBYH/2WrSIWEUrnpzTPJbhqt+umq6r3acaPRTW1FNTkrcp0PXgtFkvA== dependencies: - caniuse-lite "^1.0.30001349" - electron-to-chromium "^1.4.147" - escalade "^3.1.1" + caniuse-lite "^1.0.30001358" + electron-to-chromium "^1.4.164" node-releases "^2.0.5" - picocolors "^1.0.0" + update-browserslist-db "^1.0.0" bs-logger@0.x: version "0.2.6" @@ -3429,30 +3453,6 @@ cacache@16.1.1, cacache@^16.0.0, cacache@^16.0.6, cacache@^16.1.0, cacache@^16.1 tar "^6.1.11" unique-filename "^1.1.1" -cacache@^15.2.0: - version "15.3.0" - resolved "https://registry.yarnpkg.com/cacache/-/cacache-15.3.0.tgz#dc85380fb2f556fe3dda4c719bfa0ec875a7f1eb" - integrity sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ== - dependencies: - "@npmcli/fs" "^1.0.0" - "@npmcli/move-file" "^1.0.1" - chownr "^2.0.0" - fs-minipass "^2.0.0" - glob "^7.1.4" - infer-owner "^1.0.4" - lru-cache "^6.0.0" - minipass "^3.1.1" - minipass-collect "^1.0.2" - minipass-flush "^1.0.5" - minipass-pipeline "^1.2.2" - mkdirp "^1.0.3" - p-map "^4.0.0" - promise-inflight "^1.0.1" - rimraf "^3.0.2" - ssri "^8.0.1" - tar "^6.0.2" - unique-filename "^1.1.1" - cacheable-lookup@^5.0.3: version "5.0.4" resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz#5a6b865b2c44357be3d5ebc2a467b032719a7005" @@ -3508,10 +3508,10 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001349: - version "1.0.30001356" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001356.tgz#cbf5fe7b33f90962bfbca532212ea478d4ec9de8" - integrity sha512-/30854bktMLhxtjieIxsrJBfs2gTM1pel6MXKF3K+RdIVJZcsn2A2QdhsuR4/p9+R204fZw0zCBBhktX8xWuyQ== +caniuse-lite@^1.0.30001358: + version "1.0.30001359" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001359.tgz#a1c1cbe1c2da9e689638813618b4219acbd4925e" + integrity sha512-Xln/BAsPzEuiVLgJ2/45IaqD9jShtk3Y33anKb4+yLwQzws3+v6odKfpgES/cDEaZMLzSChpIGdbOYtH9MyuHw== cardinal@^2.1.1: version "2.1.1" @@ -4191,10 +4191,10 @@ editorconfig@0.15.3: semver "^5.6.0" sigmund "^1.0.1" -electron-to-chromium@^1.4.147: - version "1.4.161" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.161.tgz#49cb5b35385bfee6cc439d0a04fbba7a7a7f08a1" - integrity sha512-sTjBRhqh6wFodzZtc5Iu8/R95OkwaPNn7tj/TaDU5nu/5EFiQDtADGAXdR4tJcTEHlYfJpHqigzJqHvPgehP8A== +electron-to-chromium@^1.4.164: + version "1.4.170" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.170.tgz#0415fc489402e09bfbe1f0c99bbf4d73f31d48d4" + integrity sha512-rZ8PZLhK4ORPjFqLp9aqC4/S1j4qWFsPPz13xmWdrbBkU/LlxMcok+f+6f8YnQ57MiZwKtOaW15biZZsY5Igvw== email-addresses@5.0.0: version "5.0.0" @@ -4231,7 +4231,7 @@ emojibase@6.1.0: resolved "https://registry.yarnpkg.com/emojibase/-/emojibase-6.1.0.tgz#c3bc281e998a0e06398416090c23bac8c5ed3ee8" integrity sha512-1GkKJPXP6tVkYJHOBSJHoGOr/6uaDxZ9xJ6H7m6PfdGXTmQgbALHLWaVRY4Gi/qf5x/gT/NUXLPuSHYLqtLtrQ== -encoding@^0.1.12, encoding@^0.1.13: +encoding@^0.1.13: version "0.1.13" resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.13.tgz#56574afdd791f54a8e9b2785c0582a2d26210fa9" integrity sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A== @@ -5258,15 +5258,6 @@ http-cache-semantics@^4.0.0, http-cache-semantics@^4.1.0: resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390" integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ== -http-proxy-agent@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz#8a8c8ef7f5932ccf953c296ca8291b95aa74aa3a" - integrity sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg== - dependencies: - "@tootallnate/once" "1" - agent-base "6" - debug "4" - http-proxy-agent@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz#5129800203520d434f142bc78ff3c170800f2b43" @@ -6329,9 +6320,9 @@ just-extend@^4.0.2: integrity sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg== keyv@^4.0.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.3.0.tgz#b4352e0e4fe7c94111947d6738a6d3fe7903027c" - integrity sha512-C30Un9+63J0CsR7Wka5quXKqYZsT6dcRQ2aOwGcSc3RiQ4HGWpTAHlCA+puNfw2jA/s11EsxA1nCXgZRuRKMQQ== + version "4.3.2" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.3.2.tgz#e839df676a0c7ee594c8835e7c1c83742558e5c2" + integrity sha512-kn8WmodVBe12lmHpA6W8OY7SNh6wVR+Z+wZESF4iF5FCazaVXGWOtnbnvX0tMQ1bO+/TmOD9LziuYMvrIIs0xw== dependencies: compress-brotli "^1.3.8" json-buffer "3.0.1" @@ -6375,9 +6366,9 @@ libnpmaccess@^6.0.2: npm-registry-fetch "^13.0.0" libnpmdiff@^4.0.2: - version "4.0.3" - resolved "https://registry.yarnpkg.com/libnpmdiff/-/libnpmdiff-4.0.3.tgz#ad3997330c887c1098ac42682f1e5ad014d49cec" - integrity sha512-AiwBtXtH7HjfmT7FbTf9LFzJB347RrIA4I+IewMfhq8vYXaUveHwJMVNgMM2H/o2J+7Hf12JCBoOF5bTwlmGyw== + version "4.0.4" + resolved "https://registry.yarnpkg.com/libnpmdiff/-/libnpmdiff-4.0.4.tgz#487ccb609dacd7f558f089feef3153933e157d02" + integrity sha512-bUz12309DdkeFL/K0sKhW1mbg8DARMbNI0vQKrJp1J8lxhxqkAjzSQ3eQCacFjSwCz4xaf630ogwuOkSt61ZEQ== dependencies: "@npmcli/disparity-colors" "^2.0.0" "@npmcli/installed-package-contents" "^1.0.7" @@ -6385,22 +6376,22 @@ libnpmdiff@^4.0.2: diff "^5.0.0" minimatch "^5.0.1" npm-package-arg "^9.0.1" - pacote "^13.0.5" + pacote "^13.6.1" tar "^6.1.0" libnpmexec@^4.0.2: - version "4.0.6" - resolved "https://registry.yarnpkg.com/libnpmexec/-/libnpmexec-4.0.6.tgz#600beffd6f265cf92a096a7f336f330bc0019e82" - integrity sha512-v1jAPJyFFex6R0YHYXuudR4liQ3tYJ7vVZ6eThOex4+WzQEnoShLVfK3MLyFbjdGNO85wCHcVWVpXaBOVnVa/w== + version "4.0.8" + resolved "https://registry.yarnpkg.com/libnpmexec/-/libnpmexec-4.0.8.tgz#27be33278dec1c7cfce52e28f8814b19e31129fe" + integrity sha512-SKO6JCt/rL6r+ilbq315zEj2sDdZRniCJ2AvmzqMyIKW4IMuuLsOjjkcWKBV2l1Vle54ud7Tkv9IEPR2cE0mJg== dependencies: "@npmcli/arborist" "^5.0.0" "@npmcli/ci-detect" "^2.0.0" - "@npmcli/run-script" "^3.0.0" + "@npmcli/run-script" "^4.1.3" chalk "^4.1.0" mkdirp-infer-owner "^2.0.0" npm-package-arg "^9.0.1" npmlog "^6.0.2" - pacote "^13.0.5" + pacote "^13.6.1" proc-log "^2.0.0" read "^1.0.7" read-package-json-fast "^2.0.2" @@ -6430,13 +6421,13 @@ libnpmorg@^4.0.2: npm-registry-fetch "^13.0.0" libnpmpack@^4.0.2: - version "4.1.0" - resolved "https://registry.yarnpkg.com/libnpmpack/-/libnpmpack-4.1.0.tgz#93a170b67bc52e15edc7b1f2e09b2c36e532b897" - integrity sha512-BHwojfEbJvVVJXivZjOCe3Y0IzQ47p6c/bfebrpzazuFNRoS9XOsbkncRbl3f23+u9b51eplzwaPh/5xSOAWHg== + version "4.1.2" + resolved "https://registry.yarnpkg.com/libnpmpack/-/libnpmpack-4.1.2.tgz#9234a3b1ae433f922c19e97cd3a8a0b135b5f4cc" + integrity sha512-megSAPeZGv9jnDM4KovKbczjyuy/EcPxCIU/iaWsDU1IEAVtBJ0qHqNUm5yN2AgN501Tb3CL6KeFGYdG4E31rQ== dependencies: - "@npmcli/run-script" "^3.0.0" + "@npmcli/run-script" "^4.1.3" npm-package-arg "^9.0.1" - pacote "^13.5.0" + pacote "^13.6.1" libnpmpublish@^6.0.2: version "6.0.4" @@ -6465,12 +6456,12 @@ libnpmteam@^4.0.2: npm-registry-fetch "^13.0.0" libnpmversion@^3.0.1: - version "3.0.4" - resolved "https://registry.yarnpkg.com/libnpmversion/-/libnpmversion-3.0.4.tgz#a30f563416ea1e2dd69878b4a9edf4eb4a070ef8" - integrity sha512-q5hvZlso0SMLgKm4AMtleRWtq4pERprebEGV6OwKi24efgAOgNDP98+jNUX2mIR2wp9eAa6ybkNNWu4yMaCsVw== + version "3.0.6" + resolved "https://registry.yarnpkg.com/libnpmversion/-/libnpmversion-3.0.6.tgz#a4a476d38a44d38db9ac424a5e7334479e7fb8b9" + integrity sha512-+lI+AO7cZwDxyAeWCIR8+n9XEfgSDAqmNbv4zy+H6onGthsk/+E3aa+5zIeBpyG5g268zjpc0qrBch0Q3w0nBA== dependencies: "@npmcli/git" "^3.0.0" - "@npmcli/run-script" "^3.0.0" + "@npmcli/run-script" "^4.1.3" json-parse-even-better-errors "^2.3.1" proc-log "^2.0.0" semver "^7.3.7" @@ -6616,9 +6607,9 @@ lru-cache@^6.0.0: yallist "^4.0.0" lru-cache@^7.4.4, lru-cache@^7.5.1, lru-cache@^7.7.1: - version "7.10.1" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-7.10.1.tgz#db577f42a94c168f676b638d15da8fb073448cab" - integrity sha512-BQuhQxPuRl79J5zSXRP+uNzPOyZw2oFI9JLRQ80XswSvg21KMKNtQza9eF42rfI/3Z40RvzBdXgziEkudzjo8A== + version "7.10.2" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-7.10.2.tgz#aab494e0768ce94f199ef553ffe0a362f2a58bb9" + integrity sha512-9zDbhgmXAUvUMPV81A705K3tVzcPiZL3Bf5/5JC/FjYJlLZ5AJCeqIRFHJqyBppiLosqF+uKB7p8/RDXylqBIw== luxon@2.4.0: version "2.4.0" @@ -6637,10 +6628,10 @@ make-error@1.x, make-error@^1.1.1: resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== -make-fetch-happen@^10.0.3, make-fetch-happen@^10.0.6, make-fetch-happen@^10.1.7: - version "10.1.7" - resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-10.1.7.tgz#b1402cb3c9fad92b380ff3a863cdae5414a42f76" - integrity sha512-J/2xa2+7zlIUKqfyXDCXFpH3ypxO4k3rgkZHPSZkyUYcBT/hM80M3oyKLM/9dVriZFiGeGGS2Ei+0v2zfhqj3Q== +make-fetch-happen@^10.0.3, make-fetch-happen@^10.0.6, make-fetch-happen@^10.1.8: + version "10.1.8" + resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-10.1.8.tgz#3b6e93dd8d8fdb76c0d7bf32e617f37c3108435a" + integrity sha512-0ASJbG12Au6+N5I84W+8FhGS6iM8MyzvZady+zaQAu+6IOaESFzCLLD0AR1sAFF3Jufi8bxm586ABN6hWd3k7g== dependencies: agentkeepalive "^4.2.1" cacache "^16.1.0" @@ -6659,28 +6650,6 @@ make-fetch-happen@^10.0.3, make-fetch-happen@^10.0.6, make-fetch-happen@^10.1.7: socks-proxy-agent "^7.0.0" ssri "^9.0.0" -make-fetch-happen@^9.1.0: - version "9.1.0" - resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz#53085a09e7971433e6765f7971bf63f4e05cb968" - integrity sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg== - dependencies: - agentkeepalive "^4.1.3" - cacache "^15.2.0" - http-cache-semantics "^4.1.0" - http-proxy-agent "^4.0.1" - https-proxy-agent "^5.0.0" - is-lambda "^1.0.1" - lru-cache "^6.0.0" - minipass "^3.1.3" - minipass-collect "^1.0.2" - minipass-fetch "^1.3.2" - minipass-flush "^1.0.5" - minipass-pipeline "^1.2.4" - negotiator "^0.6.2" - promise-retry "^2.0.1" - socks-proxy-agent "^6.0.0" - ssri "^8.0.0" - makeerror@1.0.12: version "1.0.12" resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.12.tgz#3e5dd2079a82e812e983cc6610c4a2cb0eaa801a" @@ -6980,17 +6949,6 @@ minipass-collect@^1.0.2: dependencies: minipass "^3.0.0" -minipass-fetch@^1.3.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/minipass-fetch/-/minipass-fetch-1.4.1.tgz#d75e0091daac1b0ffd7e9d41629faff7d0c1f1b6" - integrity sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw== - dependencies: - minipass "^3.1.0" - minipass-sized "^1.0.3" - minizlib "^2.0.0" - optionalDependencies: - encoding "^0.1.12" - minipass-fetch@^2.0.3: version "2.1.0" resolved "https://registry.yarnpkg.com/minipass-fetch/-/minipass-fetch-2.1.0.tgz#ca1754a5f857a3be99a9271277246ac0b44c3ff8" @@ -7017,7 +6975,7 @@ minipass-json-stream@^1.0.1: jsonparse "^1.3.1" minipass "^3.0.0" -minipass-pipeline@^1.2.2, minipass-pipeline@^1.2.4: +minipass-pipeline@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz#68472f79711c084657c067c5c6ad93cddea8214c" integrity sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A== @@ -7031,14 +6989,14 @@ minipass-sized@^1.0.3: dependencies: minipass "^3.0.0" -minipass@^3.0.0, minipass@^3.1.0, minipass@^3.1.1, minipass@^3.1.3, minipass@^3.1.6: - version "3.1.6" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.1.6.tgz#3b8150aa688a711a1521af5e8779c1d3bb4f45ee" - integrity sha512-rty5kpw9/z8SX9dmxblFA6edItUmwJgMeYDZRrwlIVN27i8gysGbznJwUggw2V/FVqFSDdWy040ZPS811DYAqQ== +minipass@^3.0.0, minipass@^3.1.1, minipass@^3.1.6: + version "3.3.3" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.3.3.tgz#fd1f0e6c06449c10dadda72618b59c00f3d6378d" + integrity sha512-N0BOsdFAlNRfmwMhjAsLVWOk7Ljmeb39iqFlsV1At+jqRhSUP9yeof8FyJu4imaJiSUp8vQebWD/guZwGQC8iA== dependencies: yallist "^4.0.0" -minizlib@^2.0.0, minizlib@^2.1.1, minizlib@^2.1.2: +minizlib@^2.1.1, minizlib@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931" integrity sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg== @@ -7157,7 +7115,7 @@ ncp@~2.0.0: resolved "https://registry.yarnpkg.com/ncp/-/ncp-2.0.0.tgz#195a21d6c46e361d2fb1281ba38b91e9df7bdbb3" integrity sha512-zIdGUrPRFTUELUvr3Gmc7KZ2Sw/h1PiVM0Af/oHB6zgnV1ikqSfRk+TOufi79aHYCW3NiOXmr1BP5nWbzojLaA== -negotiator@^0.6.2, negotiator@^0.6.3: +negotiator@^0.6.3: version "0.6.3" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== @@ -7212,22 +7170,6 @@ node-fetch@^2.6.7: dependencies: whatwg-url "^5.0.0" -node-gyp@^8.4.1: - version "8.4.1" - resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-8.4.1.tgz#3d49308fc31f768180957d6b5746845fbd429937" - integrity sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w== - dependencies: - env-paths "^2.2.0" - glob "^7.1.4" - graceful-fs "^4.2.6" - make-fetch-happen "^9.1.0" - nopt "^5.0.0" - npmlog "^6.0.0" - rimraf "^3.0.2" - semver "^7.3.5" - tar "^6.1.2" - which "^2.0.2" - node-gyp@^9.0.0: version "9.0.0" resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-9.0.0.tgz#e1da2067427f3eb5bb56820cb62bc6b1e4bd2089" @@ -7344,11 +7286,12 @@ npm-normalize-package-bin@^1.0.0, npm-normalize-package-bin@^1.0.1: integrity sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA== npm-package-arg@^9.0.0, npm-package-arg@^9.0.1, npm-package-arg@^9.0.2: - version "9.0.2" - resolved "https://registry.yarnpkg.com/npm-package-arg/-/npm-package-arg-9.0.2.tgz#f3ef7b1b3b02e82564af2d5228b4c36567dcd389" - integrity sha512-v/miORuX8cndiOheW8p2moNuPJ7QhcFh9WGlTorruG8hXSA23vMTEp5hTCmDxic0nD8KHhj/NQgFuySD3GYY3g== + version "9.1.0" + resolved "https://registry.yarnpkg.com/npm-package-arg/-/npm-package-arg-9.1.0.tgz#a60e9f1e7c03e4e3e4e994ea87fff8b90b522987" + integrity sha512-4J0GL+u2Nh6OnhvUKXRr2ZMG4lR8qtLp+kv7UiV00Y+nGiSxtttCyIRHCt5L5BNkXQld/RceYItau3MDOoGiBw== dependencies: hosted-git-info "^5.0.0" + proc-log "^2.0.1" semver "^7.3.5" validate-npm-package-name "^4.0.0" @@ -7372,7 +7315,7 @@ npm-pick-manifest@^7.0.0, npm-pick-manifest@^7.0.1: npm-package-arg "^9.0.0" semver "^7.3.5" -npm-profile@^6.0.3: +npm-profile@^6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/npm-profile/-/npm-profile-6.1.0.tgz#2f32431c487cb21ef5882c9511f8be8a0b602d35" integrity sha512-JHnBzSqS9xPa0M3g90zhaGElSVdxoAipGkraBaM6Jph2XiSiwFN1HmfRTqndYhDkXia2hWRWl8O5RbDvae++GA== @@ -7421,9 +7364,9 @@ npm-user-validate@^1.0.1: integrity sha512-uQwcd/tY+h1jnEaze6cdX/LrhWhoBxfSknxentoqmIuStxUExxjWd3ULMLFPiFUrZKbOVMowH6Jq2FRWfmhcEw== npm@^8.3.0: - version "8.12.2" - resolved "https://registry.yarnpkg.com/npm/-/npm-8.12.2.tgz#d9be9d6368b0bd9d0e963b25a662c79909ca8bbf" - integrity sha512-TArexqro9wpl/6wz6t6YdYhOoiy/UArqiSsSsqI7fieEhQEswDQSJcgt/LuCDjl6mfCDi0So7S2UZ979qLYRPg== + version "8.13.1" + resolved "https://registry.yarnpkg.com/npm/-/npm-8.13.1.tgz#b1fd8a9f92dfc432e0467671f2f5f17444de3f00" + integrity sha512-Di4hLSvlImxAslovZ8yRXOhwmd6hXzgRFjwfF4QuwuPT9RUvpLIZ5nubhrY34Pc3elqaU0iyBVWgGZ3jELFP8w== dependencies: "@isaacs/string-locale-compare" "^1.1.0" "@npmcli/arborist" "^5.0.4" @@ -7432,7 +7375,7 @@ npm@^8.3.0: "@npmcli/fs" "^2.1.0" "@npmcli/map-workspaces" "^2.0.3" "@npmcli/package-json" "^2.0.0" - "@npmcli/run-script" "^3.0.1" + "@npmcli/run-script" "^4.1.3" abbrev "~1.1.1" archy "~1.0.0" cacache "^16.1.1" @@ -7460,7 +7403,7 @@ npm@^8.3.0: libnpmsearch "^5.0.2" libnpmteam "^4.0.2" libnpmversion "^3.0.1" - make-fetch-happen "^10.1.7" + make-fetch-happen "^10.1.8" minipass "^3.1.6" minipass-pipeline "^1.2.4" mkdirp "^1.0.4" @@ -7472,12 +7415,12 @@ npm@^8.3.0: npm-install-checks "^5.0.0" npm-package-arg "^9.0.2" npm-pick-manifest "^7.0.1" - npm-profile "^6.0.3" + npm-profile "^6.1.0" npm-registry-fetch "^13.1.1" npm-user-validate "^1.0.1" npmlog "^6.0.2" opener "^1.5.2" - pacote "^13.6.0" + pacote "^13.6.1" parse-conflict-json "^2.0.2" proc-log "^2.0.1" qrcode-terminal "^0.12.0" @@ -7713,15 +7656,15 @@ p-try@^2.0.0: resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== -pacote@^13.0.3, pacote@^13.0.5, pacote@^13.5.0, pacote@^13.6.0: - version "13.6.0" - resolved "https://registry.yarnpkg.com/pacote/-/pacote-13.6.0.tgz#79ea3d3ae5a2b29e2994dcf18d75494e8d888032" - integrity sha512-zHmuCwG4+QKnj47LFlW3LmArwKoglx2k5xtADiMCivVWPgNRP5QyLDGOIjGjwOe61lhl1rO63m/VxT16pEHLWg== +pacote@^13.0.3, pacote@^13.6.1: + version "13.6.1" + resolved "https://registry.yarnpkg.com/pacote/-/pacote-13.6.1.tgz#ac6cbd9032b4c16e5c1e0c60138dfe44e4cc589d" + integrity sha512-L+2BI1ougAPsFjXRyBhcKmfT016NscRFLv6Pz5EiNf1CCFJFU0pSKKQwsZTyAQB+sTuUL4TyFyp6J1Ork3dOqw== dependencies: "@npmcli/git" "^3.0.0" "@npmcli/installed-package-contents" "^1.0.7" "@npmcli/promise-spawn" "^3.0.0" - "@npmcli/run-script" "^3.0.1" + "@npmcli/run-script" "^4.1.0" cacache "^16.0.0" chownr "^2.0.0" fs-minipass "^2.1.0" @@ -8652,15 +8595,6 @@ smart-buffer@^4.2.0: resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.2.0.tgz#6e1d71fa4f18c05f7d0ff216dd16a481d0e8d9ae" integrity sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg== -socks-proxy-agent@^6.0.0: - version "6.2.1" - resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-6.2.1.tgz#2687a31f9d7185e38d530bef1944fe1f1496d6ce" - integrity sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ== - dependencies: - agent-base "^6.0.2" - debug "^4.3.3" - socks "^2.6.2" - socks-proxy-agent@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-7.0.0.tgz#dc069ecf34436621acb41e3efa66ca1b5fed15b6" @@ -8765,13 +8699,6 @@ sprintf-js@~1.0.2: resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== -ssri@^8.0.0, ssri@^8.0.1: - version "8.0.1" - resolved "https://registry.yarnpkg.com/ssri/-/ssri-8.0.1.tgz#638e4e439e2ffbd2cd289776d5ca457c4f51a2af" - integrity sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ== - dependencies: - minipass "^3.1.1" - ssri@^9.0.0, ssri@^9.0.1: version "9.0.1" resolved "https://registry.yarnpkg.com/ssri/-/ssri-9.0.1.tgz#544d4c357a8d7b71a19700074b6883fcb4eae057" @@ -8956,7 +8883,7 @@ supports-preserve-symlinks-flag@^1.0.0: resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== -tar@^6.0.2, tar@^6.0.5, tar@^6.1.0, tar@^6.1.11, tar@^6.1.2: +tar@^6.0.5, tar@^6.1.0, tar@^6.1.11, tar@^6.1.2: version "6.1.11" resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.11.tgz#6760a38f003afa1b2ffd0ffe9e9abbd0eab3d621" integrity sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA== @@ -9371,6 +9298,14 @@ upath@2.0.1: resolved "https://registry.yarnpkg.com/upath/-/upath-2.0.1.tgz#50c73dea68d6f6b990f51d279ce6081665d61a8b" integrity sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w== +update-browserslist-db@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.4.tgz#dbfc5a789caa26b1db8990796c2c8ebbce304824" + integrity sha512-jnmO2BEGUjsMOe/Fg9u0oczOe/ppIDZPebzccl1yDWGLFP16Pa1/RM5wEoKYPG2zstNcDuAStejyxsOuKINdGA== + dependencies: + escalade "^3.1.1" + picocolors "^1.0.0" + uri-js@^4.2.2: version "4.4.1" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" @@ -9416,11 +9351,11 @@ v8-compile-cache@^2.0.3: integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== v8-to-istanbul@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.0.0.tgz#be0dae58719fc53cb97e5c7ac1d7e6d4f5b19511" - integrity sha512-HcvgY/xaRm7isYmyx+lFKA4uQmfUbN0J4M0nNItvzTvH/iQ9kW5j/t4YSR+Ge323/lrgDAWJoF46tzGQHwBHFw== + version "9.0.1" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.0.1.tgz#b6f994b0b5d4ef255e17a0d17dc444a9f5132fa4" + integrity sha512-74Y4LqY74kLE6IFyIjPtkSTWzUZmj8tdHT9Ii/26dvQ6K9Dl2NbEfj0XgU2sHCtKgt5VupqhlO/5aWuqS+IY1w== dependencies: - "@jridgewell/trace-mapping" "^0.3.7" + "@jridgewell/trace-mapping" "^0.3.12" "@types/istanbul-lib-coverage" "^2.0.1" convert-source-map "^1.6.0" From cbf39e7cae64cc36b0393825f06306dc7b0c04ba Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Mon, 27 Jun 2022 07:17:28 +0200 Subject: [PATCH 205/240] fix(datasource/helm): refactor logging (#16252) --- lib/modules/datasource/helm/index.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/modules/datasource/helm/index.ts b/lib/modules/datasource/helm/index.ts index 81372fe73b1546..dffa66b4a2e8e2 100644 --- a/lib/modules/datasource/helm/index.ts +++ b/lib/modules/datasource/helm/index.ts @@ -87,11 +87,10 @@ export class HelmDatasource extends Datasource { return result; } catch (err) { - logger.warn( - { helmRepository }, + logger.debug( + { helmRepository, err }, `Failed to parse index.yaml from helm repository` ); - logger.debug(err); return null; } } @@ -107,7 +106,7 @@ export class HelmDatasource extends Datasource { const repositoryData = await this.getRepositoryData(helmRepository); if (!repositoryData) { - logger.debug(`Couldn't get index.yaml file from ${helmRepository}`); + logger.debug(`Missing repo data from ${helmRepository}`); return null; } const releases = repositoryData[packageName]; From 07d278b268ba3630cbac7e84998d3d458623a5e9 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Mon, 27 Jun 2022 07:17:52 +0200 Subject: [PATCH 206/240] refactor: add missing type (#16251) --- lib/modules/datasource/helm/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/modules/datasource/helm/index.ts b/lib/modules/datasource/helm/index.ts index dffa66b4a2e8e2..590c7a9b24284a 100644 --- a/lib/modules/datasource/helm/index.ts +++ b/lib/modules/datasource/helm/index.ts @@ -2,6 +2,7 @@ import is from '@sindresorhus/is'; import { load } from 'js-yaml'; import { logger } from '../../../logger'; import { cache } from '../../../util/cache/package/decorator'; +import type { HttpResponse } from '../../../util/http/types'; import { ensureTrailingSlash } from '../../../util/url'; import * as helmVersioning from '../../versioning/helm'; import { Datasource } from '../datasource'; @@ -34,7 +35,7 @@ export class HelmDatasource extends Datasource { async getRepositoryData( helmRepository: string ): Promise { - let res: any; + let res: HttpResponse; try { res = await this.http.get('index.yaml', { baseUrl: ensureTrailingSlash(helmRepository), From 100a820db61298e72d54a67d943718e5e5e1785a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 27 Jun 2022 05:31:34 +0000 Subject: [PATCH 207/240] build(deps): update aws-sdk-js-v3 monorepo (#16233) * build(deps): update aws-sdk-js-v3 monorepo * update snapshots Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Rhys Arkins --- .../__snapshots__/index.spec.ts.snap | 6 +- package.json | 6 +- yarn.lock | 1157 ++++++++--------- 3 files changed, 581 insertions(+), 588 deletions(-) diff --git a/lib/modules/datasource/aws-machine-image/__snapshots__/index.spec.ts.snap b/lib/modules/datasource/aws-machine-image/__snapshots__/index.spec.ts.snap index ab9b0b1cc2de89..849b39df1dc4cd 100644 --- a/lib/modules/datasource/aws-machine-image/__snapshots__/index.spec.ts.snap +++ b/lib/modules/datasource/aws-machine-image/__snapshots__/index.spec.ts.snap @@ -117,7 +117,7 @@ Array [ "region": [Function], "regionInfoProvider": [Function], "requestHandler": NodeHttpHandler { - "configProvider": [Function], + "configProvider": Promise {}, "metadata": Object { "handlerProtocol": "http/1.1", }, @@ -271,7 +271,7 @@ Array [ "region": [Function], "regionInfoProvider": [Function], "requestHandler": NodeHttpHandler { - "configProvider": [Function], + "configProvider": Promise {}, "metadata": Object { "handlerProtocol": "http/1.1", }, @@ -425,7 +425,7 @@ Array [ "region": [Function], "regionInfoProvider": [Function], "requestHandler": NodeHttpHandler { - "configProvider": [Function], + "configProvider": Promise {}, "metadata": Object { "handlerProtocol": "http/1.1", }, diff --git a/package.json b/package.json index c9e58ec28a2d8d..ea1518614a0637 100644 --- a/package.json +++ b/package.json @@ -133,9 +133,9 @@ "node": "^14.15.0 || >=16.13.0" }, "dependencies": { - "@aws-sdk/client-ec2": "3.72.0", - "@aws-sdk/client-ecr": "3.72.0", - "@aws-sdk/client-s3": "3.72.0", + "@aws-sdk/client-ec2": "3.112.0", + "@aws-sdk/client-ecr": "3.112.0", + "@aws-sdk/client-s3": "3.113.0", "@breejs/later": "4.1.0", "@cheap-glitch/mi-cron": "1.0.1", "@iarna/toml": "2.2.5", diff --git a/yarn.lock b/yarn.lock index c2c7bae7d5b6e4..66a4e1fe70b9ad 100644 --- a/yarn.lock +++ b/yarn.lock @@ -116,20 +116,20 @@ "@aws-sdk/util-utf8-browser" "^3.0.0" tslib "^1.11.1" -"@aws-sdk/abort-controller@3.55.0": - version "3.55.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/abort-controller/-/abort-controller-3.55.0.tgz#779f487cceab7804f2d542925a1918fbe91b42ac" - integrity sha512-rCcTxJDEFnmvo/PgbhCRv24/Uv03lEGfRslKZq7SjaMcOubflS/ZXYaMEgsjYHgAT0zlpSsyCIkJXmhFaM7H7w== +"@aws-sdk/abort-controller@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/abort-controller/-/abort-controller-3.110.0.tgz#15b493b776ec4f7236c6ad6134a6fe87e9dc5292" + integrity sha512-zok/WEVuK7Jh6V9YeA56pNZtxUASon9LTkS7vE65A4UFmNkPGNBCNgoiBcbhWfxwrZ8wtXcQk6rtUut39831mA== dependencies: - "@aws-sdk/types" "3.55.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/chunked-blob-reader-native@3.58.0": - version "3.58.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/chunked-blob-reader-native/-/chunked-blob-reader-native-3.58.0.tgz#1db413c5c80b32e24f1b62b22e15e9ad74d75cda" - integrity sha512-+D3xnPD5985iphgAqgUerBDs371a2WzzoEVi7eHJUMMsP/gEnSTdSH0HNxsqhYv6CW4EdKtvDAQdAwA1VtCf2A== +"@aws-sdk/chunked-blob-reader-native@3.109.0": + version "3.109.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/chunked-blob-reader-native/-/chunked-blob-reader-native-3.109.0.tgz#4db2ec81faf38fe33cf9dd6f75641afe0826dcfd" + integrity sha512-Ybn3vDZ3CqGyprL2qdF6QZqoqlx8lA3qOJepobjuKKDRw+KgGxjUY4NvWe0R2MdRoduyaDj6uvhIay0S1MOSJQ== dependencies: - "@aws-sdk/util-base64-browser" "3.58.0" + "@aws-sdk/util-base64-browser" "3.109.0" tslib "^2.3.1" "@aws-sdk/chunked-blob-reader@3.55.0": @@ -139,408 +139,413 @@ dependencies: tslib "^2.3.1" -"@aws-sdk/client-ec2@3.72.0": - version "3.72.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/client-ec2/-/client-ec2-3.72.0.tgz#eb9ff08079654d241b06658c5049033818c382d5" - integrity sha512-NqxMHaGijnaOT4lgh9X7v41fpsAkLM4FIdoVB3ll2it9rOviLl++mIsDYTKCoz+fIS7Zg50Am8EBt+WokFUR7Q== +"@aws-sdk/client-ec2@3.112.0": + version "3.112.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/client-ec2/-/client-ec2-3.112.0.tgz#1c0f1da9f37b2244356cc57dd0bb3ce7d965944b" + integrity sha512-p8IDsXTQI6gKR2ecNndkPG/EIx4v2av/JBSlURjoRcdzodE4mt3Nbss9TpmavxuzdgBBIpaOUioJNA1+gQAzZQ== dependencies: "@aws-crypto/sha256-browser" "2.0.0" "@aws-crypto/sha256-js" "2.0.0" - "@aws-sdk/client-sts" "3.72.0" - "@aws-sdk/config-resolver" "3.58.0" - "@aws-sdk/credential-provider-node" "3.72.0" - "@aws-sdk/fetch-http-handler" "3.58.0" - "@aws-sdk/hash-node" "3.55.0" - "@aws-sdk/invalid-dependency" "3.55.0" - "@aws-sdk/middleware-content-length" "3.58.0" - "@aws-sdk/middleware-host-header" "3.58.0" - "@aws-sdk/middleware-logger" "3.55.0" - "@aws-sdk/middleware-retry" "3.58.0" - "@aws-sdk/middleware-sdk-ec2" "3.58.0" - "@aws-sdk/middleware-serde" "3.55.0" - "@aws-sdk/middleware-signing" "3.58.0" - "@aws-sdk/middleware-stack" "3.55.0" - "@aws-sdk/middleware-user-agent" "3.58.0" - "@aws-sdk/node-config-provider" "3.58.0" - "@aws-sdk/node-http-handler" "3.58.0" - "@aws-sdk/protocol-http" "3.58.0" - "@aws-sdk/smithy-client" "3.72.0" - "@aws-sdk/types" "3.55.0" - "@aws-sdk/url-parser" "3.55.0" - "@aws-sdk/util-base64-browser" "3.58.0" + "@aws-sdk/client-sts" "3.112.0" + "@aws-sdk/config-resolver" "3.110.0" + "@aws-sdk/credential-provider-node" "3.112.0" + "@aws-sdk/fetch-http-handler" "3.110.0" + "@aws-sdk/hash-node" "3.110.0" + "@aws-sdk/invalid-dependency" "3.110.0" + "@aws-sdk/middleware-content-length" "3.110.0" + "@aws-sdk/middleware-host-header" "3.110.0" + "@aws-sdk/middleware-logger" "3.110.0" + "@aws-sdk/middleware-recursion-detection" "3.110.0" + "@aws-sdk/middleware-retry" "3.110.0" + "@aws-sdk/middleware-sdk-ec2" "3.110.0" + "@aws-sdk/middleware-serde" "3.110.0" + "@aws-sdk/middleware-signing" "3.110.0" + "@aws-sdk/middleware-stack" "3.110.0" + "@aws-sdk/middleware-user-agent" "3.110.0" + "@aws-sdk/node-config-provider" "3.110.0" + "@aws-sdk/node-http-handler" "3.110.0" + "@aws-sdk/protocol-http" "3.110.0" + "@aws-sdk/smithy-client" "3.110.0" + "@aws-sdk/types" "3.110.0" + "@aws-sdk/url-parser" "3.110.0" + "@aws-sdk/util-base64-browser" "3.109.0" "@aws-sdk/util-base64-node" "3.55.0" "@aws-sdk/util-body-length-browser" "3.55.0" "@aws-sdk/util-body-length-node" "3.55.0" - "@aws-sdk/util-defaults-mode-browser" "3.72.0" - "@aws-sdk/util-defaults-mode-node" "3.72.0" - "@aws-sdk/util-user-agent-browser" "3.58.0" - "@aws-sdk/util-user-agent-node" "3.58.0" - "@aws-sdk/util-utf8-browser" "3.55.0" - "@aws-sdk/util-utf8-node" "3.55.0" - "@aws-sdk/util-waiter" "3.55.0" + "@aws-sdk/util-defaults-mode-browser" "3.110.0" + "@aws-sdk/util-defaults-mode-node" "3.110.0" + "@aws-sdk/util-user-agent-browser" "3.110.0" + "@aws-sdk/util-user-agent-node" "3.110.0" + "@aws-sdk/util-utf8-browser" "3.109.0" + "@aws-sdk/util-utf8-node" "3.109.0" + "@aws-sdk/util-waiter" "3.110.0" entities "2.2.0" fast-xml-parser "3.19.0" tslib "^2.3.1" uuid "^8.3.2" -"@aws-sdk/client-ecr@3.72.0": - version "3.72.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/client-ecr/-/client-ecr-3.72.0.tgz#78f8e40683761f5e730ab03cbaaf2336e5cf81b5" - integrity sha512-d4DwRokBUruvMuBprE4GtdqZ64v/UUZcZtZQoAWESKRnIZVBsE0gcpt1zCBpWLLPp8nraIiLPfp2swpRxsZcKw== +"@aws-sdk/client-ecr@3.112.0": + version "3.112.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/client-ecr/-/client-ecr-3.112.0.tgz#14cd8d614f9e433ef95913ce25e002374669a078" + integrity sha512-s36X8KMZGiGXQ4dVtfKJb+k4iNvF/MfzXyNObF8sdJJwoXZUQPlF1+77fsxQzGGG1MqH36iTJAec/Qx7ATTcVQ== dependencies: "@aws-crypto/sha256-browser" "2.0.0" "@aws-crypto/sha256-js" "2.0.0" - "@aws-sdk/client-sts" "3.72.0" - "@aws-sdk/config-resolver" "3.58.0" - "@aws-sdk/credential-provider-node" "3.72.0" - "@aws-sdk/fetch-http-handler" "3.58.0" - "@aws-sdk/hash-node" "3.55.0" - "@aws-sdk/invalid-dependency" "3.55.0" - "@aws-sdk/middleware-content-length" "3.58.0" - "@aws-sdk/middleware-host-header" "3.58.0" - "@aws-sdk/middleware-logger" "3.55.0" - "@aws-sdk/middleware-retry" "3.58.0" - "@aws-sdk/middleware-serde" "3.55.0" - "@aws-sdk/middleware-signing" "3.58.0" - "@aws-sdk/middleware-stack" "3.55.0" - "@aws-sdk/middleware-user-agent" "3.58.0" - "@aws-sdk/node-config-provider" "3.58.0" - "@aws-sdk/node-http-handler" "3.58.0" - "@aws-sdk/protocol-http" "3.58.0" - "@aws-sdk/smithy-client" "3.72.0" - "@aws-sdk/types" "3.55.0" - "@aws-sdk/url-parser" "3.55.0" - "@aws-sdk/util-base64-browser" "3.58.0" + "@aws-sdk/client-sts" "3.112.0" + "@aws-sdk/config-resolver" "3.110.0" + "@aws-sdk/credential-provider-node" "3.112.0" + "@aws-sdk/fetch-http-handler" "3.110.0" + "@aws-sdk/hash-node" "3.110.0" + "@aws-sdk/invalid-dependency" "3.110.0" + "@aws-sdk/middleware-content-length" "3.110.0" + "@aws-sdk/middleware-host-header" "3.110.0" + "@aws-sdk/middleware-logger" "3.110.0" + "@aws-sdk/middleware-recursion-detection" "3.110.0" + "@aws-sdk/middleware-retry" "3.110.0" + "@aws-sdk/middleware-serde" "3.110.0" + "@aws-sdk/middleware-signing" "3.110.0" + "@aws-sdk/middleware-stack" "3.110.0" + "@aws-sdk/middleware-user-agent" "3.110.0" + "@aws-sdk/node-config-provider" "3.110.0" + "@aws-sdk/node-http-handler" "3.110.0" + "@aws-sdk/protocol-http" "3.110.0" + "@aws-sdk/smithy-client" "3.110.0" + "@aws-sdk/types" "3.110.0" + "@aws-sdk/url-parser" "3.110.0" + "@aws-sdk/util-base64-browser" "3.109.0" "@aws-sdk/util-base64-node" "3.55.0" "@aws-sdk/util-body-length-browser" "3.55.0" "@aws-sdk/util-body-length-node" "3.55.0" - "@aws-sdk/util-defaults-mode-browser" "3.72.0" - "@aws-sdk/util-defaults-mode-node" "3.72.0" - "@aws-sdk/util-user-agent-browser" "3.58.0" - "@aws-sdk/util-user-agent-node" "3.58.0" - "@aws-sdk/util-utf8-browser" "3.55.0" - "@aws-sdk/util-utf8-node" "3.55.0" - "@aws-sdk/util-waiter" "3.55.0" + "@aws-sdk/util-defaults-mode-browser" "3.110.0" + "@aws-sdk/util-defaults-mode-node" "3.110.0" + "@aws-sdk/util-user-agent-browser" "3.110.0" + "@aws-sdk/util-user-agent-node" "3.110.0" + "@aws-sdk/util-utf8-browser" "3.109.0" + "@aws-sdk/util-utf8-node" "3.109.0" + "@aws-sdk/util-waiter" "3.110.0" tslib "^2.3.1" -"@aws-sdk/client-s3@3.72.0": - version "3.72.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/client-s3/-/client-s3-3.72.0.tgz#b3c5def9b2ae8e0fda7f17219603bdc0cdea6c1b" - integrity sha512-WQnNs++yTsBARaZqpxIAB3CX9BrqgxnLo4g/wT8cLqRilhL8OY1KPowe8SptXcXbo2AdAuAtcFK2GC+MYcCgmg== +"@aws-sdk/client-s3@3.113.0": + version "3.113.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/client-s3/-/client-s3-3.113.0.tgz#fc416139a1d1f5a8e07ac6f3d453042c6d84c4f9" + integrity sha512-QHynLFWwhQFB2bULxMOlnIYzKPmE6ky5yRo0NPGklz4bnWc8RY/vSvlaii4JBxPee9TGxNM1/NCF0oMLUdXK3Q== dependencies: "@aws-crypto/sha1-browser" "2.0.0" "@aws-crypto/sha256-browser" "2.0.0" "@aws-crypto/sha256-js" "2.0.0" - "@aws-sdk/client-sts" "3.72.0" - "@aws-sdk/config-resolver" "3.58.0" - "@aws-sdk/credential-provider-node" "3.72.0" - "@aws-sdk/eventstream-serde-browser" "3.72.0" - "@aws-sdk/eventstream-serde-config-resolver" "3.55.0" - "@aws-sdk/eventstream-serde-node" "3.72.0" - "@aws-sdk/fetch-http-handler" "3.58.0" - "@aws-sdk/hash-blob-browser" "3.58.0" - "@aws-sdk/hash-node" "3.55.0" - "@aws-sdk/hash-stream-node" "3.58.0" - "@aws-sdk/invalid-dependency" "3.55.0" - "@aws-sdk/md5-js" "3.58.0" - "@aws-sdk/middleware-bucket-endpoint" "3.58.0" - "@aws-sdk/middleware-content-length" "3.58.0" - "@aws-sdk/middleware-expect-continue" "3.58.0" - "@aws-sdk/middleware-flexible-checksums" "3.72.0" - "@aws-sdk/middleware-host-header" "3.58.0" - "@aws-sdk/middleware-location-constraint" "3.55.0" - "@aws-sdk/middleware-logger" "3.55.0" - "@aws-sdk/middleware-retry" "3.58.0" - "@aws-sdk/middleware-sdk-s3" "3.66.0" - "@aws-sdk/middleware-serde" "3.55.0" - "@aws-sdk/middleware-signing" "3.58.0" - "@aws-sdk/middleware-ssec" "3.55.0" - "@aws-sdk/middleware-stack" "3.55.0" - "@aws-sdk/middleware-user-agent" "3.58.0" - "@aws-sdk/node-config-provider" "3.58.0" - "@aws-sdk/node-http-handler" "3.58.0" - "@aws-sdk/protocol-http" "3.58.0" - "@aws-sdk/signature-v4-multi-region" "3.66.0" - "@aws-sdk/smithy-client" "3.72.0" - "@aws-sdk/types" "3.55.0" - "@aws-sdk/url-parser" "3.55.0" - "@aws-sdk/util-base64-browser" "3.58.0" + "@aws-sdk/client-sts" "3.112.0" + "@aws-sdk/config-resolver" "3.110.0" + "@aws-sdk/credential-provider-node" "3.112.0" + "@aws-sdk/eventstream-serde-browser" "3.110.0" + "@aws-sdk/eventstream-serde-config-resolver" "3.110.0" + "@aws-sdk/eventstream-serde-node" "3.110.0" + "@aws-sdk/fetch-http-handler" "3.110.0" + "@aws-sdk/hash-blob-browser" "3.110.0" + "@aws-sdk/hash-node" "3.110.0" + "@aws-sdk/hash-stream-node" "3.110.0" + "@aws-sdk/invalid-dependency" "3.110.0" + "@aws-sdk/md5-js" "3.110.0" + "@aws-sdk/middleware-bucket-endpoint" "3.110.0" + "@aws-sdk/middleware-content-length" "3.110.0" + "@aws-sdk/middleware-expect-continue" "3.113.0" + "@aws-sdk/middleware-flexible-checksums" "3.110.0" + "@aws-sdk/middleware-host-header" "3.110.0" + "@aws-sdk/middleware-location-constraint" "3.110.0" + "@aws-sdk/middleware-logger" "3.110.0" + "@aws-sdk/middleware-recursion-detection" "3.110.0" + "@aws-sdk/middleware-retry" "3.110.0" + "@aws-sdk/middleware-sdk-s3" "3.110.0" + "@aws-sdk/middleware-serde" "3.110.0" + "@aws-sdk/middleware-signing" "3.110.0" + "@aws-sdk/middleware-ssec" "3.110.0" + "@aws-sdk/middleware-stack" "3.110.0" + "@aws-sdk/middleware-user-agent" "3.110.0" + "@aws-sdk/node-config-provider" "3.110.0" + "@aws-sdk/node-http-handler" "3.110.0" + "@aws-sdk/protocol-http" "3.110.0" + "@aws-sdk/signature-v4-multi-region" "3.110.0" + "@aws-sdk/smithy-client" "3.110.0" + "@aws-sdk/types" "3.110.0" + "@aws-sdk/url-parser" "3.110.0" + "@aws-sdk/util-base64-browser" "3.109.0" "@aws-sdk/util-base64-node" "3.55.0" "@aws-sdk/util-body-length-browser" "3.55.0" "@aws-sdk/util-body-length-node" "3.55.0" - "@aws-sdk/util-defaults-mode-browser" "3.72.0" - "@aws-sdk/util-defaults-mode-node" "3.72.0" - "@aws-sdk/util-stream-browser" "3.55.0" - "@aws-sdk/util-stream-node" "3.55.0" - "@aws-sdk/util-user-agent-browser" "3.58.0" - "@aws-sdk/util-user-agent-node" "3.58.0" - "@aws-sdk/util-utf8-browser" "3.55.0" - "@aws-sdk/util-utf8-node" "3.55.0" - "@aws-sdk/util-waiter" "3.55.0" - "@aws-sdk/xml-builder" "3.55.0" + "@aws-sdk/util-defaults-mode-browser" "3.110.0" + "@aws-sdk/util-defaults-mode-node" "3.110.0" + "@aws-sdk/util-stream-browser" "3.110.0" + "@aws-sdk/util-stream-node" "3.110.0" + "@aws-sdk/util-user-agent-browser" "3.110.0" + "@aws-sdk/util-user-agent-node" "3.110.0" + "@aws-sdk/util-utf8-browser" "3.109.0" + "@aws-sdk/util-utf8-node" "3.109.0" + "@aws-sdk/util-waiter" "3.110.0" + "@aws-sdk/xml-builder" "3.109.0" entities "2.2.0" fast-xml-parser "3.19.0" tslib "^2.3.1" -"@aws-sdk/client-sso@3.72.0": - version "3.72.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/client-sso/-/client-sso-3.72.0.tgz#2dc30c90132a1f58c9b9330704a62d9544a3354a" - integrity sha512-mQ2qSy5chVTzNo17kcOtylp8gUJr2SIx7ZkaC5ZUrA9RZu673XKFm1SXvL0aBw1LQBioKU2kGNwsUSDunXulpQ== +"@aws-sdk/client-sso@3.112.0": + version "3.112.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/client-sso/-/client-sso-3.112.0.tgz#5f308d34566441b94c633018af74036530e69ac6" + integrity sha512-FwFmiapxuVQiyMdDaBvCpajnJkVWEUHBdO+7rIpzgKHkODEPou5/AwboaGRPEFYULOyYeI0HiDFzpK0G6de+7Q== dependencies: "@aws-crypto/sha256-browser" "2.0.0" "@aws-crypto/sha256-js" "2.0.0" - "@aws-sdk/config-resolver" "3.58.0" - "@aws-sdk/fetch-http-handler" "3.58.0" - "@aws-sdk/hash-node" "3.55.0" - "@aws-sdk/invalid-dependency" "3.55.0" - "@aws-sdk/middleware-content-length" "3.58.0" - "@aws-sdk/middleware-host-header" "3.58.0" - "@aws-sdk/middleware-logger" "3.55.0" - "@aws-sdk/middleware-retry" "3.58.0" - "@aws-sdk/middleware-serde" "3.55.0" - "@aws-sdk/middleware-stack" "3.55.0" - "@aws-sdk/middleware-user-agent" "3.58.0" - "@aws-sdk/node-config-provider" "3.58.0" - "@aws-sdk/node-http-handler" "3.58.0" - "@aws-sdk/protocol-http" "3.58.0" - "@aws-sdk/smithy-client" "3.72.0" - "@aws-sdk/types" "3.55.0" - "@aws-sdk/url-parser" "3.55.0" - "@aws-sdk/util-base64-browser" "3.58.0" + "@aws-sdk/config-resolver" "3.110.0" + "@aws-sdk/fetch-http-handler" "3.110.0" + "@aws-sdk/hash-node" "3.110.0" + "@aws-sdk/invalid-dependency" "3.110.0" + "@aws-sdk/middleware-content-length" "3.110.0" + "@aws-sdk/middleware-host-header" "3.110.0" + "@aws-sdk/middleware-logger" "3.110.0" + "@aws-sdk/middleware-recursion-detection" "3.110.0" + "@aws-sdk/middleware-retry" "3.110.0" + "@aws-sdk/middleware-serde" "3.110.0" + "@aws-sdk/middleware-stack" "3.110.0" + "@aws-sdk/middleware-user-agent" "3.110.0" + "@aws-sdk/node-config-provider" "3.110.0" + "@aws-sdk/node-http-handler" "3.110.0" + "@aws-sdk/protocol-http" "3.110.0" + "@aws-sdk/smithy-client" "3.110.0" + "@aws-sdk/types" "3.110.0" + "@aws-sdk/url-parser" "3.110.0" + "@aws-sdk/util-base64-browser" "3.109.0" "@aws-sdk/util-base64-node" "3.55.0" "@aws-sdk/util-body-length-browser" "3.55.0" "@aws-sdk/util-body-length-node" "3.55.0" - "@aws-sdk/util-defaults-mode-browser" "3.72.0" - "@aws-sdk/util-defaults-mode-node" "3.72.0" - "@aws-sdk/util-user-agent-browser" "3.58.0" - "@aws-sdk/util-user-agent-node" "3.58.0" - "@aws-sdk/util-utf8-browser" "3.55.0" - "@aws-sdk/util-utf8-node" "3.55.0" + "@aws-sdk/util-defaults-mode-browser" "3.110.0" + "@aws-sdk/util-defaults-mode-node" "3.110.0" + "@aws-sdk/util-user-agent-browser" "3.110.0" + "@aws-sdk/util-user-agent-node" "3.110.0" + "@aws-sdk/util-utf8-browser" "3.109.0" + "@aws-sdk/util-utf8-node" "3.109.0" tslib "^2.3.1" -"@aws-sdk/client-sts@3.72.0": - version "3.72.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/client-sts/-/client-sts-3.72.0.tgz#302583a73b0587e1a37f3b14f22fd69cb4300dd7" - integrity sha512-m6nEXe5wi7Cx9DHBFOji+i2tn+EXNlBC2BymlFZ+KerxAfjLyu9U16Xx9VzmfnQS5dz0Fyh0DLBIcI9DY5+ywQ== +"@aws-sdk/client-sts@3.112.0": + version "3.112.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/client-sts/-/client-sts-3.112.0.tgz#97aa584562b7b9b18ca09b5a025e3f5093e07a72" + integrity sha512-hSApRO2wg3jk9VRGM6SCZO3aFP7DKVSUqs6FrvlXlj+JU88ZKObjrGE61cCzXoD89Dh+b9t8A2T6W51Nzriaxw== dependencies: "@aws-crypto/sha256-browser" "2.0.0" "@aws-crypto/sha256-js" "2.0.0" - "@aws-sdk/config-resolver" "3.58.0" - "@aws-sdk/credential-provider-node" "3.72.0" - "@aws-sdk/fetch-http-handler" "3.58.0" - "@aws-sdk/hash-node" "3.55.0" - "@aws-sdk/invalid-dependency" "3.55.0" - "@aws-sdk/middleware-content-length" "3.58.0" - "@aws-sdk/middleware-host-header" "3.58.0" - "@aws-sdk/middleware-logger" "3.55.0" - "@aws-sdk/middleware-retry" "3.58.0" - "@aws-sdk/middleware-sdk-sts" "3.58.0" - "@aws-sdk/middleware-serde" "3.55.0" - "@aws-sdk/middleware-signing" "3.58.0" - "@aws-sdk/middleware-stack" "3.55.0" - "@aws-sdk/middleware-user-agent" "3.58.0" - "@aws-sdk/node-config-provider" "3.58.0" - "@aws-sdk/node-http-handler" "3.58.0" - "@aws-sdk/protocol-http" "3.58.0" - "@aws-sdk/smithy-client" "3.72.0" - "@aws-sdk/types" "3.55.0" - "@aws-sdk/url-parser" "3.55.0" - "@aws-sdk/util-base64-browser" "3.58.0" + "@aws-sdk/config-resolver" "3.110.0" + "@aws-sdk/credential-provider-node" "3.112.0" + "@aws-sdk/fetch-http-handler" "3.110.0" + "@aws-sdk/hash-node" "3.110.0" + "@aws-sdk/invalid-dependency" "3.110.0" + "@aws-sdk/middleware-content-length" "3.110.0" + "@aws-sdk/middleware-host-header" "3.110.0" + "@aws-sdk/middleware-logger" "3.110.0" + "@aws-sdk/middleware-recursion-detection" "3.110.0" + "@aws-sdk/middleware-retry" "3.110.0" + "@aws-sdk/middleware-sdk-sts" "3.110.0" + "@aws-sdk/middleware-serde" "3.110.0" + "@aws-sdk/middleware-signing" "3.110.0" + "@aws-sdk/middleware-stack" "3.110.0" + "@aws-sdk/middleware-user-agent" "3.110.0" + "@aws-sdk/node-config-provider" "3.110.0" + "@aws-sdk/node-http-handler" "3.110.0" + "@aws-sdk/protocol-http" "3.110.0" + "@aws-sdk/smithy-client" "3.110.0" + "@aws-sdk/types" "3.110.0" + "@aws-sdk/url-parser" "3.110.0" + "@aws-sdk/util-base64-browser" "3.109.0" "@aws-sdk/util-base64-node" "3.55.0" "@aws-sdk/util-body-length-browser" "3.55.0" "@aws-sdk/util-body-length-node" "3.55.0" - "@aws-sdk/util-defaults-mode-browser" "3.72.0" - "@aws-sdk/util-defaults-mode-node" "3.72.0" - "@aws-sdk/util-user-agent-browser" "3.58.0" - "@aws-sdk/util-user-agent-node" "3.58.0" - "@aws-sdk/util-utf8-browser" "3.55.0" - "@aws-sdk/util-utf8-node" "3.55.0" + "@aws-sdk/util-defaults-mode-browser" "3.110.0" + "@aws-sdk/util-defaults-mode-node" "3.110.0" + "@aws-sdk/util-user-agent-browser" "3.110.0" + "@aws-sdk/util-user-agent-node" "3.110.0" + "@aws-sdk/util-utf8-browser" "3.109.0" + "@aws-sdk/util-utf8-node" "3.109.0" entities "2.2.0" fast-xml-parser "3.19.0" tslib "^2.3.1" -"@aws-sdk/config-resolver@3.58.0": - version "3.58.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/config-resolver/-/config-resolver-3.58.0.tgz#c990541276ecdc76acf25f68f58cdb0d0d7eb07e" - integrity sha512-NXEwYw0JrXcvenu42QpNMQXK+6pgZ+6bDGfCgOfCC0FmyI+w/CuF36lApwm7InHvHazOaDlwArXm2pfntErKoA== +"@aws-sdk/config-resolver@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/config-resolver/-/config-resolver-3.110.0.tgz#93de506934aa06dd973e5e3dab95b629697372f9" + integrity sha512-7VvtKy4CL63BAktQ2vgsjhWDSXpkXO5YdiI56LQnHztrvSuJBBaxJ7R1p/k0b2tEUhYKUziAIW8EKE/7EGPR4g== dependencies: - "@aws-sdk/signature-v4" "3.58.0" - "@aws-sdk/types" "3.55.0" - "@aws-sdk/util-config-provider" "3.55.0" - "@aws-sdk/util-middleware" "3.55.0" + "@aws-sdk/signature-v4" "3.110.0" + "@aws-sdk/types" "3.110.0" + "@aws-sdk/util-config-provider" "3.109.0" + "@aws-sdk/util-middleware" "3.110.0" tslib "^2.3.1" -"@aws-sdk/credential-provider-env@3.55.0": - version "3.55.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-env/-/credential-provider-env-3.55.0.tgz#5a1f5ddff54ea3f58f4a1a824b5b19a1f3618fc6" - integrity sha512-4AIIXEdvinLlWNFtrUbUgoB7dkuV04RTcTruVWI4Ub4WSsuSCa72ZU1vqyvcEAOgGGLBmcSaGTWByjiD2sGcGA== +"@aws-sdk/credential-provider-env@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-env/-/credential-provider-env-3.110.0.tgz#c95552fc0a3ae857ced0e171e53082cf3c84bc74" + integrity sha512-oFU3IYk/Bl5tdsz1qigtm3I25a9cvXPqlE8VjYjxVDdLujF5zd/4HLbhP4GQWhpEwZmM1ijcSNfLcyywVevTZg== dependencies: - "@aws-sdk/property-provider" "3.55.0" - "@aws-sdk/types" "3.55.0" + "@aws-sdk/property-provider" "3.110.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/credential-provider-imds@3.58.0": - version "3.58.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-imds/-/credential-provider-imds-3.58.0.tgz#89d3963895f5e6150b74b5ba2010158d8576b95e" - integrity sha512-CdtnTQ9zqLx1FbXdbgjijLbMcIWOyQM03TFaLSCjI3FNbUwyt3T7StBU9tj/LtbypHhSdXyQBpzUtXTOMWCEhg== +"@aws-sdk/credential-provider-imds@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-imds/-/credential-provider-imds-3.110.0.tgz#ba4f178ccab65c5760bce38e7f694584dad3fd74" + integrity sha512-atl+7/dAB+8fG9XI2fYyCgXKYDbOzot65VAwis+14bOEUCVp7PCJifBEZ/L8GEq564p+Fa2p1IpV0wuQXxqFUQ== dependencies: - "@aws-sdk/node-config-provider" "3.58.0" - "@aws-sdk/property-provider" "3.55.0" - "@aws-sdk/types" "3.55.0" - "@aws-sdk/url-parser" "3.55.0" + "@aws-sdk/node-config-provider" "3.110.0" + "@aws-sdk/property-provider" "3.110.0" + "@aws-sdk/types" "3.110.0" + "@aws-sdk/url-parser" "3.110.0" tslib "^2.3.1" -"@aws-sdk/credential-provider-ini@3.72.0": - version "3.72.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.72.0.tgz#97af5c6c96518d7ff293568b0b89b8ad4ec697a3" - integrity sha512-KeZAywZ5CxEUIRvIpxRiOkRUwGy+rTTGTfjQz/Mz6AUj+nx+8M5WnSLRgENcwXmX59A7VdqosvD1jnRiXJjmPg== - dependencies: - "@aws-sdk/credential-provider-env" "3.55.0" - "@aws-sdk/credential-provider-imds" "3.58.0" - "@aws-sdk/credential-provider-sso" "3.72.0" - "@aws-sdk/credential-provider-web-identity" "3.55.0" - "@aws-sdk/property-provider" "3.55.0" - "@aws-sdk/shared-ini-file-loader" "3.58.0" - "@aws-sdk/types" "3.55.0" +"@aws-sdk/credential-provider-ini@3.112.0": + version "3.112.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.112.0.tgz#46001d9e61957ddc5a253ba2c45be92474960b43" + integrity sha512-ebgZ6/jZdTGHQ3zfq/ccmS+7YmLk6yUWHDmh69VK+B1Dd+S1jFwbD9EQ+pYWCp/gEl9F620NSwb6KghRylPWEQ== + dependencies: + "@aws-sdk/credential-provider-env" "3.110.0" + "@aws-sdk/credential-provider-imds" "3.110.0" + "@aws-sdk/credential-provider-sso" "3.112.0" + "@aws-sdk/credential-provider-web-identity" "3.110.0" + "@aws-sdk/property-provider" "3.110.0" + "@aws-sdk/shared-ini-file-loader" "3.110.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/credential-provider-node@3.72.0": - version "3.72.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-node/-/credential-provider-node-3.72.0.tgz#2f3f7789bb5436dc4f4654c534fa482547dacbf5" - integrity sha512-8yNNILXPAD9RlcKI0aronXOgwF9vRZQqEwPuvkurCPFQFt+OM/4/HTJns2NSVmImKDMV36sG+6Ld6aJEVW4cLQ== - dependencies: - "@aws-sdk/credential-provider-env" "3.55.0" - "@aws-sdk/credential-provider-imds" "3.58.0" - "@aws-sdk/credential-provider-ini" "3.72.0" - "@aws-sdk/credential-provider-process" "3.58.0" - "@aws-sdk/credential-provider-sso" "3.72.0" - "@aws-sdk/credential-provider-web-identity" "3.55.0" - "@aws-sdk/property-provider" "3.55.0" - "@aws-sdk/shared-ini-file-loader" "3.58.0" - "@aws-sdk/types" "3.55.0" +"@aws-sdk/credential-provider-node@3.112.0": + version "3.112.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-node/-/credential-provider-node-3.112.0.tgz#66a87f8d759aabca06bf3205453e1a28301ddeac" + integrity sha512-7txS7P3BAaU4cksFw/PnoVskVvO8h/TPvOl/BxFtCiUdwA6FRltLvBeMlN08fwUoqgM6z06q8areBdeDqCHOSw== + dependencies: + "@aws-sdk/credential-provider-env" "3.110.0" + "@aws-sdk/credential-provider-imds" "3.110.0" + "@aws-sdk/credential-provider-ini" "3.112.0" + "@aws-sdk/credential-provider-process" "3.110.0" + "@aws-sdk/credential-provider-sso" "3.112.0" + "@aws-sdk/credential-provider-web-identity" "3.110.0" + "@aws-sdk/property-provider" "3.110.0" + "@aws-sdk/shared-ini-file-loader" "3.110.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/credential-provider-process@3.58.0": - version "3.58.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-process/-/credential-provider-process-3.58.0.tgz#ff6db03266428bb2074e9b32db8021efa1af6570" - integrity sha512-npgFqPUjMhUamf1FvJjBYUdpbWx8XWkKCwJsX73I7IYQAvAi2atCOkdtKq+4rds0VWAYu6vzlaI1tXgFxjOPNQ== +"@aws-sdk/credential-provider-process@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-process/-/credential-provider-process-3.110.0.tgz#1f4543edd532beb4b690e6f3aaf74d00af3be5c4" + integrity sha512-JJcZePvRTfQHYj/+EEY13yItnZH/e8exlARFUjN0L13UrgHpOJtDQBa+YBHXo6MbTFQh+re25z2kzc+zOYSMNQ== dependencies: - "@aws-sdk/property-provider" "3.55.0" - "@aws-sdk/shared-ini-file-loader" "3.58.0" - "@aws-sdk/types" "3.55.0" + "@aws-sdk/property-provider" "3.110.0" + "@aws-sdk/shared-ini-file-loader" "3.110.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/credential-provider-sso@3.72.0": - version "3.72.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.72.0.tgz#9120deda73b4ec6efa7172bd8bc29fe822c36a08" - integrity sha512-2NGjF2gMls5f/9QbUQEHR9kbVGePLI7EXVOyPb1H6DvQLp54keMVdTlSzKlRIcGUNd4MBYuDJak8Slf976/UVw== +"@aws-sdk/credential-provider-sso@3.112.0": + version "3.112.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.112.0.tgz#1ef5e8f331040b8e5be9b011f8074c682bf068ba" + integrity sha512-b6rOrSXbNK3fGyPvNpyF5zdktmAoNOqHCTmFSUcxRxOipyRGb5JACsbjWthIQkpWkpNCT8GFNLEg9spXPFIdLA== dependencies: - "@aws-sdk/client-sso" "3.72.0" - "@aws-sdk/property-provider" "3.55.0" - "@aws-sdk/shared-ini-file-loader" "3.58.0" - "@aws-sdk/types" "3.55.0" + "@aws-sdk/client-sso" "3.112.0" + "@aws-sdk/property-provider" "3.110.0" + "@aws-sdk/shared-ini-file-loader" "3.110.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/credential-provider-web-identity@3.55.0": - version "3.55.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.55.0.tgz#21aebe5b4ad7a5b4abaf8df9aabfba0994ece357" - integrity sha512-aKnXfZNGohTuF9rCGYLg4JEIOvWIZ/sb66XMq7bOUrx13KRPDwL/eUQL8quS5jGRLpjXVNvrS17AFf65GbdUBg== +"@aws-sdk/credential-provider-web-identity@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.110.0.tgz#236e192826c3856e1f2b8eaa1ad126affd641082" + integrity sha512-e4e5u7v3fsUFZsMcFMhMy1NdJBQpunYcLwpYlszm3OEICwTTekQ+hVvnVRd134doHvzepE4yp9sAop0Cj+IRVQ== dependencies: - "@aws-sdk/property-provider" "3.55.0" - "@aws-sdk/types" "3.55.0" + "@aws-sdk/property-provider" "3.110.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/eventstream-marshaller@3.58.0": - version "3.58.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/eventstream-marshaller/-/eventstream-marshaller-3.58.0.tgz#32d83d006b26f1488e4001cfc1899800428c0dc2" - integrity sha512-vTdVFLIHGZTx/Anp9GpkTXVuvwSCNOecTutU5Py4i6fATgefWiSutc5Xc/FLujBSc0EhAXDGZIcTMpZC7jUpeg== +"@aws-sdk/eventstream-marshaller@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/eventstream-marshaller/-/eventstream-marshaller-3.110.0.tgz#89c6496a906079f1627fd460ab3c342dc2ea9130" + integrity sha512-ZVJI2iCmjxigtLKfc9v48NHY34Qos5l9wgxzB1lU+RwaBppbmjogvIpPlKewEuAFsLTrErUK4ONBWGGsvLYlBQ== dependencies: "@aws-crypto/crc32" "2.0.0" - "@aws-sdk/types" "3.55.0" - "@aws-sdk/util-hex-encoding" "3.58.0" + "@aws-sdk/types" "3.110.0" + "@aws-sdk/util-hex-encoding" "3.109.0" tslib "^2.3.1" -"@aws-sdk/eventstream-serde-browser@3.72.0": - version "3.72.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/eventstream-serde-browser/-/eventstream-serde-browser-3.72.0.tgz#952010c75758e22f45352f08c36e49a84b24ca0c" - integrity sha512-UhMZ4P60mZu7G+craAdkRgR4/n3lWAgrNp1upgN2W8RLEQwhqY3qHiUdn/kp6qvontwHnxZkXNB+5Zm5pcP8bQ== +"@aws-sdk/eventstream-serde-browser@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/eventstream-serde-browser/-/eventstream-serde-browser-3.110.0.tgz#7db96e147756606097dbfa99f7d1cd1b0077a963" + integrity sha512-zeZpKO9Ccsg6seB9oYf9rEQkYfM4nWnyQJtfGvpj/BlkJ7i3UhpbVca8q6aC61WLb3fcO/JROqNfDK1Vis8RgA== dependencies: - "@aws-sdk/eventstream-marshaller" "3.58.0" - "@aws-sdk/eventstream-serde-universal" "3.72.0" - "@aws-sdk/types" "3.55.0" + "@aws-sdk/eventstream-marshaller" "3.110.0" + "@aws-sdk/eventstream-serde-universal" "3.110.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/eventstream-serde-config-resolver@3.55.0": - version "3.55.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/eventstream-serde-config-resolver/-/eventstream-serde-config-resolver-3.55.0.tgz#02fe0ea00b46d8a9fdb021946146d9cb2545dd0d" - integrity sha512-NTJHLq1sbXyXAaJucKvcdN3Svr/fM2TjHEC3l8P/torFjIsX1+Ykpi8tZt8KsX8RjoUTTfKylh41AjJq0K9X4Q== +"@aws-sdk/eventstream-serde-config-resolver@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/eventstream-serde-config-resolver/-/eventstream-serde-config-resolver-3.110.0.tgz#5ec8dee49a595b6079fc52bc4355bc15626bb9de" + integrity sha512-0kyKUU5/46OGe6rgIqbNRJEQhNYwxLdgcJXlBl6q6CdgyQApz6jsAgG0C5xhSLSi4iJijDRriJTowAhkq4AlWQ== dependencies: - "@aws-sdk/types" "3.55.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/eventstream-serde-node@3.72.0": - version "3.72.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/eventstream-serde-node/-/eventstream-serde-node-3.72.0.tgz#8d4e8a496d415990a723db723173af3afeca5173" - integrity sha512-woemBkQ3O7mTiT3kdJH72s3lQLhr2B7hxRhYeaa1xQf1UjLJkKXL5PEOOrcylmxLdF6rYLsFs8Y/Hr4FZfqAqA== +"@aws-sdk/eventstream-serde-node@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/eventstream-serde-node/-/eventstream-serde-node-3.110.0.tgz#07ca20ec5684e0e389951bfa069f1000037d055b" + integrity sha512-Bd7d57BANdy1RBnZ6EBxEaDzC4DidR40EMEk08Ho3+md6CW/vmW63n9wAhKjdoq9a+Hp6aDWP4huVKhyT/d6PA== dependencies: - "@aws-sdk/eventstream-marshaller" "3.58.0" - "@aws-sdk/eventstream-serde-universal" "3.72.0" - "@aws-sdk/types" "3.55.0" + "@aws-sdk/eventstream-marshaller" "3.110.0" + "@aws-sdk/eventstream-serde-universal" "3.110.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/eventstream-serde-universal@3.72.0": - version "3.72.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/eventstream-serde-universal/-/eventstream-serde-universal-3.72.0.tgz#c5aff688933d8e59250bcd67a4d4b385aa21293e" - integrity sha512-iIaDC/2xgK+2kLiOPJv8wMDCCtI2JB8bkeac6cQOfn4hZGQdP6fvRGFWD2R8//VR52H68N2vrhCXHvtjnF4iFg== +"@aws-sdk/eventstream-serde-universal@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/eventstream-serde-universal/-/eventstream-serde-universal-3.110.0.tgz#f24fdec4dc7304c690d3f842b844b50a57110087" + integrity sha512-VjzOxDaHCzPlZs+9UqqQABP47gCWf97kqwhuoPUsCzV8leEHnLfAX3BvIZ58kNr4Fycua5AgK7Ww6uFfXVeW8w== dependencies: - "@aws-sdk/eventstream-marshaller" "3.58.0" - "@aws-sdk/types" "3.55.0" + "@aws-sdk/eventstream-marshaller" "3.110.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/fetch-http-handler@3.58.0": - version "3.58.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/fetch-http-handler/-/fetch-http-handler-3.58.0.tgz#5e102283f0e9a29b5d4d5cf42508a79635b3779a" - integrity sha512-timF3FjPV5Bd+Kgph83LIKVlPCFObVYzious1a6doeLAT6YFwZpRrWbfP/HzS+DCoYiwUsH69oVJ91BoV66oyA== +"@aws-sdk/fetch-http-handler@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/fetch-http-handler/-/fetch-http-handler-3.110.0.tgz#0b6d552659b779c49ba0f99c78a57755864bf1b0" + integrity sha512-vk+K4GeCZL2J2rtvKO+T0Q7i3MDpEGZBMg5K2tj9sMcEQwty0BF0aFnP7Eu2l4/Zif2z1mWuUFM2WcZI6DVnbw== dependencies: - "@aws-sdk/protocol-http" "3.58.0" - "@aws-sdk/querystring-builder" "3.55.0" - "@aws-sdk/types" "3.55.0" - "@aws-sdk/util-base64-browser" "3.58.0" + "@aws-sdk/protocol-http" "3.110.0" + "@aws-sdk/querystring-builder" "3.110.0" + "@aws-sdk/types" "3.110.0" + "@aws-sdk/util-base64-browser" "3.109.0" tslib "^2.3.1" -"@aws-sdk/hash-blob-browser@3.58.0": - version "3.58.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/hash-blob-browser/-/hash-blob-browser-3.58.0.tgz#03a4e78932d0e00ff1f452d528a9c3e64bc9fff3" - integrity sha512-fdp12BqypRxwvevbJSl/sUhXJRi4Ghv6JKEXAHI1klkR6xY1GRORO5SHWltVY/xl373ERMol5o/n+ra/7jcx/g== +"@aws-sdk/hash-blob-browser@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/hash-blob-browser/-/hash-blob-browser-3.110.0.tgz#9237d9cd239ed1e964cf567dd4d2891b30984417" + integrity sha512-NkTosjlYwP2dcBXY6yzhNafAK+W2nceheffvWdyGA29+E9YdRjDminXvKc/WAkZUMOW0CaCbD90otOiimAAYyQ== dependencies: "@aws-sdk/chunked-blob-reader" "3.55.0" - "@aws-sdk/chunked-blob-reader-native" "3.58.0" - "@aws-sdk/types" "3.55.0" + "@aws-sdk/chunked-blob-reader-native" "3.109.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/hash-node@3.55.0": - version "3.55.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/hash-node/-/hash-node-3.55.0.tgz#ea58e9b6f2147c59ad4e41e83bd6864df59b331e" - integrity sha512-2UdYwY/++AlzWEAFaK9wOed2QSxbzV527vmqKjReLHpPKPrSIlooUxlTH3LU6Y6WVDAzDRtLK43KUVXTLgGK1A== +"@aws-sdk/hash-node@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/hash-node/-/hash-node-3.110.0.tgz#b225bfd16596b6485c1c610e8fef8de1e40931c4" + integrity sha512-wakl+kP2O8wTGYiQ3InZy+CVfGrIpFfq9fo4zif9PZac0BbUbguUU1dkY34uZiaf+4o2/9MoDYrHU2HYeXKxWw== dependencies: - "@aws-sdk/types" "3.55.0" + "@aws-sdk/types" "3.110.0" "@aws-sdk/util-buffer-from" "3.55.0" tslib "^2.3.1" -"@aws-sdk/hash-stream-node@3.58.0": - version "3.58.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/hash-stream-node/-/hash-stream-node-3.58.0.tgz#f0f3fc45e069834600264deed2fa4d0da42773b1" - integrity sha512-y7HEeC3OiuXCRqsHnKDn5yef8UAbnegD9r+OM9bdD+3e6FLAL8Rq7hQTOpwIAiPXuD7HKx8h98s9JLvkwTOBkg== +"@aws-sdk/hash-stream-node@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/hash-stream-node/-/hash-stream-node-3.110.0.tgz#786304b29d27a8e3814a49fb93208e8231ebca87" + integrity sha512-srlStn+dCnBlQy4oWBz3oFS8vT5Xgxhra91rt9U+vHruCyQ0L1es0J87X4uwy2HRlnIw3daPtVLtxekahEXzKQ== dependencies: - "@aws-sdk/types" "3.55.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/invalid-dependency@3.55.0": - version "3.55.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/invalid-dependency/-/invalid-dependency-3.55.0.tgz#5406c80e4be534700b92b61c21a74efd754c9492" - integrity sha512-delH0lV+78fdD/8MXIt9kTLS6IwHvdhqq9dw/ow5VjTUw+xBwUlfPfZplaai+3hKTKWh6a2WZCeDasNItBv9aA== +"@aws-sdk/invalid-dependency@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/invalid-dependency/-/invalid-dependency-3.110.0.tgz#9104dfd40e35b6737dc7ab01f4e79c76c1109c44" + integrity sha512-O8J1InmtJkoiUMbQDtxBfOzgigBp9iSVsNXQrhs2qHh3826cJOfE7NGT3u+NMw73Pk5j2cfmOh1+7k/76IqxOg== dependencies: - "@aws-sdk/types" "3.55.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" "@aws-sdk/is-array-buffer@3.55.0": @@ -550,295 +555,290 @@ dependencies: tslib "^2.3.1" -"@aws-sdk/md5-js@3.58.0": - version "3.58.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/md5-js/-/md5-js-3.58.0.tgz#a7ecf5cc8a81ce247fd620f8c981802d0427737f" - integrity sha512-V5f4Re+CLn3aDF1nrmDqdUtcqBHCyxxD2s2Ot+hZ2JFit+OtJggo1cI03ldTrQpG79rwHG+bHqL2VvNQP7Aj9A== +"@aws-sdk/md5-js@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/md5-js/-/md5-js-3.110.0.tgz#0a8745cbcaa609452d034e1b0edfa8f0cf45e2ae" + integrity sha512-66gV6CH8O7ymTZMIbGjdUI71K7ErDfudhtN/ULb97kD2TYX4NlFtxNZxx3+iZH1G0H636lWm9hJcU5ELG9B+bw== dependencies: - "@aws-sdk/types" "3.55.0" - "@aws-sdk/util-utf8-browser" "3.55.0" - "@aws-sdk/util-utf8-node" "3.55.0" + "@aws-sdk/types" "3.110.0" + "@aws-sdk/util-utf8-browser" "3.109.0" + "@aws-sdk/util-utf8-node" "3.109.0" tslib "^2.3.1" -"@aws-sdk/middleware-bucket-endpoint@3.58.0": - version "3.58.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-bucket-endpoint/-/middleware-bucket-endpoint-3.58.0.tgz#cec84100ff776862e3bbd4bd596a1e869ad81e5e" - integrity sha512-zocLfFzj+NQjXLGZKPJBAYWWldAKBJkGzGVpTfrYx9bxxHTA70Gu+3sx+Xe+iOu8dtQT0OAnIX0wGudOPnTGNg== +"@aws-sdk/middleware-bucket-endpoint@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-bucket-endpoint/-/middleware-bucket-endpoint-3.110.0.tgz#76e0dce1d16750340da76736c5737d790db1a95a" + integrity sha512-l1q0KzMRFyGSSc7LZGEh2xhCha1933C8uJE5g23b7dZdklEU5I62l4daELo+TBANcxFzDiRXd6g5mly/T+ZTSg== dependencies: - "@aws-sdk/protocol-http" "3.58.0" - "@aws-sdk/types" "3.55.0" + "@aws-sdk/protocol-http" "3.110.0" + "@aws-sdk/types" "3.110.0" "@aws-sdk/util-arn-parser" "3.55.0" - "@aws-sdk/util-config-provider" "3.55.0" + "@aws-sdk/util-config-provider" "3.109.0" tslib "^2.3.1" -"@aws-sdk/middleware-content-length@3.58.0": - version "3.58.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-content-length/-/middleware-content-length-3.58.0.tgz#9418b8c5f4437c9f5f7860e85c36468e93a302f7" - integrity sha512-h/BypPkhjv2CpCUbXA8Fa2s7V2GPiz9l11XhYK+sKSuQvQ7Lbq6VhaKaLqfeD3gLVZHgJZSLGl2btdHV1qHNNA== +"@aws-sdk/middleware-content-length@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-content-length/-/middleware-content-length-3.110.0.tgz#f4dc3508952c5fae9740f172d3b76135dd4dba37" + integrity sha512-hKU+zdqfAJQg22LXMVu/z35nNIHrVAKpVKPe9+WYVdL/Z7JKUPK7QymqKGOyDuDbzW6OxyulC1zKGEX12zGmdA== dependencies: - "@aws-sdk/protocol-http" "3.58.0" - "@aws-sdk/types" "3.55.0" + "@aws-sdk/protocol-http" "3.110.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/middleware-expect-continue@3.58.0": - version "3.58.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-expect-continue/-/middleware-expect-continue-3.58.0.tgz#92be232561ef27ab41bf46feb0f689e11f695516" - integrity sha512-nx6X6qLPwvbJrGoPxXSu4tsOek2eRnnjk78hhRUDfxFewpHJQLSPlyNKkXAo+C3syVALe6RJRmUYu5bShY6FfA== +"@aws-sdk/middleware-expect-continue@3.113.0": + version "3.113.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-expect-continue/-/middleware-expect-continue-3.113.0.tgz#0129967f40ef57eec922ef8e126d77b90853a0fe" + integrity sha512-LLtSunCYVWeAhRP+6enn0kYF119WooV6gepMGOWeRCpKXO2iyi8YOx2Mtgc3T8ybiAG/dVlmZoX47Y1HINcuqg== dependencies: - "@aws-sdk/middleware-header-default" "3.58.0" - "@aws-sdk/protocol-http" "3.58.0" - "@aws-sdk/types" "3.55.0" + "@aws-sdk/protocol-http" "3.110.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/middleware-flexible-checksums@3.72.0": - version "3.72.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-flexible-checksums/-/middleware-flexible-checksums-3.72.0.tgz#bb10e6985295df144f66c4d743b6ca39f54af2f6" - integrity sha512-lrwTmpygp6bxGRi6kbMq+EtTW5nsts+B7Wj7MA8PBIQsKU06T2tYxjDBYOyHB1MiVhltlq+vebBvacT64KsbFA== +"@aws-sdk/middleware-flexible-checksums@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-flexible-checksums/-/middleware-flexible-checksums-3.110.0.tgz#bbf6009d45b7080e262a7351a86acf083ee22af1" + integrity sha512-Z/v1Da+e1McxrVr1s4jUykp2EXsOHpTxZ4M0X8vNkXCIVSuaMp4UI0P+LQawbDA+j3FaecqqBfWMZ2sHQ8bpoA== dependencies: "@aws-crypto/crc32" "2.0.0" "@aws-crypto/crc32c" "2.0.0" "@aws-sdk/is-array-buffer" "3.55.0" - "@aws-sdk/protocol-http" "3.58.0" - "@aws-sdk/types" "3.55.0" + "@aws-sdk/protocol-http" "3.110.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/middleware-header-default@3.58.0": - version "3.58.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-header-default/-/middleware-header-default-3.58.0.tgz#c72190df982601048126f452f3805858f1a11a4b" - integrity sha512-7F+CdLLauMmNbwFGYrE2pKsgTKY8G2PgazHmaE9s3FySEFcGPWmiEAG8sVImfZooj8gxGFQMLr97nanWjhSq2Q== +"@aws-sdk/middleware-host-header@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-host-header/-/middleware-host-header-3.110.0.tgz#a28115e2797b86c2fb583000593b723a51313b92" + integrity sha512-/Cknn1vL2LTlclI0MX2RzmtdPlCJ5palCRXxm/mod1oHwg4oNTKRlUX3LUD+L8g7JuJ4h053Ch9KS/A0vanE5Q== dependencies: - "@aws-sdk/protocol-http" "3.58.0" - "@aws-sdk/types" "3.55.0" + "@aws-sdk/protocol-http" "3.110.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/middleware-host-header@3.58.0": - version "3.58.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-host-header/-/middleware-host-header-3.58.0.tgz#c7fe87ed16306e328e780bbed282dbf31d605236" - integrity sha512-q/UKGcanm9e6DBRNN6UKhVqLvpRRdZWbmmPCeDNr4HqhCmgT6i1OvWdhAMOnT++hvCX8DpTsIXzNSlY6zWAxBg== +"@aws-sdk/middleware-location-constraint@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-location-constraint/-/middleware-location-constraint-3.110.0.tgz#0a710ac704cc7c40ca34edf62387d8ac1fdbdaae" + integrity sha512-8ZSo9sqrTMcSp0xEJQ3ypmQpeSMQl1NXXv72khJPweZqDoO0eAbfytwyH4JH4sP0VwVVmuDHdwPXyDZX7I0iQg== dependencies: - "@aws-sdk/protocol-http" "3.58.0" - "@aws-sdk/types" "3.55.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/middleware-location-constraint@3.55.0": - version "3.55.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-location-constraint/-/middleware-location-constraint-3.55.0.tgz#cb7e91df4269bb2e64ee2d83a49973f152ef9094" - integrity sha512-OvCKwBFbl8Gbfk0HGX00pkdORJN8BPuH/O5l3+mOBWuwILPuckRP5WGnL+1HT/gu4hHS6h1lpxUrPxUOoeKIAg== +"@aws-sdk/middleware-logger@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-logger/-/middleware-logger-3.110.0.tgz#69eb0b2d0d9833f6fdbe33eb1876254e7cee53ec" + integrity sha512-+pz+a+8dfTnzLj79nHrv3aONMp/N36/erMd+7JXeR84QEosVLrFBUwKA8x5x6O3s1iBbQzRKMYEIuja9xn1BPA== dependencies: - "@aws-sdk/types" "3.55.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/middleware-logger@3.55.0": - version "3.55.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-logger/-/middleware-logger-3.55.0.tgz#83adc985a3a98493519384565e0c1a06552b8704" - integrity sha512-PtRbVrxEzDmeV9prBIP4/9or7R5Dj66mjbFSvNRGZ0n+UBfBFfVRfNrhQPNzQpfV9A3KVl9YyWCVXDSW+/rk9Q== +"@aws-sdk/middleware-recursion-detection@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.110.0.tgz#8daa2bc9f62cbf499d9c615726cf2a51f46e70ff" + integrity sha512-Wav782zd7bcd1e6txRob76CDOdVOaUQ8HXoywiIm/uFrEEUZvhs2mgnXjVUVCMBUehdNgnL99z420aS13JeL/Q== dependencies: - "@aws-sdk/types" "3.55.0" + "@aws-sdk/protocol-http" "3.110.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/middleware-retry@3.58.0": - version "3.58.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-retry/-/middleware-retry-3.58.0.tgz#967518e5b9e55546dcb5de0dfe5784df71807d72" - integrity sha512-sfSq+t0Yy47DQwrWGpA8iOx9sd26l4l1JDVTwHNi7+OKD4ClRPVCEdw3bTbbyYz/PV4f9AEfAZ6jwtSff4wkGw== +"@aws-sdk/middleware-retry@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-retry/-/middleware-retry-3.110.0.tgz#3bdbd66d06dcbddbdf684d1d81c6d5fd7746f03b" + integrity sha512-lwLAQQveCiUqymQvVYjCee6QOXw3Zqbc9yq+pxYdXbs1Cv1XMA6PeJeUU5r5KEVuSceBLyyrnl6E0R1l1om1MQ== dependencies: - "@aws-sdk/protocol-http" "3.58.0" - "@aws-sdk/service-error-classification" "3.55.0" - "@aws-sdk/types" "3.55.0" - "@aws-sdk/util-middleware" "3.55.0" + "@aws-sdk/protocol-http" "3.110.0" + "@aws-sdk/service-error-classification" "3.110.0" + "@aws-sdk/types" "3.110.0" + "@aws-sdk/util-middleware" "3.110.0" tslib "^2.3.1" uuid "^8.3.2" -"@aws-sdk/middleware-sdk-ec2@3.58.0": - version "3.58.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-sdk-ec2/-/middleware-sdk-ec2-3.58.0.tgz#690bfddbd416d9c262c42bf16c31f4a11461747b" - integrity sha512-0xtIpqUshvND4APMy+Zd/7ukJTWvTaU2mkX9UkzSKSRIfd82ftZBtIuKwE21i2Y1mqm4QGQwPRdQawoSaSizHQ== +"@aws-sdk/middleware-sdk-ec2@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-sdk-ec2/-/middleware-sdk-ec2-3.110.0.tgz#45dda6a876c76c04d4816ed8a053866ac13ea543" + integrity sha512-b5L2HULfTOoQLg1vuz7kYeER5sdZxScIciclUSjEmTTIkmqxIYHsiQMffL3Q4QrwYIjOtn8Um0CiwtZjIaVE4w== dependencies: - "@aws-sdk/protocol-http" "3.58.0" - "@aws-sdk/signature-v4" "3.58.0" - "@aws-sdk/types" "3.55.0" - "@aws-sdk/util-format-url" "3.58.0" + "@aws-sdk/protocol-http" "3.110.0" + "@aws-sdk/signature-v4" "3.110.0" + "@aws-sdk/types" "3.110.0" + "@aws-sdk/util-format-url" "3.110.0" tslib "^2.3.1" -"@aws-sdk/middleware-sdk-s3@3.66.0": - version "3.66.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-sdk-s3/-/middleware-sdk-s3-3.66.0.tgz#c39f401969cb4d477c3e7e2f43df501c0b10a16d" - integrity sha512-4ACAdKAZkIjEK99UwoaKTrTGhS7qGqyLmjiGHlzR0ggMUUVmlep7EtcluImFtT6pi+ANVLDzuZGa+95MwGY/Qg== +"@aws-sdk/middleware-sdk-s3@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-sdk-s3/-/middleware-sdk-s3-3.110.0.tgz#069603d33fbc349661facb0aaa131a95263e1b88" + integrity sha512-/PpZU11dkGldD6yeAccPxFd5nzofLOA3+j25RdIwz2jlJMLl9TeznYRtFH5JhHonP3lsK+IPEnFPwuL6gkBxIQ== dependencies: - "@aws-sdk/protocol-http" "3.58.0" - "@aws-sdk/types" "3.55.0" + "@aws-sdk/middleware-bucket-endpoint" "3.110.0" + "@aws-sdk/protocol-http" "3.110.0" + "@aws-sdk/types" "3.110.0" "@aws-sdk/util-arn-parser" "3.55.0" tslib "^2.3.1" -"@aws-sdk/middleware-sdk-sts@3.58.0": - version "3.58.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-sdk-sts/-/middleware-sdk-sts-3.58.0.tgz#5b433a49d2aeb10120805d0f13f6700153d55ec9" - integrity sha512-HUz7MhcsSDDTGygOwL61l4voc0pZco06J3z06JjTX19D5XxcQ7hSCtkHHHz0oMb9M1himVSiEon2tjhjsnB99g== - dependencies: - "@aws-sdk/middleware-signing" "3.58.0" - "@aws-sdk/property-provider" "3.55.0" - "@aws-sdk/protocol-http" "3.58.0" - "@aws-sdk/signature-v4" "3.58.0" - "@aws-sdk/types" "3.55.0" +"@aws-sdk/middleware-sdk-sts@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-sdk-sts/-/middleware-sdk-sts-3.110.0.tgz#8c1e34b72355c5e63495927a01839f210327f0c1" + integrity sha512-EjY/YFdlr5jECde6qIrTIyGBbn/34CKcQGKvmvRd31+3qaClIJLAwNuHfcVzWvCUGbAslsfvdbOpLju33pSQRA== + dependencies: + "@aws-sdk/middleware-signing" "3.110.0" + "@aws-sdk/property-provider" "3.110.0" + "@aws-sdk/protocol-http" "3.110.0" + "@aws-sdk/signature-v4" "3.110.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/middleware-serde@3.55.0": - version "3.55.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-serde/-/middleware-serde-3.55.0.tgz#326a0696255868a9dfca7c482a616897e9d54fdf" - integrity sha512-NkEbTDrSZcC2NhuvfjXHKJEl0xgI2B5tMAwi/rMOq/TEnARwVUL9qAy+5lgeiPCqebiNllWatARrFgAaYf0VeA== +"@aws-sdk/middleware-serde@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-serde/-/middleware-serde-3.110.0.tgz#603dcc1f68d78e9123f9b696150374a8357de6c3" + integrity sha512-brVupxgEAmcZ9cZvdHEH8zncjvGKIiud8pOe4fiimp5NpHmjBLew4jUbnOKNZNAjaidcKUtz//cxtutD6yXEww== dependencies: - "@aws-sdk/types" "3.55.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/middleware-signing@3.58.0": - version "3.58.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-signing/-/middleware-signing-3.58.0.tgz#996828122526ec5f95e6e898a6573791db4cd5e1" - integrity sha512-4FXubHB66GbhyZUlo6YPQoWpYfED15GNbEmHbJLSONzrVzZR3IkViSPLasDngVm1a050JqKuqNkFYGJBP4No/Q== +"@aws-sdk/middleware-signing@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-signing/-/middleware-signing-3.110.0.tgz#8faa6acdaedb1c29614fe7ba88a74534db38f3bb" + integrity sha512-y6ZKrGYfgDlFMzWhZmoq5J1UctBgZOUvMmnU9sSeZ020IlEPiOxFMvR0Zu6TcYThp8uy3P0wyjQtGYeTl9Z/kA== dependencies: - "@aws-sdk/property-provider" "3.55.0" - "@aws-sdk/protocol-http" "3.58.0" - "@aws-sdk/signature-v4" "3.58.0" - "@aws-sdk/types" "3.55.0" + "@aws-sdk/property-provider" "3.110.0" + "@aws-sdk/protocol-http" "3.110.0" + "@aws-sdk/signature-v4" "3.110.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/middleware-ssec@3.55.0": - version "3.55.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-ssec/-/middleware-ssec-3.55.0.tgz#2f8c8593fb2a2719a0863d48b0ef6baecbd08011" - integrity sha512-HTdA23hksOphQe0TmYORsa/kMNnKRGbdh0VJcsDGHQScJXzJ+C//THwfcoklff0XZfC+vGh93PECBWqixMELZw== +"@aws-sdk/middleware-ssec@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-ssec/-/middleware-ssec-3.110.0.tgz#85020a0e54840e572231407dde6d40a82239d03b" + integrity sha512-Zrm+h+C+MXv2Q+mh8O/zwK2hUYM4kq4I1vx72RPpvyfIk4/F5ZzeA3LSVluISyAW+iNqS8XFvGFrzl2gB8zWsg== dependencies: - "@aws-sdk/types" "3.55.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/middleware-stack@3.55.0": - version "3.55.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-stack/-/middleware-stack-3.55.0.tgz#e99ffb0bdd6861ec3b5a667561dc41dfcb44d36b" - integrity sha512-ouD+wFz8W2R0ZQ8HrbhgN8tg1jyINEg9lPEEXY79w1Q5sf94LJ90XKAMVk02rw3dJalUWjLHf0OQe1/qxZfHyA== +"@aws-sdk/middleware-stack@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-stack/-/middleware-stack-3.110.0.tgz#5a531c83ec375adf9d7f1bd80b725cebf7b2f01d" + integrity sha512-iaLHw6ctOuGa9UxNueU01Xes+15dR+mqioRpUOUZ9Zx+vhXVpD7C8lnNqhRnYeFXs10/rNIzASgsIrAHTlnlIQ== dependencies: tslib "^2.3.1" -"@aws-sdk/middleware-user-agent@3.58.0": - version "3.58.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.58.0.tgz#c60b83f61ed385989e0be5dc80b05a8d5626bbf8" - integrity sha512-1c69bIWM63JwXijXvb9IWwcwQ/gViKMZ1lhxv52NvdG5VSxWXXsFJ2jETEXZoAypwT97Hmf3xo9SYuaHcKoq+g== +"@aws-sdk/middleware-user-agent@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.110.0.tgz#52f32e99ecb641babcd59bb010527d5614e908f4" + integrity sha512-Y6FgiZr99DilYq6AjeaaWcNwVlSQpNGKrILzvV4Tmz03OaBIspe4KL+8EZ2YA/sAu5Lpw80vItdezqDOwGAlnQ== dependencies: - "@aws-sdk/protocol-http" "3.58.0" - "@aws-sdk/types" "3.55.0" + "@aws-sdk/protocol-http" "3.110.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/node-config-provider@3.58.0": - version "3.58.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/node-config-provider/-/node-config-provider-3.58.0.tgz#1a138c571f6b2608cff49a64f4f2936971734f1e" - integrity sha512-AMcPqPhKxo/3/yOMS9PsKlI0GWp2/8eD6gSlhzdBpznPCKplyqXOSnSX7wS814Cyh373hFSjCaOrCOA9/EYtDg== +"@aws-sdk/node-config-provider@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/node-config-provider/-/node-config-provider-3.110.0.tgz#7d032082b85458ea4959f744d473e328be024359" + integrity sha512-46p4dCPGYctuybTQTwLpjenA1QFHeyJw/OyggGbtUJUy+833+ldnAwcPVML2aXJKUKv3APGI8vq1kaloyNku3Q== dependencies: - "@aws-sdk/property-provider" "3.55.0" - "@aws-sdk/shared-ini-file-loader" "3.58.0" - "@aws-sdk/types" "3.55.0" + "@aws-sdk/property-provider" "3.110.0" + "@aws-sdk/shared-ini-file-loader" "3.110.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/node-http-handler@3.58.0": - version "3.58.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/node-http-handler/-/node-http-handler-3.58.0.tgz#bb633b51a205181657bfc59b24b7bf1720b7e652" - integrity sha512-D9xVZG2nfo4GbPsby3JuBiAhpqXTFk1+CfuQU0AZv0gQvE3fFTCnB3za83jo7JV/pyRPU+s+/LHIpxCWUHzStg== +"@aws-sdk/node-http-handler@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/node-http-handler/-/node-http-handler-3.110.0.tgz#b29ba034558ec3cddae69860d49766a27ee73354" + integrity sha512-/rP+hY516DpP8fZhwFW5xM/ElH0w6lxw/15VvZCoY5EnOLAF5XIsJdzscWPSEW2FHCylBM4SNrKhGar14BDXhA== dependencies: - "@aws-sdk/abort-controller" "3.55.0" - "@aws-sdk/protocol-http" "3.58.0" - "@aws-sdk/querystring-builder" "3.55.0" - "@aws-sdk/types" "3.55.0" + "@aws-sdk/abort-controller" "3.110.0" + "@aws-sdk/protocol-http" "3.110.0" + "@aws-sdk/querystring-builder" "3.110.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/property-provider@3.55.0": - version "3.55.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/property-provider/-/property-provider-3.55.0.tgz#0eabe5e84d9258c85c2c5e44bcb09379ae9429d2" - integrity sha512-o7cKFJSHq5WOhwPsspYrzNto35oKKZvESZuWDtLxaZKSI6l7zpA366BI4kDG6Tc9i2+teV553MbxyZ9eya5A8g== +"@aws-sdk/property-provider@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/property-provider/-/property-provider-3.110.0.tgz#ea60c33a8e243246fc21d478ff009063825b9abd" + integrity sha512-7NkpmYeOkK3mhWBNU+/zSDqwzeaSPH1qrq4L//WV7WS/weYyE/jusQeZoOxVsuZQnQEXHt5O2hKVeUwShl12xA== dependencies: - "@aws-sdk/types" "3.55.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/protocol-http@3.58.0": - version "3.58.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/protocol-http/-/protocol-http-3.58.0.tgz#170798abcc97884d4beabc4dbbdfe3b41acd2d0a" - integrity sha512-0yFFRPbR+CCa9eOQBBQ2qtrIDLYqSMN0y7G4iqVM8wQdIw7n3QK1PsTI3RNPGJ3Oi2krFTw5uUKqQQZPZEBuVQ== +"@aws-sdk/protocol-http@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/protocol-http/-/protocol-http-3.110.0.tgz#ff3cffa5b1eb7c8564a9e9019a8842b429c7f85c" + integrity sha512-qdi2gCbJiyPyLn+afebPNp/5nVCRh1X7t7IRIFl3FHVEC+o54u/ojay/MLZ4M/+X9Fa4Zxsb0Wpp3T0xAHVDBg== dependencies: - "@aws-sdk/types" "3.55.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/querystring-builder@3.55.0": - version "3.55.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/querystring-builder/-/querystring-builder-3.55.0.tgz#7d6d4e2c597eb3d636bd3a368b494dac175ba329" - integrity sha512-/ZAXNipt9nRR8k+eowwukE/YjXnQ49p5w/MkaQxsBk3IuIf7MAcgVg8glHr0igH84GfUQ7ZVP8v+G2S3tKUG+Q== +"@aws-sdk/querystring-builder@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/querystring-builder/-/querystring-builder-3.110.0.tgz#c7f63262e898ab38cdbbbfcd03ddbfde346c9595" + integrity sha512-7V3CDXj519izmbBn9ZE68ymASwGriA+Aq+cb/yHSVtffnvXjPtvONNw7G/5iVblisGLSCUe2hSvpYtcaXozbHw== dependencies: - "@aws-sdk/types" "3.55.0" + "@aws-sdk/types" "3.110.0" "@aws-sdk/util-uri-escape" "3.55.0" tslib "^2.3.1" -"@aws-sdk/querystring-parser@3.55.0": - version "3.55.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/querystring-parser/-/querystring-parser-3.55.0.tgz#ea35642c1b8324dd896d45185f99ad9d6c3af6d2" - integrity sha512-e+2FLgo+eDx7oh7ap5HngN9XSVMxredAVztLHxCcSN0lFHHHzMa8b2SpXbaowUxQHh7ziymSqvOrPYFQ71Filg== +"@aws-sdk/querystring-parser@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/querystring-parser/-/querystring-parser-3.110.0.tgz#0551efb7aaa867d3b6705f62d798a45247f5f44b" + integrity sha512-//pJHH7hrhdDMZGBPKXKymmC/tJM7gFT0w/qbu/yd3Wm4W2fMB+8gkmj6EZctx7jrsWlfRQuvFejKqEfapur/g== dependencies: - "@aws-sdk/types" "3.55.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/service-error-classification@3.55.0": - version "3.55.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/service-error-classification/-/service-error-classification-3.55.0.tgz#4a85d2d947102c50076bd2af295f62abd74e26ab" - integrity sha512-HdjnDyarsa1Avq1MJurkLyEe9c3eRa76dPmK4TmRGgwJ+tInEzGHL0rBW7V8xBK+PDF+fJQ71hvm8jPYmzvBwQ== +"@aws-sdk/service-error-classification@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/service-error-classification/-/service-error-classification-3.110.0.tgz#09398517d4ad9787bd0d904816bfe0ffd68b1f5f" + integrity sha512-ccgCE0pU/4RmXR6CP3fLAdhPAve7bK/yXBbGzpSHGAQOXqNxYzOsAvQ30Jg6X+qjLHsI/HR2pLIE65z4k6tynw== -"@aws-sdk/shared-ini-file-loader@3.58.0": - version "3.58.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/shared-ini-file-loader/-/shared-ini-file-loader-3.58.0.tgz#321f80f34ef3f15ab40b756fb5ee2797812748c7" - integrity sha512-ARDKQerIzgNs/MFNdCEuK2lgRJ1lneAaJw0p9O1LkJUvcSibvkSATwny7vwJMueOf+ae1Pf+8+54OMNIt0nTkQ== +"@aws-sdk/shared-ini-file-loader@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/shared-ini-file-loader/-/shared-ini-file-loader-3.110.0.tgz#f91b66e7084312df2b337cc990c9585e832fc2fc" + integrity sha512-E1ERoqEoG206XNBYWCKLgHkzCbTxdpDEGbsLET2DnvjFsT0s9p2dPvVux3bYl7JVAhyGduE+qcqWk7MzhFCBNQ== dependencies: tslib "^2.3.1" -"@aws-sdk/signature-v4-multi-region@3.66.0": - version "3.66.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/signature-v4-multi-region/-/signature-v4-multi-region-3.66.0.tgz#e3a1366396f9b967496981b67baf149661a51760" - integrity sha512-Akvc8G9Del2+umg0R/5Gc/PWgQwbxxTXdnm6YTHtDzvyPPiYWBs6au6WqJQqcqk07gcQV67MLVqFFhnFuLlcVg== +"@aws-sdk/signature-v4-multi-region@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/signature-v4-multi-region/-/signature-v4-multi-region-3.110.0.tgz#5fb3e0662d7a99e9618ae9e60a460c994efd1c3e" + integrity sha512-D5nlq6em9fU9EMmpjQtLItr2d6MmfM9yofOaeNQcgY8wFJEOCc2ADccq8dCO0F4twakAvjuUIkBAWMBviiuC7Q== dependencies: - "@aws-sdk/protocol-http" "3.58.0" - "@aws-sdk/signature-v4" "3.58.0" - "@aws-sdk/types" "3.55.0" + "@aws-sdk/protocol-http" "3.110.0" + "@aws-sdk/signature-v4" "3.110.0" + "@aws-sdk/types" "3.110.0" "@aws-sdk/util-arn-parser" "3.55.0" tslib "^2.3.1" -"@aws-sdk/signature-v4@3.58.0": - version "3.58.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/signature-v4/-/signature-v4-3.58.0.tgz#0d81dd317f9bf35bc0de670c0e534d7793f8e170" - integrity sha512-flEo8p3XkzWoBDqnIUQre4jLuT5aLnmfQNI8c2uSjyJ3OBxpJ0iS1cDu3E++d1/pN6Q8o0KOmr2ypHeiyBOujw== +"@aws-sdk/signature-v4@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/signature-v4/-/signature-v4-3.110.0.tgz#9dba5d06345fa756b4c23deeec7086f6148a5bf1" + integrity sha512-utxxdllOnmQDhbpipnFAbuQ4c2pwefZ+2hi48jKvQRULQ2PO4nxLmdZm6B0FXaTijbKsyO7GrMik+EZ6mi3ARQ== dependencies: "@aws-sdk/is-array-buffer" "3.55.0" - "@aws-sdk/types" "3.55.0" - "@aws-sdk/util-hex-encoding" "3.58.0" - "@aws-sdk/util-middleware" "3.55.0" + "@aws-sdk/types" "3.110.0" + "@aws-sdk/util-hex-encoding" "3.109.0" + "@aws-sdk/util-middleware" "3.110.0" "@aws-sdk/util-uri-escape" "3.55.0" tslib "^2.3.1" -"@aws-sdk/smithy-client@3.72.0": - version "3.72.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/smithy-client/-/smithy-client-3.72.0.tgz#93e2b6a22f5426e7526b06296454c0f3831ef97d" - integrity sha512-eQ2pEzxtS1Vz1XyNKzG4Z+mtfwRzcAs4FUQP0wrrYVJMsIdI0X4vvro8gYGoBbQtOz65uY3XqQdLuXX/SabTQg== +"@aws-sdk/smithy-client@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/smithy-client/-/smithy-client-3.110.0.tgz#397c0e7ef56ffa058469c641b586978400c09dd7" + integrity sha512-gNLYrmdAe/1hVF2Nv2LF4OkL1A0a1o708pEMZHzql9xP164omRDaLrGDhz9tH7tsJEgLz+Bf4E8nTuISeDwvGg== dependencies: - "@aws-sdk/middleware-stack" "3.55.0" - "@aws-sdk/types" "3.55.0" + "@aws-sdk/middleware-stack" "3.110.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/types@3.55.0": - version "3.55.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/types/-/types-3.55.0.tgz#d524d567e2b2722f2d6be83e2417dd6d46ce1490" - integrity sha512-wrDZjuy1CVAYxDCbm3bWQIKMGfNs7XXmG0eG4858Ixgqmq2avsIn5TORy8ynBxcXn9aekV/+tGEQ7BBSYzIVNQ== - -"@aws-sdk/types@^3.1.0": +"@aws-sdk/types@3.110.0", "@aws-sdk/types@^3.1.0": version "3.110.0" resolved "https://registry.yarnpkg.com/@aws-sdk/types/-/types-3.110.0.tgz#09404533b507925eadf9acf9c4356667048e45bd" integrity sha512-dLVoqODU3laaqNFPyN1QLtlQnwX4gNPMXptEBIt/iJpuZf66IYJe6WCzVZGt4Zfa1CnUmrlA428AzdcA/KCr2A== -"@aws-sdk/url-parser@3.55.0": - version "3.55.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/url-parser/-/url-parser-3.55.0.tgz#03b47a45c591d52c9d00dc40c630b91094991fe7" - integrity sha512-qrTwN5xIgTLreqLnZ+x3cAudjNKfxi6srW1H/px2mk4lb2U9B4fpGjZ6VU+XV8U2kR+YlT8J6Jo5iwuVGfC91A== +"@aws-sdk/url-parser@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/url-parser/-/url-parser-3.110.0.tgz#87d5c0a6f6d2f29027c747c65d8a2846302bc792" + integrity sha512-tILFB8/Q73yzgO0dErJNnELmmBszd0E6FucwAnG3hfDefjqCBe09Q/1yhu2aARXyRmZa4AKp0sWcdwIWHc8dnA== dependencies: - "@aws-sdk/querystring-parser" "3.55.0" - "@aws-sdk/types" "3.55.0" + "@aws-sdk/querystring-parser" "3.110.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" "@aws-sdk/util-arn-parser@3.55.0": @@ -848,10 +848,10 @@ dependencies: tslib "^2.3.1" -"@aws-sdk/util-base64-browser@3.58.0": - version "3.58.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-base64-browser/-/util-base64-browser-3.58.0.tgz#e213f91a5d40dd2d048d340f1ab192ca86c1f40c" - integrity sha512-0ebsXIZNpu/fup9OgsFPnRKfCFbuuI9PPRzvP6twzLxUB0c/aix6Co7LGHFKcRKHZdaykoJMXArf8eHj2Nzv1Q== +"@aws-sdk/util-base64-browser@3.109.0": + version "3.109.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/util-base64-browser/-/util-base64-browser-3.109.0.tgz#e7faf5c4cbb88bc39b9c1c5a1a79e4c869e9f645" + integrity sha512-lAZ6fyDGiRLaIsKT9qh7P9FGuNyZ4gAbr1YOSQk/5mHtaTuUvxlPptZuInNM/0MPQm6lpcot00D8IWTucn4PbA== dependencies: tslib "^2.3.1" @@ -885,48 +885,48 @@ "@aws-sdk/is-array-buffer" "3.55.0" tslib "^2.3.1" -"@aws-sdk/util-config-provider@3.55.0": - version "3.55.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-config-provider/-/util-config-provider-3.55.0.tgz#720c6c0ac1aa8d14be29d1dee25e01eb4925c0ce" - integrity sha512-30dzofQQfx6tp1jVZkZ0DGRsT0wwC15nEysKRiAcjncM64A0Cm6sra77d0os3vbKiKoPCI/lMsFr4o3533+qvQ== +"@aws-sdk/util-config-provider@3.109.0": + version "3.109.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/util-config-provider/-/util-config-provider-3.109.0.tgz#7828b8894b2b23c289ffc5c106cbced7a5d6ee86" + integrity sha512-GrAZl/aBv0A28LkyNyq8SPJ5fmViCwz80fWLMeWx/6q5AbivuILogjlWwEZSvZ9zrlHOcFC0+AnCa5pQrjaslw== dependencies: tslib "^2.3.1" -"@aws-sdk/util-defaults-mode-browser@3.72.0": - version "3.72.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-defaults-mode-browser/-/util-defaults-mode-browser-3.72.0.tgz#23ab8ab1c12ce6ca63c1416c76b6acdccd88c9fd" - integrity sha512-xeoh4jdq+tpZWDwGeXeoAQI+rZaCBEicjumBcqfzkRFE3DyaeyPHn3hiKGSR13R+P6Uf86aqaRNmWAeZZjeE0w== +"@aws-sdk/util-defaults-mode-browser@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/util-defaults-mode-browser/-/util-defaults-mode-browser-3.110.0.tgz#b72331874da2c5e8a366cd98828a06fe19b52ae5" + integrity sha512-Y2dcOOD20S3bv/IjUqpdKIiDt6995SXNG5Pu/LeSdXNyLCOIm9rX4gHTxl9fC1KK5M/gR9fGJ362f67WwqEEqw== dependencies: - "@aws-sdk/property-provider" "3.55.0" - "@aws-sdk/types" "3.55.0" + "@aws-sdk/property-provider" "3.110.0" + "@aws-sdk/types" "3.110.0" bowser "^2.11.0" tslib "^2.3.1" -"@aws-sdk/util-defaults-mode-node@3.72.0": - version "3.72.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-defaults-mode-node/-/util-defaults-mode-node-3.72.0.tgz#6690f98901b4564ea0cea9b2c379f41c1d247686" - integrity sha512-Qf4BZmjWTaWaWbIhra/il8zUAdYY6G4JIcg9WMzQgnh1L/iXpCZddInfB2zT4j5rSAuBf5Ov2T6zvtw3/KOh6Q== - dependencies: - "@aws-sdk/config-resolver" "3.58.0" - "@aws-sdk/credential-provider-imds" "3.58.0" - "@aws-sdk/node-config-provider" "3.58.0" - "@aws-sdk/property-provider" "3.55.0" - "@aws-sdk/types" "3.55.0" +"@aws-sdk/util-defaults-mode-node@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/util-defaults-mode-node/-/util-defaults-mode-node-3.110.0.tgz#52b4c84fc7aa06838ea6bb29d216a2d7615b9036" + integrity sha512-Cr3Z5nyrw1KowjbW76xp8hkT/zJtYjAVZ9PS4l84KxIicbVvDOBpxG3yNddkuQcavmlH6G4wH9uM5DcnpKDncg== + dependencies: + "@aws-sdk/config-resolver" "3.110.0" + "@aws-sdk/credential-provider-imds" "3.110.0" + "@aws-sdk/node-config-provider" "3.110.0" + "@aws-sdk/property-provider" "3.110.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/util-format-url@3.58.0": - version "3.58.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-format-url/-/util-format-url-3.58.0.tgz#eed1eebddf124ce05fd376d4416f825d892777be" - integrity sha512-nhxomsG+OIBqpIyc2AU88J3+dTap0H5R1D2lNAsSZk07kuu2B1H4qAXIlWPkXyxTi9uL9aykBMuCosECD062NA== +"@aws-sdk/util-format-url@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/util-format-url/-/util-format-url-3.110.0.tgz#518f43465607d762c8b5ebe69eabdcd9bb3b8a9a" + integrity sha512-NES/Kf92stj6bMl3WyaKFlA5yKbYlb357buoXKv51MnjcLL6NAgIWm0lMQv6UgzLVTxKdbw4BxErpSiKM+10Xg== dependencies: - "@aws-sdk/querystring-builder" "3.55.0" - "@aws-sdk/types" "3.55.0" + "@aws-sdk/querystring-builder" "3.110.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/util-hex-encoding@3.58.0": - version "3.58.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-hex-encoding/-/util-hex-encoding-3.58.0.tgz#d999eb19329933a94563881540a06d7ac7f515f5" - integrity sha512-Rl+jXUzk/FJkOLYfUVYPhKa2aUmTpeobRP31l8IatQltSzDgLyRHO35f6UEs7Ztn5s1jbu/POatLAZ2WjbgVyg== +"@aws-sdk/util-hex-encoding@3.109.0": + version "3.109.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/util-hex-encoding/-/util-hex-encoding-3.109.0.tgz#93b20acc27c0a1d7d80f653bf19d3dd01c2ccc65" + integrity sha512-s8CgTNrn3cLkrdiohfxLuOYPCanzvHn/aH5RW6DaMoeQiG5Hl9QUiP/WtdQ9QQx3xvpQFpmvxIaSBwSgFNLQxA== dependencies: tslib "^2.3.1" @@ -937,27 +937,27 @@ dependencies: tslib "^2.3.1" -"@aws-sdk/util-middleware@3.55.0": - version "3.55.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-middleware/-/util-middleware-3.55.0.tgz#22acf3ae45e3bbe9c1cc39d84e14aafb842fdcf0" - integrity sha512-82fW2XV+rUalv8lkd4VlhpPp6xnXO5n9sckMp1N+TrQ+p8eqxqT0+o8n1/6s9Qsnkw64Y3m6+EfCdc8/uFOY2g== +"@aws-sdk/util-middleware@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/util-middleware/-/util-middleware-3.110.0.tgz#00a727273974f54424954235867c1ddb0f6dad56" + integrity sha512-PTVWrI5fA9d5hHJs6RzX2dIS2jRQ3uW073Fm0BePpQeDdZrEk+S5KNwRhUtpN6sdSV45vm6S9rrjZUG51qwGmA== dependencies: tslib "^2.3.1" -"@aws-sdk/util-stream-browser@3.55.0": - version "3.55.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-stream-browser/-/util-stream-browser-3.55.0.tgz#2a85bcbbe1b0645580d7bdb2c2d8242ac25e5435" - integrity sha512-3f/zQsAqexJpKssCL0adTjG8WO+NPQ63E3TingyKpnCnHQPEnqPdya5I5OLGzZ0WR0iUWRtpuW0MtuDabyLDWw== +"@aws-sdk/util-stream-browser@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/util-stream-browser/-/util-stream-browser-3.110.0.tgz#2b39667008b447a95a6b2c1dceaf99dd3807c8b3" + integrity sha512-kAMrHtgrhr6ODRnzt/V+LSDVDvejcbdUp19n4My2vrPwKw3lM65vT+FAPIlGeDQBtOOhmlTbrYM3G3KKnlnHyg== dependencies: - "@aws-sdk/types" "3.55.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/util-stream-node@3.55.0": - version "3.55.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-stream-node/-/util-stream-node-3.55.0.tgz#2b8588d9a7f3c9fa582df706b01d0911b20f1b87" - integrity sha512-brCK3iENvXEL7BK5eDAdkZ2VuBSvXj7DH9EQezxl4Ntrj1lvb+McOk9WoU/o7yzE7A/bzEJEoNQAPi+VPNbb/w== +"@aws-sdk/util-stream-node@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/util-stream-node/-/util-stream-node-3.110.0.tgz#83089ff4c4b7dd6abaf6a489375cbd44765f4fb0" + integrity sha512-jgkO7aLRpE3EUqU5XUdo0FmlyBVCFHKyHd/jdEN8h9+XMa44rl2QMdOSFQtwaNI4NC8J+OC66u2dQ+8QQnOLig== dependencies: - "@aws-sdk/types" "3.55.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" "@aws-sdk/util-uri-escape@3.55.0": @@ -967,59 +967,52 @@ dependencies: tslib "^2.3.1" -"@aws-sdk/util-user-agent-browser@3.58.0": - version "3.58.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.58.0.tgz#3f46000a3d9c18d1bef6ae88682defa0c3863832" - integrity sha512-aJpqCvT09giJRg5xFTBDBRAVF0k0yq3OEf6UTuiOVf5azlL2MGp6PJ/xkJp9Z06PuQQkwBJ/2nIQZemo02a5Sw== +"@aws-sdk/util-user-agent-browser@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.110.0.tgz#e0643e6047aab5137540259a42fbfdc37ae4abee" + integrity sha512-rNdhmHDMV5dNJctqlBWimkZLJRB+x03DB+61pm+SKSFk6gPIVIvc1WNXqDFphkiswT4vA13ZUkGHzt+N4+noQQ== dependencies: - "@aws-sdk/types" "3.55.0" + "@aws-sdk/types" "3.110.0" bowser "^2.11.0" tslib "^2.3.1" -"@aws-sdk/util-user-agent-node@3.58.0": - version "3.58.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.58.0.tgz#ea821601b0d2c7d81239ad0de60964f3967f06ac" - integrity sha512-VlbY/nzWdN2pfLUHqKvnlGBQ6tEeV4jyK9ggAD2Szjj0bkYvaaKwpBKswQmuJpi5/J2v7Bo4ayBLnqDL7PgzLA== - dependencies: - "@aws-sdk/node-config-provider" "3.58.0" - "@aws-sdk/types" "3.55.0" - tslib "^2.3.1" - -"@aws-sdk/util-utf8-browser@3.55.0": - version "3.55.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-utf8-browser/-/util-utf8-browser-3.55.0.tgz#a045bf1a93f6e0ff9c846631b168ea55bbb37668" - integrity sha512-ljzqJcyjfJpEVSIAxwtIS8xMRUly84BdjlBXyp6cu4G8TUufgjNS31LWdhyGhgmW5vYBNr+LTz0Kwf6J+ou7Ug== +"@aws-sdk/util-user-agent-node@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.110.0.tgz#750abd6bb14f25a11e09d764f724b0d0e1c1248b" + integrity sha512-OQ915TPCCBwZWz5Np8zkNWn7U6KvrTZfFoCOy/VIemK3dUqmnBZ7HqGpuZx8SwJ2R9JE1x+j0niYSJ5fWJZZKA== dependencies: + "@aws-sdk/node-config-provider" "3.110.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/util-utf8-browser@^3.0.0": +"@aws-sdk/util-utf8-browser@3.109.0", "@aws-sdk/util-utf8-browser@^3.0.0": version "3.109.0" resolved "https://registry.yarnpkg.com/@aws-sdk/util-utf8-browser/-/util-utf8-browser-3.109.0.tgz#d013272e1981b23a4c84ac06f154db686c0cf84e" integrity sha512-FmcGSz0v7Bqpl1SE8G1Gc0CtDpug+rvqNCG/szn86JApD/f5x8oByjbEiAyTU2ZH2VevUntx6EW68ulHyH+x+w== dependencies: tslib "^2.3.1" -"@aws-sdk/util-utf8-node@3.55.0": - version "3.55.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-utf8-node/-/util-utf8-node-3.55.0.tgz#44cf9f9c8624d144afd65ab8a1786e33134add15" - integrity sha512-FsFm7GFaC7j0tlPEm/ri8bU2QCwFW5WKjxUg8lm1oWaxplCpKGUsmcfPJ4sw58GIoyoGu4QXBK60oCWosZYYdQ== +"@aws-sdk/util-utf8-node@3.109.0": + version "3.109.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/util-utf8-node/-/util-utf8-node-3.109.0.tgz#89e06d916f5b246c7265f59bac742973ac0767ac" + integrity sha512-Ti/ZBdvz2eSTElsucjzNmzpyg2MwfD1rXmxD0hZuIF8bPON/0+sZYnWd5CbDw9kgmhy28dmKue086tbZ1G0iLQ== dependencies: "@aws-sdk/util-buffer-from" "3.55.0" tslib "^2.3.1" -"@aws-sdk/util-waiter@3.55.0": - version "3.55.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-waiter/-/util-waiter-3.55.0.tgz#0e48a8ce98931f99cfbcad750222fd1f0b237fda" - integrity sha512-Do34MKPFSC/+zVN6vY+FZ+0WN61hzga4nPoAC590AOjs8rW6/H6sDN6Gz1KAZbPnuQUZfvsIJjMxN7lblXHJkQ== +"@aws-sdk/util-waiter@3.110.0": + version "3.110.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/util-waiter/-/util-waiter-3.110.0.tgz#fa1321024f4ffb270f4b09b703802b1730220f0e" + integrity sha512-8dE6W6XYfjk1gx/aeb8NeLfMMLkLFhlV1lmKpFSBJhY8msajU8aQahTuykq5JW8QT/wCGbqbu7dH35SdX7kO+A== dependencies: - "@aws-sdk/abort-controller" "3.55.0" - "@aws-sdk/types" "3.55.0" + "@aws-sdk/abort-controller" "3.110.0" + "@aws-sdk/types" "3.110.0" tslib "^2.3.1" -"@aws-sdk/xml-builder@3.55.0": - version "3.55.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/xml-builder/-/xml-builder-3.55.0.tgz#8e14012ab3ed27cf68964abf1326d06c686b3511" - integrity sha512-BH+i5S2FLprmfSeIuGy3UbNtEoJPVjh8arl5+LV3i2KY/+TmrS4yT8JtztDlDxHF0cMtNLZNO0KEPtsACS6SOg== +"@aws-sdk/xml-builder@3.109.0": + version "3.109.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/xml-builder/-/xml-builder-3.109.0.tgz#dd2d3bf59d29a1c2968f477ec16680d47d81d921" + integrity sha512-+aAXynnrqya1Eukz4Gxch4xIXCZolIMWGD4Ll/Q5yXT5uAjGh2HQWd9J0LWE+gYChpWetZbAVYZ3cEJ6F+SpZA== dependencies: tslib "^2.3.1" From ce34a5530d2c4c9623c3adbb8ece6f1d37c47d74 Mon Sep 17 00:00:00 2001 From: Yun Lai Date: Mon, 27 Jun 2022 17:55:25 +1000 Subject: [PATCH 208/240] fix(git): add symbolic link file support to prepareCommit (#16254) --- lib/util/git/index.spec.ts | 24 ++++++++++++++++++++++++ lib/util/git/index.ts | 10 +++++++--- lib/util/git/types.ts | 2 ++ 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/lib/util/git/index.spec.ts b/lib/util/git/index.spec.ts index d045a2c2e90356..47a3158e340a8c 100644 --- a/lib/util/git/index.spec.ts +++ b/lib/util/git/index.spec.ts @@ -373,6 +373,30 @@ describe('util/git/index', () => { expect(commit).not.toBeNull(); }); + it('link file', async () => { + const file: FileChange = { + type: 'addition', + path: 'future_link', + contents: 'past_file', + isSymlink: true, + }; + const commit = await git.commitFiles({ + branchName: 'renovate/future_branch', + files: [file], + message: 'Create a link', + }); + expect(commit).toBeString(); + const tmpGit = Git(tmpDir.path); + const lsTree = await tmpGit.raw(['ls-tree', commit!]); + const files = lsTree + .trim() + .split(newlineRegex) + .map((x) => x.split(/\s/)) + .map(([mode, type, _hash, name]) => [mode, type, name]); + expect(files).toContainEqual(['100644', 'blob', 'past_file']); + expect(files).toContainEqual(['120000', 'blob', 'future_link']); + }); + it('deletes file', async () => { const file: FileChange = { type: 'deletion', diff --git a/lib/util/git/index.ts b/lib/util/git/index.ts index 783b00fa45df7f..a163b14d061801 100644 --- a/lib/util/git/index.ts +++ b/lib/util/git/index.ts @@ -862,9 +862,13 @@ export async function prepareCommit({ } // some file systems including Windows don't support the mode // so the index should be manually updated after adding the file - await fs.outputFile(upath.join(localDir, fileName), contents, { - mode: file.isExecutable ? 0o777 : 0o666, - }); + if (file.isSymlink) { + await fs.symlink(file.contents, upath.join(localDir, fileName)); + } else { + await fs.outputFile(upath.join(localDir, fileName), contents, { + mode: file.isExecutable ? 0o777 : 0o666, + }); + } } try { // istanbul ignore next diff --git a/lib/util/git/types.ts b/lib/util/git/types.ts index 0c124e67268993..f97d002d1d176b 100644 --- a/lib/util/git/types.ts +++ b/lib/util/git/types.ts @@ -52,6 +52,8 @@ export interface FileAddition { * The executable bit */ isExecutable?: boolean; + + isSymlink?: boolean; } export interface FileDeletion { From 6dfbd2f5ce88810110579bc5b0aabfd22e0d856f Mon Sep 17 00:00:00 2001 From: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Date: Mon, 27 Jun 2022 10:32:01 +0200 Subject: [PATCH 209/240] docs(automerge): add `platformAutomerge` section (#16264) --- docs/usage/key-concepts/automerge.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/usage/key-concepts/automerge.md b/docs/usage/key-concepts/automerge.md index 22160cd4fe97d5..3929074f0fce45 100644 --- a/docs/usage/key-concepts/automerge.md +++ b/docs/usage/key-concepts/automerge.md @@ -82,6 +82,27 @@ Non-major updates in SemVer ecosystems shouldn't have breaking changes (if they The `matchCurrentVersion` setting above is a rule to exclude any dependencies which are pre-1.0.0 because those can make breaking changes at _any_ time according to the SemVer spec. +### Faster merges with platform-native automerge + +You can speed up merges by letting Renovate use your platform's native automerge. +The config option is called `platformAutomerge`. +If `automerge=true` and `automergeType=pr` then you can set `platformAutomerge=true`. + +For example: + +```json +{ + "lockFileMaintenance": { + "enabled": true, + "automerge": true, + "automergeType": "pr", + "platformAutomerge": true + } +} +``` + +For more information read [`platformAutomerge`](https://docs.renovatebot.com/configuration-options/#platformautomerge). + ## Automerging and scheduling Automerging is particularly beneficial if you have configured a schedule, because Renovate on its own may be able to automerge the majority of your updates. From 4fc31b1d7ad678d6f4c2c5f3a99115dc310b7a97 Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Mon, 27 Jun 2022 11:50:57 +0300 Subject: [PATCH 210/240] fix(helm): Revert previous datasource changes (#16265) --- .../datasource/helm/__fixtures__/index.yaml | 70 ------------------- .../datasource/helm/__fixtures__/sample.yaml | 17 ----- lib/modules/datasource/helm/common.spec.ts | 12 ++-- lib/modules/datasource/helm/common.ts | 47 ++++--------- lib/modules/datasource/helm/index.spec.ts | 18 ----- lib/modules/datasource/helm/index.ts | 12 +--- 6 files changed, 20 insertions(+), 156 deletions(-) diff --git a/lib/modules/datasource/helm/__fixtures__/index.yaml b/lib/modules/datasource/helm/__fixtures__/index.yaml index 6f8c60e89091cc..870b7b419e4b23 100644 --- a/lib/modules/datasource/helm/__fixtures__/index.yaml +++ b/lib/modules/datasource/helm/__fixtures__/index.yaml @@ -1872,73 +1872,3 @@ entries: urls: - https://charts.helm.sh/stable/packages/ambassador-1.0.0.tgz version: 1.0.0 - cluster-autoscaler: - - apiVersion: v2 - appVersion: 1.21.1 - created: "2021-12-14T18:07:21.619018562Z" - description: Scales Kubernetes worker nodes within autoscaling groups. - digest: 5685825bce34653919c9d23ca833b99f2ba359aad6dc89afacdf32208c4d0e16 - home: https://www.autoscaler.io/9.10.9 - icon: https://github.com/kubernetes/kubernetes/raw/master/logo/logo.png - maintainers: - - email: e.bailey@sportradar.com - name: yurrriq - - email: mgoodness@gmail.com - name: mgoodness - - email: guyjtempleton@googlemail.com - name: gjtempleton - - email: scott.crooks@gmail.com - name: sc250024 - name: cluster-autoscaler - sources: - - https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler#9.10.9 - type: application - urls: - - cluster-autoscaler-9.10.9.tgz - version: 9.10.9 - - apiVersion: v2 - appVersion: 1.21.1 - created: "2021-12-22T11:20:10.489588334Z" - description: Scales Kubernetes worker nodes within autoscaling groups. - digest: 0da701c485890b77ec45853aa3b5ad8644ff7c71d6cd2d5ee65ee54d118ca99b - home: https://www.autoscaler.io/9.11.0 - icon: https://github.com/kubernetes/kubernetes/raw/master/logo/logo.png - maintainers: - - email: e.bailey@sportradar.com - name: yurrriq - - email: mgoodness@gmail.com - name: mgoodness - - email: guyjtempleton@googlemail.com - name: gjtempleton - - email: scott.crooks@gmail.com - name: sc250024 - name: cluster-autoscaler - sources: - - https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler#9.11.0 - type: application - urls: - - cluster-autoscaler-9.11.0.tgz - version: 9.11.0 - - apiVersion: v2 - appVersion: 1.21.1 - created: "2021-11-01T22:54:28.760738726Z" - description: Scales Kubernetes worker nodes within autoscaling groups. - digest: 446efc118d134bb3dbc2d30ff10a07bbcaa33726bdabc60ebf2a5fd8b1871392 - home: https://www.autoscaler.io/9.10.8 - icon: https://github.com/kubernetes/kubernetes/raw/master/logo/logo.png - maintainers: - - email: e.bailey@sportradar.com - name: yurrriq - - email: mgoodness@gmail.com - name: mgoodness - - email: guyjtempleton@googlemail.com - name: gjtempleton - - email: scott.crooks@gmail.com - name: sc250024 - name: cluster-autoscaler - sources: - - https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler#9.10.8 - type: application - urls: - - cluster-autoscaler-9.10.8.tgz - version: 9.10.8 diff --git a/lib/modules/datasource/helm/__fixtures__/sample.yaml b/lib/modules/datasource/helm/__fixtures__/sample.yaml index 9e2afe89d98762..9e3c6d97bb1041 100644 --- a/lib/modules/datasource/helm/__fixtures__/sample.yaml +++ b/lib/modules/datasource/helm/__fixtures__/sample.yaml @@ -93,20 +93,3 @@ entries: - home: urls: - some.tgz - dummy-no-home: - - description: dummy chart without home metadata - name: dummy-no-home - sources: - - https://github.com/dummyorg/dummymonorepo/tree/main/charts/dummy-no-home - version: 0.0.42 - urls: - - some.tgz - dummy-no-chart-repo: - - description: dummy chart without a valid chart repo URL - name: dummy-no-chart-repo - home: https://github.com/dummyorg/dummymonorepo/tree/main/charts/dummy-no-chart-repo - sources: - - https://some.test - version: 0.0.42 - urls: - - some.tgz diff --git a/lib/modules/datasource/helm/common.spec.ts b/lib/modules/datasource/helm/common.spec.ts index d0f33613d65134..48d4d0906d23a6 100644 --- a/lib/modules/datasource/helm/common.spec.ts +++ b/lib/modules/datasource/helm/common.spec.ts @@ -11,13 +11,11 @@ const repo = load(loadFixture('sample.yaml'), { describe('modules/datasource/helm/common', () => { describe('findSourceUrl', () => { test.each` - input | output - ${'airflow'} | ${{ sourceUrl: 'https://github.com/bitnami/charts', sourceDirectory: 'bitnami/airflow' }} - ${'coredns'} | ${{ sourceUrl: 'https://github.com/coredns/helm', sourceDirectory: undefined }} - ${'pgadmin4'} | ${{ sourceUrl: 'https://github.com/rowanruseler/helm-charts', sourceDirectory: undefined }} - ${'dummy-no-home'} | ${{ sourceUrl: 'https://github.com/dummyorg/dummymonorepo', sourceDirectory: 'charts/dummy-no-home' }} - ${'dummy-no-chart-repo'} | ${{ sourceUrl: 'https://github.com/dummyorg/dummymonorepo', sourceDirectory: 'charts/dummy-no-chart-repo' }} - ${'dummy'} | ${{}} + input | output + ${'airflow'} | ${{ sourceUrl: 'https://github.com/bitnami/charts', sourceDirectory: 'bitnami/airflow' }} + ${'coredns'} | ${{ sourceUrl: 'https://github.com/coredns/helm', sourceDirectory: undefined }} + ${'pgadmin4'} | ${{ sourceUrl: 'https://github.com/rowanruseler/helm-charts', sourceDirectory: undefined }} + ${'dummy'} | ${{}} `( '$input -> $output', ({ input, output }: { input: string; output: string }) => { diff --git a/lib/modules/datasource/helm/common.ts b/lib/modules/datasource/helm/common.ts index 0a82fd9988693d..4dfc00984b2648 100644 --- a/lib/modules/datasource/helm/common.ts +++ b/lib/modules/datasource/helm/common.ts @@ -16,11 +16,13 @@ export function findSourceUrl(release: HelmRelease): RepoSource { return { sourceUrl: releaseMatch[1] }; } - const homeMatchGroups = release.home && githubUrl.exec(release.home)?.groups; - if (homeMatchGroups) { - const { url: sourceUrl, path: sourceDirectory, repo } = homeMatchGroups; - if (chartRepo.test(repo)) { - return { sourceUrl, sourceDirectory }; + if (release.home) { + const githubUrlMatch = githubUrl.exec(release.home); + if (githubUrlMatch?.groups && chartRepo.test(githubUrlMatch?.groups.repo)) { + return { + sourceUrl: githubUrlMatch.groups.url, + sourceDirectory: githubUrlMatch.groups.path, + }; } } @@ -29,36 +31,15 @@ export function findSourceUrl(release: HelmRelease): RepoSource { } for (const url of release.sources) { - const githubUrlMatchGroups = githubUrl.exec(url)?.groups; - if (githubUrlMatchGroups) { - const { - url: sourceUrl, - path: sourceDirectory, - repo, - } = githubUrlMatchGroups; - if (chartRepo.test(repo)) { - return { sourceUrl, sourceDirectory }; - } - } - } - - // fallback: if neither home nor sources are a chart repo URL, use githubUrl (if present) - if (homeMatchGroups) { - const { url: sourceUrl, path: sourceDirectory } = homeMatchGroups; - if (sourceUrl && sourceDirectory) { - return { sourceUrl, sourceDirectory }; - } - } - - for (const source of release.sources) { - const firstSourceMatch = githubUrl.exec(source)?.groups; - if (firstSourceMatch) { - const { url: sourceUrl, path: sourceDirectory } = firstSourceMatch; - if (sourceUrl && sourceDirectory) { - return { sourceUrl, sourceDirectory }; - } + const githubUrlMatch = githubUrl.exec(url); + if (githubUrlMatch?.groups && chartRepo.test(githubUrlMatch?.groups.repo)) { + return { + sourceUrl: githubUrlMatch.groups.url, + sourceDirectory: githubUrlMatch.groups.path, + }; } } + // fallback return { sourceUrl: release.sources[0] }; } diff --git a/lib/modules/datasource/helm/index.spec.ts b/lib/modules/datasource/helm/index.spec.ts index 3d03c3b992bef8..54ea10e1198a18 100644 --- a/lib/modules/datasource/helm/index.spec.ts +++ b/lib/modules/datasource/helm/index.spec.ts @@ -189,23 +189,5 @@ describe('modules/datasource/helm/index', () => { releases: expect.toBeArrayOfSize(27), }); }); - - it('returns home and source metadata of the most recent version', async () => { - httpMock - .scope('https://example-repository.com') - .get('/index.yaml') - .reply(200, indexYaml); - const releases = await getPkgReleases({ - datasource: HelmDatasource.id, - depName: 'cluster-autoscaler', - registryUrls: ['https://example-repository.com'], - }); - expect(releases).not.toBeNull(); - expect(releases).toMatchObject({ - homepage: 'https://www.autoscaler.io/9.11.0', - sourceDirectory: 'cluster-autoscaler#9.11.0', - sourceUrl: 'https://github.com/kubernetes/autoscaler', - }); - }); }); }); diff --git a/lib/modules/datasource/helm/index.ts b/lib/modules/datasource/helm/index.ts index 590c7a9b24284a..10d0ccc9349372 100644 --- a/lib/modules/datasource/helm/index.ts +++ b/lib/modules/datasource/helm/index.ts @@ -63,17 +63,7 @@ export class HelmDatasource extends Datasource { } const result: HelmRepositoryData = {}; for (const [name, releases] of Object.entries(doc.entries)) { - let latestRelease = releases[releases.length - 1]; - const sortedReleases = releases - .filter(({ version }) => helmVersioning.api.isValid(version)) - .sort((r0, r1) => - helmVersioning.api.sortVersions(r0.version, r1.version) - ); - const latestSortedRelease = sortedReleases[sortedReleases.length - 1]; - if (latestSortedRelease) { - latestRelease = latestSortedRelease; - } - + const latestRelease = releases[releases.length - 1]; const { sourceUrl, sourceDirectory } = findSourceUrl(latestRelease); result[name] = { homepage: latestRelease.home, From 989c5c38b1b0c876f629361f2cebfb1f2b0f69b8 Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Mon, 27 Jun 2022 11:45:20 +0200 Subject: [PATCH 211/240] fix: pass config to post-upgrade config templating (#16267) --- .../repository/update/branch/execute-post-upgrade-commands.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/workers/repository/update/branch/execute-post-upgrade-commands.ts b/lib/workers/repository/update/branch/execute-post-upgrade-commands.ts index d7d7e0e4ddd013..fb2c6bcda085ab 100644 --- a/lib/workers/repository/update/branch/execute-post-upgrade-commands.ts +++ b/lib/workers/repository/update/branch/execute-post-upgrade-commands.ts @@ -1,6 +1,7 @@ // TODO #7154 import is from '@sindresorhus/is'; import minimatch from 'minimatch'; +import { mergeChildConfig } from '../../../../config'; import { GlobalConfig } from '../../../../config/global'; import { addMeta, logger } from '../../../../logger'; import type { ArtifactError } from '../../../../modules/manager/types'; @@ -66,7 +67,7 @@ export async function postUpgradeCommandsExecutor( ) { try { const compiledCmd = allowPostUpgradeCommandTemplating - ? compile(cmd, upgrade) + ? compile(cmd, mergeChildConfig(config, upgrade)) : cmd; logger.debug({ cmd: compiledCmd }, 'Executing post-upgrade task'); From a1344d86ac0afaaf482654429edfea78d4a83b84 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 27 Jun 2022 19:39:43 +0000 Subject: [PATCH 212/240] build(deps): update dependency xmldoc to v1.1.3 (#16289) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index ea1518614a0637..e36afa4fb70214 100644 --- a/package.json +++ b/package.json @@ -211,7 +211,7 @@ "upath": "2.0.1", "url-join": "4.0.1", "validate-npm-package-name": "4.0.0", - "xmldoc": "1.1.2" + "xmldoc": "1.1.3" }, "optionalDependencies": { "re2": "1.17.7" diff --git a/yarn.lock b/yarn.lock index 66a4e1fe70b9ad..40559af52ddbb0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8374,7 +8374,7 @@ safe-json-stringify@~1: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -sax@^1.2.1: +sax@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== @@ -9521,12 +9521,12 @@ xml@^1.0.1: resolved "https://registry.yarnpkg.com/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5" integrity sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw== -xmldoc@1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/xmldoc/-/xmldoc-1.1.2.tgz#6666e029fe25470d599cd30e23ff0d1ed50466d7" - integrity sha512-ruPC/fyPNck2BD1dpz0AZZyrEwMOrWTO5lDdIXS91rs3wtm4j+T8Rp2o+zoOYkkAxJTZRPOSnOGei1egoRmKMQ== +xmldoc@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/xmldoc/-/xmldoc-1.1.3.tgz#1a4f0fd4e7fe1567e6660cea9cadf991df5bb312" + integrity sha512-xLbV1OMj8ysWK5Z4xt+qGUm0J/A5hRpXisZGYeOvFElqgMzDVqy8Ma2VoV+6QIDVb9UmdpABVhPL/04VnmBcXQ== dependencies: - sax "^1.2.1" + sax "^1.2.4" xtend@~4.0.1: version "4.0.2" From 787c98cdbee7bed96c79c5f2084c722c236b4079 Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Mon, 27 Jun 2022 21:46:00 +0200 Subject: [PATCH 213/240] fix: Revert "fix: commit message" (#16263) Revert "fix: commit message (#16239)" This reverts commit 3b0c2afe8a373b93b810186ac2c021dc5a0342df. --- .../repository/model/commit-message.ts | 4 -- .../model/semantic-commit-message.spec.ts | 9 ---- .../repository/updates/generate.spec.ts | 34 +----------- lib/workers/repository/updates/generate.ts | 53 +++++++++++-------- 4 files changed, 32 insertions(+), 68 deletions(-) diff --git a/lib/workers/repository/model/commit-message.ts b/lib/workers/repository/model/commit-message.ts index b909f5bc1d837d..0344e5b6471fc0 100644 --- a/lib/workers/repository/model/commit-message.ts +++ b/lib/workers/repository/model/commit-message.ts @@ -60,10 +60,6 @@ export abstract class CommitMessage { this._footer = this.normalizeInput(value); } - get subject(): string { - return this._subject; - } - set subject(value: string) { this._subject = this.normalizeInput(value); this._subject = this._subject?.replace( diff --git a/lib/workers/repository/model/semantic-commit-message.spec.ts b/lib/workers/repository/model/semantic-commit-message.spec.ts index e2629fcc02edd3..ffff30f3258f54 100644 --- a/lib/workers/repository/model/semantic-commit-message.spec.ts +++ b/lib/workers/repository/model/semantic-commit-message.spec.ts @@ -25,15 +25,6 @@ describe('workers/repository/model/semantic-commit-message', () => { expect(message.toString()).toBe('fix(scope): test'); }); - it('should transform to lowercase only first letter', () => { - const message = new SemanticCommitMessage(); - message.subject = 'Update My Org dependencies'; - message.type = 'fix'; - message.scope = 'deps '; - - expect(message.toString()).toBe('fix(deps): update My Org dependencies'); - }); - it('should create instance from string without scope', () => { const instance = SemanticCommitMessage.fromString('feat: ticket 123'); diff --git a/lib/workers/repository/updates/generate.spec.ts b/lib/workers/repository/updates/generate.spec.ts index 87d7c55786962a..a6fa8195bf381b 100644 --- a/lib/workers/repository/updates/generate.spec.ts +++ b/lib/workers/repository/updates/generate.spec.ts @@ -506,7 +506,7 @@ describe('workers/repository/updates/generate', () => { } as BranchUpgradeConfig, ]; const res = generateBranchConfig(branch); - expect(res.prTitle).toBe('chore: update dependency some-dep to v1.2.0'); + expect(res.prTitle).toBe('chore(): update dependency some-dep to v1.2.0'); }); it('scopes monorepo commits with nested package files using parent directory', () => { @@ -915,37 +915,5 @@ describe('workers/repository/updates/generate', () => { '`1.1.1` (+1)', ]); }); - - it('fixes commit message with body', () => { - const branch: BranchUpgradeConfig[] = [ - { - manager: 'some-manager', - branchName: 'some-branch', - commitMessage: 'update to vv1.2.0', - commitBody: 'some body', - }, - ]; - const res = generateBranchConfig(branch); - expect(res.commitMessage).toBe('Update to v1.2.0\n\nsome body'); - }); - - it('generates semantic commit message properly', () => { - const branch: BranchUpgradeConfig[] = [ - { - ...defaultConfig, - manager: 'some-manager', - branchName: 'some-branch', - semanticCommits: 'enabled', - semanticCommitType: 'chore', - semanticCommitScope: 'deps', - depName: 'some-dep', - newValue: '1.2.0', - } as BranchUpgradeConfig, - ]; - const res = generateBranchConfig(branch); - expect(res.commitMessage).toBe( - 'chore(deps): update dependency some-dep to 1.2.0' - ); - }); }); }); diff --git a/lib/workers/repository/updates/generate.ts b/lib/workers/repository/updates/generate.ts index 2f6c7c2826e609..04af7f203a1bee 100644 --- a/lib/workers/repository/updates/generate.ts +++ b/lib/workers/repository/updates/generate.ts @@ -6,12 +6,11 @@ import semver from 'semver'; import { mergeChildConfig } from '../../../config'; import { CONFIG_SECRETS_EXPOSED } from '../../../constants/error-messages'; import { logger } from '../../../logger'; -import { regEx } from '../../../util/regex'; +import { newlineRegex, regEx } from '../../../util/regex'; import { sanitize } from '../../../util/sanitize'; import * as template from '../../../util/template'; import type { BranchConfig, BranchUpgradeConfig } from '../../types'; -import { CommitMessageFactory } from '../model/commit-message-factory'; -import { SemanticCommitMessage } from '../model/semantic-commit-message'; +import { CommitMessage } from '../model/commit-message'; function isTypesGroup(branchUpgrades: BranchUpgradeConfig[]): boolean { return ( @@ -168,27 +167,28 @@ export function generateBranchConfig( } else if (semver.valid(toVersions[0])) { upgrade.isRange = false; } - const commitMessageFactory = new CommitMessageFactory(upgrade); - const commitMessage = commitMessageFactory.create(); // Use templates to generate strings - if ( - SemanticCommitMessage.is(commitMessage) && - upgrade.semanticCommitScope - ) { + if (upgrade.semanticCommits === 'enabled' && !upgrade.commitMessagePrefix) { logger.trace('Upgrade has semantic commits enabled'); - commitMessage.scope = template.compile( - upgrade.semanticCommitScope, - upgrade - ); + let semanticPrefix = upgrade.semanticCommitType; + if (upgrade.semanticCommitScope) { + semanticPrefix += `(${template.compile( + upgrade.semanticCommitScope, + upgrade + )})`; + } + upgrade.commitMessagePrefix = CommitMessage.formatPrefix(semanticPrefix!); + upgrade.toLowerCase = + regEx(/[A-Z]/).exec(upgrade.semanticCommitType!) === null && + !upgrade.semanticCommitType!.startsWith(':'); } // Compile a few times in case there are nested templates - commitMessage.subject = template.compile( + upgrade.commitMessage = template.compile( upgrade.commitMessage ?? '', upgrade ); - commitMessage.subject = template.compile(commitMessage.subject, upgrade); - commitMessage.subject = template.compile(commitMessage.subject, upgrade); - upgrade.commitMessage = commitMessage.toString(); + upgrade.commitMessage = template.compile(upgrade.commitMessage, upgrade); + upgrade.commitMessage = template.compile(upgrade.commitMessage, upgrade); // istanbul ignore if if (upgrade.commitMessage !== sanitize(upgrade.commitMessage)) { logger.debug( @@ -197,14 +197,23 @@ export function generateBranchConfig( ); throw new Error(CONFIG_SECRETS_EXPOSED); } - commitMessage.subject = commitMessage.subject.replace( + upgrade.commitMessage = upgrade.commitMessage.trim(); // Trim exterior whitespace + upgrade.commitMessage = upgrade.commitMessage.replace(regEx(/\s+/g), ' '); // Trim extra whitespace inside string + upgrade.commitMessage = upgrade.commitMessage.replace( regEx(/to vv(\d)/), 'to v$1' ); - upgrade.commitMessage = commitMessage.toString(); + if (upgrade.toLowerCase) { + // We only need to lowercase the first line + const splitMessage = upgrade.commitMessage.split(newlineRegex); + splitMessage[0] = splitMessage[0].toLowerCase(); + upgrade.commitMessage = splitMessage.join('\n'); + } if (upgrade.commitBody) { - commitMessage.body = template.compile(upgrade.commitBody, upgrade); - upgrade.commitMessage = commitMessage.toString(); + upgrade.commitMessage = `${upgrade.commitMessage}\n\n${template.compile( + upgrade.commitBody, + upgrade + )}`; } logger.trace(`commitMessage: ` + JSON.stringify(upgrade.commitMessage)); if (upgrade.prTitle) { @@ -226,7 +235,7 @@ export function generateBranchConfig( upgrade.prTitle = upgrade.prTitle.toLowerCase(); } } else { - upgrade.prTitle = commitMessage.title; + [upgrade.prTitle] = upgrade.commitMessage.split(newlineRegex); } upgrade.prTitle += upgrade.hasBaseBranches ? ' ({{baseBranch}})' : ''; if (upgrade.isGroup) { From fa18c74f94da4540f04b667537448f1394b85e30 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Mon, 27 Jun 2022 22:23:24 +0200 Subject: [PATCH 214/240] test(e2e): use yarn to pack (#16291) --- .gitignore | 1 + package.json | 2 +- test/e2e/package.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index d84df371ce5d1d..17a0e6112fadf4 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ /package-lock.json *.pyc renovate-0.0.0-semantic-release.tgz +renovate-v0.0.0-semantic-release.tgz /test/e2e/node_modules .eslintcache junit.xml diff --git a/package.json b/package.json index e36afa4fb70214..f55a51e430c148 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "start": "node -r ts-node/register/transpile-only -- lib/renovate.ts", "test": "run-s lint test-schema type-check strict-check jest", "test-dirty": "git diff --exit-code", - "test-e2e": "npm pack && cd test/e2e && yarn install --no-lockfile --ignore-optional --prod && yarn test", + "test-e2e": "yarn pack && cd test/e2e && yarn install --no-lockfile --ignore-optional --prod && yarn test", "test-schema": "run-s create-json-schema", "tsc": "tsc", "type-check": "run-s generate:* \"tsc --noEmit {@}\" --", diff --git a/test/e2e/package.json b/test/e2e/package.json index 190a42bf4d6bec..175ebfbe239b46 100644 --- a/test/e2e/package.json +++ b/test/e2e/package.json @@ -6,7 +6,7 @@ "test": "renovate --version && renovate-config-validator" }, "dependencies": { - "renovate": "file:../../renovate-0.0.0-semantic-release.tgz" + "renovate": "file:../../renovate-v0.0.0-semantic-release.tgz" }, "renovate-config": { "default": { From 96a71ec4beb246393436488296558f5ee2343091 Mon Sep 17 00:00:00 2001 From: Maron <98313426+MaronHatoum@users.noreply.github.com> Date: Mon, 27 Jun 2022 23:35:40 +0300 Subject: [PATCH 215/240] refactor(lib/workers): separate get dep warning func into two diff functions (#16165) --- .../repository/errors-warnings.spec.ts | 27 ++++- lib/workers/repository/errors-warnings.ts | 101 +++++++++--------- lib/workers/repository/onboarding/pr/index.ts | 8 +- lib/workers/types.ts | 5 + 4 files changed, 85 insertions(+), 56 deletions(-) diff --git a/lib/workers/repository/errors-warnings.spec.ts b/lib/workers/repository/errors-warnings.spec.ts index 6442bb84775025..7398e09f3e09c5 100644 --- a/lib/workers/repository/errors-warnings.spec.ts +++ b/lib/workers/repository/errors-warnings.spec.ts @@ -1,6 +1,6 @@ import { RenovateConfig, getConfig } from '../../../test/util'; import type { PackageFile } from '../../modules/manager/types'; -import { getDepWarnings, getErrors, getWarnings } from './errors-warnings'; +import { getDepWarningsPR, getErrors, getWarnings } from './errors-warnings'; describe('workers/repository/errors-warnings', () => { describe('getWarnings()', () => { @@ -31,14 +31,20 @@ describe('workers/repository/errors-warnings', () => { " `); }); + + it('getWarning returns empty string', () => { + config.warnings = []; + const res = getWarnings(config); + expect(res).toBe(''); + }); }); - describe('getDepWarnings()', () => { + describe('getDepWarningsPR()', () => { beforeEach(() => { jest.resetAllMocks(); }); - it('returns warning text', () => { + it('returns pr warning text', () => { const packageFiles: Record = { npm: [ { @@ -70,7 +76,8 @@ describe('workers/repository/errors-warnings', () => { }, ], }; - const res = getDepWarnings(packageFiles); + + const res = getDepWarningsPR(packageFiles); expect(res).toMatchInlineSnapshot(` " --- @@ -87,6 +94,12 @@ describe('workers/repository/errors-warnings', () => { " `); }); + + it('PR warning returns empty string', () => { + const packageFiles: Record = {}; + const res = getDepWarningsPR(packageFiles); + expect(res).toBe(''); + }); }); describe('getErrors()', () => { @@ -117,5 +130,11 @@ describe('workers/repository/errors-warnings', () => { " `); }); + + it('getError returns empty string', () => { + config.errors = []; + const res = getErrors(config); + expect(res).toBe(''); + }); }); }); diff --git a/lib/workers/repository/errors-warnings.ts b/lib/workers/repository/errors-warnings.ts index 0c2fb0ed6aea09..ecd0099c16aeb8 100644 --- a/lib/workers/repository/errors-warnings.ts +++ b/lib/workers/repository/errors-warnings.ts @@ -3,81 +3,82 @@ import type { RenovateConfig } from '../../config/types'; import { logger } from '../../logger'; import type { PackageFile } from '../../modules/manager/types'; import { emojify } from '../../util/emoji'; +import type { DepWarnings } from '../types'; export function getWarnings(config: RenovateConfig): string { - const warnings = config.warnings!; - if (!warnings.length) { + if (!config.warnings?.length) { return ''; } - let warningText = `\n# Warnings (${warnings.length})\n\n`; + let warningText = `\n# Warnings (${config.warnings.length})\n\n`; warningText += `Please correct - or verify that you can safely ignore - these warnings before you merge this PR.\n\n`; - warnings.forEach((w) => { + for (const w of config.warnings) { warningText += `- \`${w.topic}\`: ${w.message}\n`; - }); + } warningText += '\n---\n'; return warningText; } export function getErrors(config: RenovateConfig): string { - let errorText = ''; - const errors = config.errors!; - if (!errors.length) { + if (!config.errors?.length) { return ''; } - errorText = `\n# Errors (${errors.length})\n\n`; + let errorText = `\n# Errors (${config.errors.length})\n\n`; errorText += `Renovate has found errors that you should fix (in this branch) before finishing this PR.\n\n`; - errors.forEach((e) => { + for (const e of config.errors) { errorText += `- \`${e.topic}\`: ${e.message}\n`; - }); + } errorText += '\n---\n'; return errorText; } -export function getDepWarnings( +function getDepWarnings( packageFiles: Record -): string { - let warningText = ''; - try { - const warnings: string[] = []; - const warningFiles: string[] = []; - for (const files of Object.values(packageFiles || {})) { - for (const file of files || []) { - if (file.deps) { - for (const dep of file.deps || []) { - if (dep.warnings?.length) { - const message = dep.warnings[0].message; - if (!warnings.includes(message)) { - warnings.push(message); - } - if (!warningFiles.includes(file.packageFile!)) { - warningFiles.push(file.packageFile!); - } +): DepWarnings { + const warnings: string[] = []; + const warningFiles: string[] = []; + for (const files of Object.values(packageFiles ?? {})) { + for (const file of files ?? []) { + // TODO: remove condition when type is fixed (#7154) + if (file.packageFile) { + for (const dep of file.deps ?? []) { + for (const w of dep.warnings ?? []) { + const message = w.message; + if (!warnings.includes(message)) { + warnings.push(message); + } + if (!warningFiles.includes(file.packageFile)) { + warningFiles.push(file.packageFile); } } } } } - if (!warnings.length) { - return ''; - } - logger.debug( - { warnings, warningFiles }, - 'Found package lookup warnings in onboarding' - ); - warningText = emojify( - `\n---\n\n### :warning: Dependency Lookup Warnings :warning:\n\n` - ); - warningText += `Please correct - or verify that you can safely ignore - these lookup failures before you merge this PR.\n\n`; - warnings.forEach((w) => { - warningText += `- \`${w}\`\n`; - }); - warningText += - '\nFiles affected: ' + - warningFiles.map((f) => '`' + f + '`').join(', ') + - '\n\n'; - } catch (err) { - // istanbul ignore next - logger.error({ err }, 'Error generating dep warnings text'); } + return { warnings, warningFiles }; +} + +export function getDepWarningsPR( + packageFiles: Record +): string { + const { warnings, warningFiles } = getDepWarnings(packageFiles); + let warningText = ''; + if (!warnings.length) { + return ''; + } + logger.debug( + { warnings, warningFiles }, + 'Found package lookup warnings in onboarding' + ); + warningText = emojify( + `\n---\n\n### :warning: Dependency Lookup Warnings :warning:\n\n` + ); + warningText += `Please correct - or verify that you can safely ignore - these lookup failures before you merge this PR.\n\n`; + for (const w of warnings) { + warningText += `- \`${w}\`\n`; + } + warningText += + '\nFiles affected: ' + + warningFiles.map((f) => '`' + f + '`').join(', ') + + '\n\n'; return warningText; } diff --git a/lib/workers/repository/onboarding/pr/index.ts b/lib/workers/repository/onboarding/pr/index.ts index d16fb2ab21b042..8d986dc25471da 100644 --- a/lib/workers/repository/onboarding/pr/index.ts +++ b/lib/workers/repository/onboarding/pr/index.ts @@ -13,7 +13,11 @@ import { } from '../../../../util/git'; import * as template from '../../../../util/template'; import type { BranchConfig } from '../../../types'; -import { getDepWarnings, getErrors, getWarnings } from '../../errors-warnings'; +import { + getDepWarningsPR, + getErrors, + getWarnings, +} from '../../errors-warnings'; import { getPlatformPrOptions } from '../../update/pr'; import { prepareLabels } from '../../update/pr/labels'; import { addParticipants } from '../../update/pr/participants'; @@ -109,7 +113,7 @@ If you need any further assistance then you can also [request help here](${ prBody = prBody.replace('{{CONFIG}}\n', configDesc); prBody = prBody.replace( '{{WARNINGS}}\n', - getWarnings(config) + getDepWarnings(packageFiles!) + getWarnings(config) + getDepWarningsPR(packageFiles!) ); prBody = prBody.replace('{{ERRORS}}\n', getErrors(config)); prBody = prBody.replace('{{BASEBRANCH}}\n', getBaseBranchDesc(config)); diff --git a/lib/workers/types.ts b/lib/workers/types.ts index 1ad103efc03379..b8a8222e502062 100644 --- a/lib/workers/types.ts +++ b/lib/workers/types.ts @@ -140,3 +140,8 @@ export interface WorkerExtractConfig enabledManagers?: string[]; enabled?: boolean; } + +export interface DepWarnings { + warnings: string[]; + warningFiles: string[]; +} From 3aabd882f371f24f50396c822c35bb3ce853d59b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 27 Jun 2022 23:41:03 +0000 Subject: [PATCH 216/240] chore(deps): update linters to v5.29.0 (#16290) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 4 +-- yarn.lock | 86 ++++++++++++---------------------------------------- 2 files changed, 22 insertions(+), 68 deletions(-) diff --git a/package.json b/package.json index f55a51e430c148..4d563f5de0959c 100644 --- a/package.json +++ b/package.json @@ -259,8 +259,8 @@ "@types/url-join": "4.0.1", "@types/validate-npm-package-name": "3.0.3", "@types/xmldoc": "1.1.6", - "@typescript-eslint/eslint-plugin": "5.28.0", - "@typescript-eslint/parser": "5.28.0", + "@typescript-eslint/eslint-plugin": "5.29.0", + "@typescript-eslint/parser": "5.29.0", "aws-sdk-client-mock": "1.0.0", "callsite": "1.0.0", "conventional-changelog-conventionalcommits": "5.0.0", diff --git a/yarn.lock b/yarn.lock index 40559af52ddbb0..c78c128d3dd416 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2744,14 +2744,14 @@ dependencies: "@types/node" "*" -"@typescript-eslint/eslint-plugin@5.28.0": - version "5.28.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.28.0.tgz#6204ac33bdd05ab27c7f77960f1023951115d403" - integrity sha512-DXVU6Cg29H2M6EybqSg2A+x8DgO9TCUBRp4QEXQHJceLS7ogVDP0g3Lkg/SZCqcvkAP/RruuQqK0gdlkgmhSUA== - dependencies: - "@typescript-eslint/scope-manager" "5.28.0" - "@typescript-eslint/type-utils" "5.28.0" - "@typescript-eslint/utils" "5.28.0" +"@typescript-eslint/eslint-plugin@5.29.0": + version "5.29.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.29.0.tgz#c67794d2b0fd0b4a47f50266088acdc52a08aab6" + integrity sha512-kgTsISt9pM53yRFQmLZ4npj99yGl3x3Pl7z4eA66OuTzAGC4bQB5H5fuLwPnqTKU3yyrrg4MIhjF17UYnL4c0w== + dependencies: + "@typescript-eslint/scope-manager" "5.29.0" + "@typescript-eslint/type-utils" "5.29.0" + "@typescript-eslint/utils" "5.29.0" debug "^4.3.4" functional-red-black-tree "^1.0.1" ignore "^5.2.0" @@ -2766,24 +2766,16 @@ dependencies: "@typescript-eslint/utils" "5.29.0" -"@typescript-eslint/parser@5.28.0": - version "5.28.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.28.0.tgz#639b101cad2bfb7ae16e69710ac95c42bd4eae33" - integrity sha512-ekqoNRNK1lAcKhZESN/PdpVsWbP9jtiNqzFWkp/yAUdZvJalw2heCYuqRmM5eUJSIYEkgq5sGOjq+ZqsLMjtRA== +"@typescript-eslint/parser@5.29.0": + version "5.29.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.29.0.tgz#41314b195b34d44ff38220caa55f3f93cfca43cf" + integrity sha512-ruKWTv+x0OOxbzIw9nW5oWlUopvP/IQDjB5ZqmTglLIoDTctLlAJpAQFpNPJP/ZI7hTT9sARBosEfaKbcFuECw== dependencies: - "@typescript-eslint/scope-manager" "5.28.0" - "@typescript-eslint/types" "5.28.0" - "@typescript-eslint/typescript-estree" "5.28.0" + "@typescript-eslint/scope-manager" "5.29.0" + "@typescript-eslint/types" "5.29.0" + "@typescript-eslint/typescript-estree" "5.29.0" debug "^4.3.4" -"@typescript-eslint/scope-manager@5.28.0": - version "5.28.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.28.0.tgz#ef9a5c68fecde72fd2ff8a84b9c120324826c1b9" - integrity sha512-LeBLTqF/he1Z+boRhSqnso6YrzcKMTQ8bO/YKEe+6+O/JGof9M0g3IJlIsqfrK/6K03MlFIlycbf1uQR1IjE+w== - dependencies: - "@typescript-eslint/types" "5.28.0" - "@typescript-eslint/visitor-keys" "5.28.0" - "@typescript-eslint/scope-manager@5.29.0": version "5.29.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.29.0.tgz#2a6a32e3416cb133e9af8dcf54bf077a916aeed3" @@ -2792,38 +2784,20 @@ "@typescript-eslint/types" "5.29.0" "@typescript-eslint/visitor-keys" "5.29.0" -"@typescript-eslint/type-utils@5.28.0": - version "5.28.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.28.0.tgz#53ccc78fdcf0205ef544d843b84104c0e9c7ca8e" - integrity sha512-SyKjKh4CXPglueyC6ceAFytjYWMoPHMswPQae236zqe1YbhvCVQyIawesYywGiu98L9DwrxsBN69vGIVxJ4mQQ== +"@typescript-eslint/type-utils@5.29.0": + version "5.29.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.29.0.tgz#241918001d164044020b37d26d5b9f4e37cc3d5d" + integrity sha512-JK6bAaaiJozbox3K220VRfCzLa9n0ib/J+FHIwnaV3Enw/TO267qe0pM1b1QrrEuy6xun374XEAsRlA86JJnyg== dependencies: - "@typescript-eslint/utils" "5.28.0" + "@typescript-eslint/utils" "5.29.0" debug "^4.3.4" tsutils "^3.21.0" -"@typescript-eslint/types@5.28.0": - version "5.28.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.28.0.tgz#cffd9bcdce28db6daaa146e48a0be4387a6f4e9d" - integrity sha512-2OOm8ZTOQxqkPbf+DAo8oc16sDlVR5owgJfKheBkxBKg1vAfw2JsSofH9+16VPlN9PWtv8Wzhklkqw3k/zCVxA== - "@typescript-eslint/types@5.29.0": version "5.29.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.29.0.tgz#7861d3d288c031703b2d97bc113696b4d8c19aab" integrity sha512-X99VbqvAXOMdVyfFmksMy3u8p8yoRGITgU1joBJPzeYa0rhdf5ok9S56/itRoUSh99fiDoMtarSIJXo7H/SnOg== -"@typescript-eslint/typescript-estree@5.28.0": - version "5.28.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.28.0.tgz#3487d158d091ca2772b285e67412ff6d9797d863" - integrity sha512-9GX+GfpV+F4hdTtYc6OV9ZkyYilGXPmQpm6AThInpBmKJEyRSIjORJd1G9+bknb7OTFYL+Vd4FBJAO6T78OVqA== - dependencies: - "@typescript-eslint/types" "5.28.0" - "@typescript-eslint/visitor-keys" "5.28.0" - debug "^4.3.4" - globby "^11.1.0" - is-glob "^4.0.3" - semver "^7.3.7" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@5.29.0": version "5.29.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.29.0.tgz#e83d19aa7fd2e74616aab2f25dfbe4de4f0b5577" @@ -2837,18 +2811,6 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.28.0": - version "5.28.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.28.0.tgz#b27a136eac300a48160b36d2aad0da44a1341b99" - integrity sha512-E60N5L0fjv7iPJV3UGc4EC+A3Lcj4jle9zzR0gW7vXhflO7/J29kwiTGITA2RlrmPokKiZbBy2DgaclCaEUs6g== - dependencies: - "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.28.0" - "@typescript-eslint/types" "5.28.0" - "@typescript-eslint/typescript-estree" "5.28.0" - eslint-scope "^5.1.1" - eslint-utils "^3.0.0" - "@typescript-eslint/utils@5.29.0", "@typescript-eslint/utils@^5.10.0": version "5.29.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.29.0.tgz#775046effd5019667bd086bcf326acbe32cd0082" @@ -2861,14 +2823,6 @@ eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/visitor-keys@5.28.0": - version "5.28.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.28.0.tgz#982bb226b763c48fc1859a60de33fbf939d40a0f" - integrity sha512-BtfP1vCor8cWacovzzPFOoeW4kBQxzmhxGoOpt0v1SFvG+nJ0cWaVdJk7cky1ArTcFHHKNIxyo2LLr3oNkSuXA== - dependencies: - "@typescript-eslint/types" "5.28.0" - eslint-visitor-keys "^3.3.0" - "@typescript-eslint/visitor-keys@5.29.0": version "5.29.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.29.0.tgz#7a4749fa7ef5160c44a451bf060ac1dc6dfb77ee" From bfe47623f7844c56182feebe23c1e8b6ee3725ba Mon Sep 17 00:00:00 2001 From: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Date: Tue, 28 Jun 2022 04:36:22 +0200 Subject: [PATCH 217/240] fix(config): update default dependencyDashboardHeader (#16206) --- lib/config/options/index.ts | 2 +- .../master-issue_with_2_PR_closed_ignored.txt | 2 +- .../master-issue_with_2_PR_edited.txt | 2 +- .../master-issue_with_3_PR_in_approval.txt | 2 +- .../master-issue_with_3_PR_in_progress.txt | 2 +- .../__fixtures__/master-issue_with_8_PR.txt | 2 +- .../dependency-dashboard.spec.ts.snap | 18 +++++++++--------- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/config/options/index.ts b/lib/config/options/index.ts index aabe34a1955013..4f4920eded6bfb 100644 --- a/lib/config/options/index.ts +++ b/lib/config/options/index.ts @@ -465,7 +465,7 @@ const options: RenovateOptions[] = [ 'Any text added here will be placed first in the Dependency Dashboard issue body.', type: 'string', default: - 'This issue provides visibility into Renovate updates and their statuses. [Learn more](https://docs.renovatebot.com/key-concepts/dashboard/)', + 'This issue lists Renovate updates and detected dependencies. Read the [Dependency Dashboard](https://docs.renovatebot.com/key-concepts/dashboard/) docs to learn more.', }, { name: 'dependencyDashboardFooter', diff --git a/lib/workers/repository/__fixtures__/master-issue_with_2_PR_closed_ignored.txt b/lib/workers/repository/__fixtures__/master-issue_with_2_PR_closed_ignored.txt index fffe0e2d907a91..d143ed599333d1 100644 --- a/lib/workers/repository/__fixtures__/master-issue_with_2_PR_closed_ignored.txt +++ b/lib/workers/repository/__fixtures__/master-issue_with_2_PR_closed_ignored.txt @@ -1,4 +1,4 @@ -This issue provides visibility into Renovate updates and their statuses. [Learn more](https://docs.renovatebot.com/key-concepts/dashboard/) +This issue lists Renovate updates and detected dependencies. Read the [Dependency Dashboard](https://docs.renovatebot.com/key-concepts/dashboard/) docs to learn more. ## Ignored or Blocked diff --git a/lib/workers/repository/__fixtures__/master-issue_with_2_PR_edited.txt b/lib/workers/repository/__fixtures__/master-issue_with_2_PR_edited.txt index cd67feae860b75..0f495a51d166e5 100644 --- a/lib/workers/repository/__fixtures__/master-issue_with_2_PR_edited.txt +++ b/lib/workers/repository/__fixtures__/master-issue_with_2_PR_edited.txt @@ -1,4 +1,4 @@ -This issue provides visibility into Renovate updates and their statuses. [Learn more](https://docs.renovatebot.com/key-concepts/dashboard/) +This issue lists Renovate updates and detected dependencies. Read the [Dependency Dashboard](https://docs.renovatebot.com/key-concepts/dashboard/) docs to learn more. ## Edited/Blocked diff --git a/lib/workers/repository/__fixtures__/master-issue_with_3_PR_in_approval.txt b/lib/workers/repository/__fixtures__/master-issue_with_3_PR_in_approval.txt index a5cf0fb1f3bb39..75f81df8902f79 100644 --- a/lib/workers/repository/__fixtures__/master-issue_with_3_PR_in_approval.txt +++ b/lib/workers/repository/__fixtures__/master-issue_with_3_PR_in_approval.txt @@ -1,4 +1,4 @@ -This issue provides visibility into Renovate updates and their statuses. [Learn more](https://docs.renovatebot.com/key-concepts/dashboard/) +This issue lists Renovate updates and detected dependencies. Read the [Dependency Dashboard](https://docs.renovatebot.com/key-concepts/dashboard/) docs to learn more. ## PR Creation Approval Required diff --git a/lib/workers/repository/__fixtures__/master-issue_with_3_PR_in_progress.txt b/lib/workers/repository/__fixtures__/master-issue_with_3_PR_in_progress.txt index 54d0c07cfd7f53..2912f1d39e66d5 100644 --- a/lib/workers/repository/__fixtures__/master-issue_with_3_PR_in_progress.txt +++ b/lib/workers/repository/__fixtures__/master-issue_with_3_PR_in_progress.txt @@ -1,4 +1,4 @@ -This issue provides visibility into Renovate updates and their statuses. [Learn more](https://docs.renovatebot.com/key-concepts/dashboard/) +This issue lists Renovate updates and detected dependencies. Read the [Dependency Dashboard](https://docs.renovatebot.com/key-concepts/dashboard/) docs to learn more. ## Open diff --git a/lib/workers/repository/__fixtures__/master-issue_with_8_PR.txt b/lib/workers/repository/__fixtures__/master-issue_with_8_PR.txt index 297cb29a672cd7..9402c5d0549885 100644 --- a/lib/workers/repository/__fixtures__/master-issue_with_8_PR.txt +++ b/lib/workers/repository/__fixtures__/master-issue_with_8_PR.txt @@ -1,4 +1,4 @@ -This issue provides visibility into Renovate updates and their statuses. [Learn more](https://docs.renovatebot.com/key-concepts/dashboard/) +This issue lists Renovate updates and detected dependencies. Read the [Dependency Dashboard](https://docs.renovatebot.com/key-concepts/dashboard/) docs to learn more. ## Pending Approval diff --git a/lib/workers/repository/__snapshots__/dependency-dashboard.spec.ts.snap b/lib/workers/repository/__snapshots__/dependency-dashboard.spec.ts.snap index c6409f13eed631..3ea02bff9092de 100644 --- a/lib/workers/repository/__snapshots__/dependency-dashboard.spec.ts.snap +++ b/lib/workers/repository/__snapshots__/dependency-dashboard.spec.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`workers/repository/dependency-dashboard ensureDependencyDashboard() checks detected dependencies section multi base branch repo add detected dependencies to the Dependency Dashboard body 1`] = ` -"This issue provides visibility into Renovate updates and their statuses. [Learn more](https://docs.renovatebot.com/key-concepts/dashboard/) +"This issue lists Renovate updates and detected dependencies. Read the [Dependency Dashboard](https://docs.renovatebot.com/key-concepts/dashboard/) docs to learn more. This repository currently has no open or pending branches. @@ -109,7 +109,7 @@ This repository currently has no open or pending branches. `; exports[`workers/repository/dependency-dashboard ensureDependencyDashboard() checks detected dependencies section multi base branch repo show default message in issues body when packageFiles is empty 1`] = ` -"This issue provides visibility into Renovate updates and their statuses. [Learn more](https://docs.renovatebot.com/key-concepts/dashboard/) +"This issue lists Renovate updates and detected dependencies. Read the [Dependency Dashboard](https://docs.renovatebot.com/key-concepts/dashboard/) docs to learn more. This repository currently has no open or pending branches. @@ -176,7 +176,7 @@ None detected `; exports[`workers/repository/dependency-dashboard ensureDependencyDashboard() checks detected dependencies section multi base branch repo show default message in issues body when when packageFiles is null 1`] = ` -"This issue provides visibility into Renovate updates and their statuses. [Learn more](https://docs.renovatebot.com/key-concepts/dashboard/) +"This issue lists Renovate updates and detected dependencies. Read the [Dependency Dashboard](https://docs.renovatebot.com/key-concepts/dashboard/) docs to learn more. This repository currently has no open or pending branches. @@ -243,7 +243,7 @@ None detected `; exports[`workers/repository/dependency-dashboard ensureDependencyDashboard() checks detected dependencies section single base branch repo add detected dependencies to the Dependency Dashboard body 1`] = ` -"This issue provides visibility into Renovate updates and their statuses. [Learn more](https://docs.renovatebot.com/key-concepts/dashboard/) +"This issue lists Renovate updates and detected dependencies. Read the [Dependency Dashboard](https://docs.renovatebot.com/key-concepts/dashboard/) docs to learn more. This repository currently has no open or pending branches. @@ -296,7 +296,7 @@ This repository currently has no open or pending branches. `; exports[`workers/repository/dependency-dashboard ensureDependencyDashboard() checks detected dependencies section single base branch repo show default message in issues body when packageFiles is empty 1`] = ` -"This issue provides visibility into Renovate updates and their statuses. [Learn more](https://docs.renovatebot.com/key-concepts/dashboard/) +"This issue lists Renovate updates and detected dependencies. Read the [Dependency Dashboard](https://docs.renovatebot.com/key-concepts/dashboard/) docs to learn more. This repository currently has no open or pending branches. @@ -308,7 +308,7 @@ None detected `; exports[`workers/repository/dependency-dashboard ensureDependencyDashboard() checks detected dependencies section single base branch repo show default message in issues body when when packageFiles is null 1`] = ` -"This issue provides visibility into Renovate updates and their statuses. [Learn more](https://docs.renovatebot.com/key-concepts/dashboard/) +"This issue lists Renovate updates and detected dependencies. Read the [Dependency Dashboard](https://docs.renovatebot.com/key-concepts/dashboard/) docs to learn more. This repository currently has no open or pending branches. @@ -320,7 +320,7 @@ None detected `; exports[`workers/repository/dependency-dashboard ensureDependencyDashboard() checks detected dependencies section single base branch repo shows different combinations of version+digest for a given dependency 1`] = ` -"This issue provides visibility into Renovate updates and their statuses. [Learn more](https://docs.renovatebot.com/key-concepts/dashboard/) +"This issue lists Renovate updates and detected dependencies. Read the [Dependency Dashboard](https://docs.renovatebot.com/key-concepts/dashboard/) docs to learn more. This repository currently has no open or pending branches. @@ -360,7 +360,7 @@ This repository currently has no open or pending branches. `; exports[`workers/repository/dependency-dashboard ensureDependencyDashboard() contains logged problems 1`] = ` -"This issue provides visibility into Renovate updates and their statuses. [Learn more](https://docs.renovatebot.com/key-concepts/dashboard/) +"This issue lists Renovate updates and detected dependencies. Read the [Dependency Dashboard](https://docs.renovatebot.com/key-concepts/dashboard/) docs to learn more. ## Repository problems @@ -414,7 +414,7 @@ And this is a footer for repository:test `; exports[`workers/repository/dependency-dashboard ensureDependencyDashboard() rechecks branches 1`] = ` -"This issue provides visibility into Renovate updates and their statuses. [Learn more](https://docs.renovatebot.com/key-concepts/dashboard/) +"This issue lists Renovate updates and detected dependencies. Read the [Dependency Dashboard](https://docs.renovatebot.com/key-concepts/dashboard/) docs to learn more. ## Pending Approval From f00590cff718d2db616fc75a51d8f2028e4c58d9 Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Tue, 28 Jun 2022 11:27:57 +0200 Subject: [PATCH 218/240] fix(bazel): skip updating if unchanged value (#16295) Closes #16268 --- lib/modules/manager/bazel/update.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/modules/manager/bazel/update.ts b/lib/modules/manager/bazel/update.ts index 93933e48b8627e..1556e2890f3f75 100644 --- a/lib/modules/manager/bazel/update.ts +++ b/lib/modules/manager/bazel/update.ts @@ -13,6 +13,10 @@ function updateWithNewVersion( currentValue: string, newValue: string ): string { + // istanbul ignore if + if (currentValue === newValue) { + return content; + } const replaceFrom = currentValue.replace(regEx(/^v/), ''); const replaceTo = newValue.replace(regEx(/^v/), ''); let newContent = content; From db4160a205b33f70529f0066e06de3a07fce381a Mon Sep 17 00:00:00 2001 From: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Date: Tue, 28 Jun 2022 11:55:54 +0200 Subject: [PATCH 219/240] docs(configuration options): add `:gitSignOff` example (#16301) Co-authored-by: Rhys Arkins --- docs/usage/configuration-options.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index 09d3cf2bc44373..a3ae0ce688e2c6 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -349,6 +349,14 @@ For example, To add `[skip ci]` to every commit you could configure: Another example would be if you want to configure a DCO signoff to each commit. +If you want Renovate to signoff its commits, add the [`:gitSignOff` preset](https://docs.renovatebot.com/presets-default/#gitsignoff) to your `extends` array: + +```json +{ + "extends": [":gitSignOff"] +} +``` + ## commitBodyTable ## commitMessage From 7ac91e452cb950f8b9dbb4ada2cd20a1c4ed0252 Mon Sep 17 00:00:00 2001 From: Gabriel-Ladzaretti <97394622+Gabriel-Ladzaretti@users.noreply.github.com> Date: Tue, 28 Jun 2022 16:49:42 +0300 Subject: [PATCH 220/240] docs(config): Don't show [template] for long strings (#16224) --- lib/logger/index.spec.ts | 5 +++-- lib/logger/utils.ts | 4 +--- tools/docs/config.ts | 3 --- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/logger/index.spec.ts b/lib/logger/index.spec.ts index 9b66e5c4c41fd1..a6c8368e8e1415 100644 --- a/lib/logger/index.spec.ts +++ b/lib/logger/index.spec.ts @@ -160,13 +160,14 @@ describe('logger/index', () => { constructor(public field: string) {} } + const prBody = 'test'; logger.error({ foo: 'secret"password', bar: ['somethingelse', 'secret"password'], npmToken: 'token', buffer: Buffer.from('test'), content: 'test', - prBody: 'test', + prBody, secrets: { foo: 'barsecret', }, @@ -181,7 +182,7 @@ describe('logger/index', () => { expect(logged.npmToken).not.toBe('token'); expect(logged.buffer).toBe('[content]'); expect(logged.content).toBe('[content]'); - expect(logged.prBody).toBe('[Template]'); + expect(logged.prBody).toBe(prBody); expect(logged.secrets.foo).toBe('***********'); expect(logged.someFn).toBe('[function]'); expect(logged.someObject.field).toBe('**redacted**'); diff --git a/lib/logger/utils.ts b/lib/logger/utils.ts index d797fbe59a3469..90e0e263f76510 100644 --- a/lib/logger/utils.ts +++ b/lib/logger/utils.ts @@ -39,7 +39,7 @@ export class ProblemStream extends Stream { this._problems = []; } } -const templateFields = ['prBody']; + const contentFields = [ 'content', 'contents', @@ -148,8 +148,6 @@ export function sanitizeValue( curValue = '***********'; } else if (contentFields.includes(key)) { curValue = '[content]'; - } else if (templateFields.includes(key)) { - curValue = '[Template]'; } else if (key === 'secrets') { curValue = {}; Object.keys(val).forEach((secretKey) => { diff --git a/tools/docs/config.ts b/tools/docs/config.ts index 110773c666440d..d4c5a2a00700df 100644 --- a/tools/docs/config.ts +++ b/tools/docs/config.ts @@ -116,9 +116,6 @@ function genTable(obj: [string, string][], type: string, def: any): string { ) { el[1] = `${el[1]}`; } - if (type === 'string' && el[0] === 'default' && el[1].length > 200) { - el[1] = `[template]`; - } // objects and arrays should be printed in JSON notation if ((type === 'object' || type === 'array') && el[0] === 'default') { // only show array and object defaults if they are not null and are not empty From 17f1b409a60541ddda78112fe22bac4f7851c77a Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Tue, 28 Jun 2022 16:30:35 +0200 Subject: [PATCH 221/240] fix: log http and npm rejection cases (#16307) --- lib/modules/datasource/npm/get.ts | 1 + lib/util/http/index.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/modules/datasource/npm/get.ts b/lib/modules/datasource/npm/get.ts index 109b9e94857cc4..bcaeac57a1840a 100644 --- a/lib/modules/datasource/npm/get.ts +++ b/lib/modules/datasource/npm/get.ts @@ -194,6 +194,7 @@ export async function getDependency( } throw new ExternalHostError(err); } + logger.debug({ err }, 'Unknown npm lookup error'); return null; } } diff --git a/lib/util/http/index.ts b/lib/util/http/index.ts index 24060bbda4145e..adf4eaf4e59a6c 100644 --- a/lib/util/http/index.ts +++ b/lib/util/http/index.ts @@ -128,6 +128,7 @@ export class Http { options = applyHostRules(url, options); if (options.enabled === false) { + logger.debug({ url }, 'Host is disabled - rejecting request'); throw new Error(HOST_DISABLED); } options = applyAuthorization(options); From 32d23af54e9d5174c2a1aa4e1d2075d2124eec8b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 28 Jun 2022 15:04:42 +0000 Subject: [PATCH 222/240] chore(deps): update node.js to f574d30 (#16308) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .devcontainer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index bf5ce0aa3e5e5e..6fa446783a7d54 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM containerbase/node:14.19.3@sha256:5635fa6ae50860f74933fd04ffdae624b3423a8c2dcf32a72f0266335f580ed9 +FROM containerbase/node:14.19.3@sha256:f574d3061fc651873b8693a22a30f399babea4ec5d3331aa500fa59ac501f3ed USER root From 1cbcf740e538fb07f206f766988d16b9138b6a89 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 28 Jun 2022 18:22:15 +0000 Subject: [PATCH 223/240] chore(deps): update dependency @types/jest to v28.1.3 (#16314) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 4d563f5de0959c..f54d17cc06526f 100644 --- a/package.json +++ b/package.json @@ -239,7 +239,7 @@ "@types/github-url-from-git": "1.5.1", "@types/global-agent": "2.1.1", "@types/ini": "1.3.31", - "@types/jest": "28.1.2", + "@types/jest": "28.1.3", "@types/js-yaml": "4.0.5", "@types/json-dup-key-validator": "1.0.0", "@types/linkify-markdown": "1.0.1", diff --git a/yarn.lock b/yarn.lock index c78c128d3dd416..68c73cbd384a47 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2492,10 +2492,10 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/jest@28.1.2": - version "28.1.2" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-28.1.2.tgz#c678569bb2d8e5474dd88f0851613611aeed9809" - integrity sha512-5dNM7mMuIrCtNJsFfvUO/5xCrG8swuT2c7ND+sl3XwlwxJf3k7e7o+PRvcFN/iIm8XhCqHqxLOj9yutDDOJoRg== +"@types/jest@28.1.3": + version "28.1.3" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-28.1.3.tgz#52f3f3e50ce59191ff5fbb1084896cc0cf30c9ce" + integrity sha512-Tsbjk8Y2hkBaY/gJsataeb4q9Mubw9EOz7+4RjPkzD5KjTvHHs7cpws22InaoXxAVAhF5HfFbzJjo6oKWqSZLw== dependencies: jest-matcher-utils "^28.0.0" pretty-format "^28.0.0" From d5148933f53aa31e0eaeaad95c1f027d8c7e6f52 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 28 Jun 2022 21:57:58 +0000 Subject: [PATCH 224/240] chore(deps): update github/codeql-action action to v2.1.15 (#16315) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/codeql-analysis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 607569d19753d5..b5f4a19498f92d 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -30,7 +30,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@41a4ada31ba866a7f1196b9602703a89edd69e22 # tag=v2.1.14 + uses: github/codeql-action/init@3f62b754e23e0dd60f91b744033e1dc1654c0ec6 # tag=v2.1.15 with: languages: javascript @@ -40,7 +40,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@41a4ada31ba866a7f1196b9602703a89edd69e22 # tag=v2.1.14 + uses: github/codeql-action/autobuild@3f62b754e23e0dd60f91b744033e1dc1654c0ec6 # tag=v2.1.15 # ℹī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -54,4 +54,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@41a4ada31ba866a7f1196b9602703a89edd69e22 # tag=v2.1.14 + uses: github/codeql-action/analyze@3f62b754e23e0dd60f91b744033e1dc1654c0ec6 # tag=v2.1.15 From 6d605cbf904ace7505648ab68c44fa55c6bc10e4 Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Wed, 29 Jun 2022 06:58:08 +0300 Subject: [PATCH 225/240] fix(helm): Revert source url logic back (#16317) --- lib/modules/datasource/helm/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/modules/datasource/helm/index.ts b/lib/modules/datasource/helm/index.ts index 10d0ccc9349372..56f8b269a13138 100644 --- a/lib/modules/datasource/helm/index.ts +++ b/lib/modules/datasource/helm/index.ts @@ -63,7 +63,7 @@ export class HelmDatasource extends Datasource { } const result: HelmRepositoryData = {}; for (const [name, releases] of Object.entries(doc.entries)) { - const latestRelease = releases[releases.length - 1]; + const latestRelease = releases[0]; const { sourceUrl, sourceDirectory } = findSourceUrl(latestRelease); result[name] = { homepage: latestRelease.home, From dc11e26c377465a1e105d3d41ab3f85c117429bd Mon Sep 17 00:00:00 2001 From: Gabriel-Ladzaretti <97394622+Gabriel-Ladzaretti@users.noreply.github.com> Date: Wed, 29 Jun 2022 08:26:46 +0300 Subject: [PATCH 226/240] fix(datasource/pypi): use pypi.org/pypi registry instead of pypi.org/simple (#16293) * fix(datasource/pypi): use pypi api instead of the simple variant * fix(datasource/pypi): use pypi api instead of the simple variant * fix(datasource/pypi): use pypi api instead of the simple variant * fix(datasource/pypi): use pypi api instead of the simple variant * Update lib/modules/datasource/pypi/index.ts Co-authored-by: Michael Kriese --- .../pypi/__snapshots__/index.spec.ts.snap | 104 +++++++++++++++++- lib/modules/datasource/pypi/common.ts | 7 ++ lib/modules/datasource/pypi/index.spec.ts | 76 +++++++++---- lib/modules/datasource/pypi/index.ts | 12 +- 4 files changed, 170 insertions(+), 29 deletions(-) create mode 100644 lib/modules/datasource/pypi/common.ts diff --git a/lib/modules/datasource/pypi/__snapshots__/index.spec.ts.snap b/lib/modules/datasource/pypi/__snapshots__/index.spec.ts.snap index 7e3b20c69204e8..8c05260849cf78 100644 --- a/lib/modules/datasource/pypi/__snapshots__/index.spec.ts.snap +++ b/lib/modules/datasource/pypi/__snapshots__/index.spec.ts.snap @@ -44,7 +44,7 @@ Object { exports[`modules/datasource/pypi/index getReleases parses data-requires-python and respects constraints from simple endpoint 1`] = ` Object { - "registryUrl": "https://pypi.org/simple", + "registryUrl": "https://some.registry.org/simple", "releases": Array [ Object { "version": "0.1.2", @@ -112,7 +112,7 @@ Object { exports[`modules/datasource/pypi/index getReleases process data from simple endpoint 1`] = ` Object { - "registryUrl": "https://pypi.org/simple", + "registryUrl": "https://some.registry.org/simple", "releases": Array [ Object { "version": "0.1.2", @@ -154,7 +154,7 @@ Object { exports[`modules/datasource/pypi/index getReleases process data from simple endpoint with hyphens replaced with underscores 1`] = ` Object { - "registryUrl": "https://pypi.org/simple", + "registryUrl": "https://some.registry.org/simple", "releases": Array [ Object { "version": "0.0.5", @@ -280,3 +280,101 @@ Object { ], } `; + +exports[`modules/datasource/pypi/index uses https://pypi.org/pypi/ instead of https://pypi.org/simple/ 1`] = ` +Object { + "registryUrl": "https://pypi.org/simple", + "releases": Array [ + Object { + "releaseTimestamp": "2017-04-03T16:55:14.000Z", + "version": "0.0.1", + }, + Object { + "releaseTimestamp": "2017-04-17T20:32:30.000Z", + "version": "0.0.2", + }, + Object { + "releaseTimestamp": "2017-04-28T21:18:54.000Z", + "version": "0.0.3", + }, + Object { + "releaseTimestamp": "2017-05-09T21:36:51.000Z", + "version": "0.0.4", + }, + Object { + "releaseTimestamp": "2017-05-30T23:13:49.000Z", + "version": "0.0.5", + }, + Object { + "releaseTimestamp": "2017-06-13T22:21:05.000Z", + "version": "0.0.6", + }, + Object { + "releaseTimestamp": "2017-06-21T22:12:36.000Z", + "version": "0.0.7", + }, + Object { + "releaseTimestamp": "2017-07-07T16:22:26.000Z", + "version": "0.0.8", + }, + Object { + "releaseTimestamp": "2017-08-28T20:14:33.000Z", + "version": "0.0.9", + }, + Object { + "releaseTimestamp": "2017-09-22T23:47:59.000Z", + "version": "0.0.10", + }, + Object { + "releaseTimestamp": "2017-10-24T02:14:07.000Z", + "version": "0.0.11", + }, + Object { + "releaseTimestamp": "2017-11-14T18:31:57.000Z", + "version": "0.0.12", + }, + Object { + "releaseTimestamp": "2017-12-05T18:57:54.000Z", + "version": "0.0.13", + }, + Object { + "releaseTimestamp": "2018-01-05T21:26:03.000Z", + "version": "0.0.14", + }, + Object { + "releaseTimestamp": "2018-01-17T18:36:39.000Z", + "version": "0.1.0", + }, + Object { + "releaseTimestamp": "2018-01-31T18:05:22.000Z", + "version": "0.1.1", + }, + Object { + "releaseTimestamp": "2018-02-13T18:17:52.000Z", + "version": "0.1.2", + }, + Object { + "releaseTimestamp": "2018-03-13T17:08:20.000Z", + "version": "0.1.3", + }, + Object { + "releaseTimestamp": "2018-03-27T17:55:25.000Z", + "version": "0.1.4", + }, + Object { + "releaseTimestamp": "2018-04-10T17:25:47.000Z", + "version": "0.1.5", + }, + Object { + "isDeprecated": true, + "releaseTimestamp": "2018-05-07T17:59:09.000Z", + "version": "0.1.6", + }, + Object { + "releaseTimestamp": "2018-05-22T17:25:23.000Z", + "version": "0.1.7", + }, + ], + "sourceUrl": "https://github.com/Azure/azure-cli", +} +`; diff --git a/lib/modules/datasource/pypi/common.ts b/lib/modules/datasource/pypi/common.ts new file mode 100644 index 00000000000000..50310011e54b8f --- /dev/null +++ b/lib/modules/datasource/pypi/common.ts @@ -0,0 +1,7 @@ +import { regEx } from '../../../util/regex'; + +const githubRepoPattern = regEx(/^https?:\/\/github\.com\/[^\\/]+\/[^\\/]+$/); + +export function isGitHubRepo(url: string): boolean { + return !url.includes('sponsors') && githubRepoPattern.test(url); +} diff --git a/lib/modules/datasource/pypi/index.spec.ts b/lib/modules/datasource/pypi/index.spec.ts index 619cd15cc7844f..90a1a252ef7358 100644 --- a/lib/modules/datasource/pypi/index.spec.ts +++ b/lib/modules/datasource/pypi/index.spec.ts @@ -178,6 +178,25 @@ describe('modules/datasource/pypi/index', () => { expect(result?.changelogUrl).toBe(info.project_urls.changelog); }); + it('excludes gh sponsors url from project_urls', async () => { + const info = { + name: 'flexget', + home_page: 'https://flexget.com', + project_urls: { + random: 'https://github.com/sponsors/Flexget', + }, + }; + httpMock + .scope(baseUrl) + .get('/flexget/json') + .reply(200, { ...JSON.parse(res1), info }); + const result = await getPkgReleases({ + datasource, + depName: 'flexget', + }); + expect(result?.sourceUrl).toBeUndefined(); + }); + it('normalizes the package name according to PEP 503', async () => { const expectedHttpCall = httpMock .scope(baseUrl) @@ -213,7 +232,7 @@ describe('modules/datasource/pypi/index', () => { }); it('normalizes the package name according to PEP 503 querying a simple endpoint', async () => { - const simpleRegistryUrl = 'https://pypi.org/simple/'; + const simpleRegistryUrl = 'https://some.registry.org/simple/'; const expectedHttpCall = httpMock .scope(simpleRegistryUrl) .get('/not-normalized-package/') @@ -258,11 +277,11 @@ describe('modules/datasource/pypi/index', () => { it('process data from simple endpoint', async () => { httpMock - .scope('https://pypi.org/simple/') + .scope('https://some.registry.org/simple/') .get('/dj-database-url/') .reply(200, htmlResponse); const config = { - registryUrls: ['https://pypi.org/simple/'], + registryUrls: ['https://some.registry.org/simple/'], }; expect( await getPkgReleases({ @@ -315,11 +334,11 @@ describe('modules/datasource/pypi/index', () => { it('process data from simple endpoint with hyphens', async () => { httpMock - .scope('https://pypi.org/simple/') + .scope('https://some.registry.org/simple/') .get('/package-with-hyphens/') .reply(200, hyphensResponse); const config = { - registryUrls: ['https://pypi.org/simple/'], + registryUrls: ['https://some.registry.org/simple/'], }; const res = await getPkgReleases({ datasource, @@ -335,11 +354,11 @@ describe('modules/datasource/pypi/index', () => { it('process data from simple endpoint with hyphens replaced with underscores', async () => { httpMock - .scope('https://pypi.org/simple/') + .scope('https://some.registry.org/simple/') .get('/image-collector/') .reply(200, mixedHyphensResponse); const config = { - registryUrls: ['https://pypi.org/simple/'], + registryUrls: ['https://some.registry.org/simple/'], }; expect( await getPkgReleases({ @@ -353,11 +372,11 @@ describe('modules/datasource/pypi/index', () => { it('process data from simple endpoint with mixed-case characters', async () => { httpMock - .scope('https://pypi.org/simple/') + .scope('https://some.registry.org/simple/') .get('/packagewithmixedcase/') .reply(200, mixedCaseResponse); const config = { - registryUrls: ['https://pypi.org/simple/'], + registryUrls: ['https://some.registry.org/simple/'], }; const res = await getPkgReleases({ datasource, @@ -373,11 +392,11 @@ describe('modules/datasource/pypi/index', () => { it('process data from simple endpoint with mixed-case characters when using lower case dependency name', async () => { httpMock - .scope('https://pypi.org/simple/') + .scope('https://some.registry.org/simple/') .get('/packagewithmixedcase/') .reply(200, mixedCaseResponse); const config = { - registryUrls: ['https://pypi.org/simple/'], + registryUrls: ['https://some.registry.org/simple/'], }; const res = await getPkgReleases({ datasource, @@ -393,11 +412,11 @@ describe('modules/datasource/pypi/index', () => { it('process data from simple endpoint with periods', async () => { httpMock - .scope('https://pypi.org/simple/') + .scope('https://some.registry.org/simple/') .get('/package-with-periods/') .reply(200, withPeriodsResponse); const config = { - registryUrls: ['https://pypi.org/simple/'], + registryUrls: ['https://some.registry.org/simple/'], }; const res = await getPkgReleases({ datasource, @@ -413,11 +432,11 @@ describe('modules/datasource/pypi/index', () => { it('returns null for empty response', async () => { httpMock - .scope('https://pypi.org/simple/') + .scope('https://some.registry.org/simple/') .get('/dj-database-url/') .reply(200); const config = { - registryUrls: ['https://pypi.org/simple/'], + registryUrls: ['https://some.registry.org/simple/'], }; expect( await getPkgReleases({ @@ -431,11 +450,11 @@ describe('modules/datasource/pypi/index', () => { it('returns null for 404 response from simple endpoint', async () => { httpMock - .scope('https://pypi.org/simple/') + .scope('https://some.registry.org/simple/') .get('/dj-database-url/') .replyWithError('error'); const config = { - registryUrls: ['https://pypi.org/simple/'], + registryUrls: ['https://some.registry.org/simple/'], }; expect( await getPkgReleases({ @@ -449,11 +468,11 @@ describe('modules/datasource/pypi/index', () => { it('returns null for response with no versions', async () => { httpMock - .scope('https://pypi.org/simple/') + .scope('https://some.registry.org/simple/') .get('/dj-database-url/') .reply(200, badResponse); const config = { - registryUrls: ['https://pypi.org/simple/'], + registryUrls: ['https://some.registry.org/simple/'], }; expect( await getPkgReleases({ @@ -487,11 +506,11 @@ describe('modules/datasource/pypi/index', () => { it('parses data-requires-python and respects constraints from simple endpoint', async () => { httpMock - .scope('https://pypi.org/simple/') + .scope('https://some.registry.org/simple/') .get('/dj-database-url/') .reply(200, dataRequiresPythonResponse); const config = { - registryUrls: ['https://pypi.org/simple/'], + registryUrls: ['https://some.registry.org/simple/'], }; expect( await getPkgReleases({ @@ -503,4 +522,19 @@ describe('modules/datasource/pypi/index', () => { ).toMatchSnapshot(); }); }); + + it('uses https://pypi.org/pypi/ instead of https://pypi.org/simple/', async () => { + httpMock.scope(baseUrl).get('/azure-cli-monitor/json').reply(200, res1); + const config = { + registryUrls: ['https://pypi.org/simple/'], + }; + expect( + await getPkgReleases({ + datasource, + ...config, + constraints: { python: '2.7' }, + depName: 'azure-cli-monitor', + }) + ).toMatchSnapshot(); + }); }); diff --git a/lib/modules/datasource/pypi/index.ts b/lib/modules/datasource/pypi/index.ts index dae80c60cd99cc..e3985ecab9e1be 100644 --- a/lib/modules/datasource/pypi/index.ts +++ b/lib/modules/datasource/pypi/index.ts @@ -7,10 +7,9 @@ import { ensureTrailingSlash } from '../../../util/url'; import * as pep440 from '../../versioning/pep440'; import { Datasource } from '../datasource'; import type { GetReleasesConfig, Release, ReleaseResult } from '../types'; +import { isGitHubRepo } from './common'; import type { PypiJSON, PypiJSONRelease, Releases } from './types'; -const githubRepoPattern = regEx(/^https?:\/\/github\.com\/[^\\/]+\/[^\\/]+$/); - export class PypiDatasource extends Datasource { static readonly id = 'pypi'; @@ -35,7 +34,10 @@ export class PypiDatasource extends Datasource { registryUrl, }: GetReleasesConfig): Promise { let dependency: ReleaseResult | null = null; - const hostUrl = ensureTrailingSlash(`${registryUrl}`); + // TODO: null check (#7154) + const hostUrl = ensureTrailingSlash( + registryUrl!.replace('https://pypi.org/simple', 'https://pypi.org/pypi') + ); const normalizedLookupName = PypiDatasource.normalizeName(packageName); // not all simple indexes use this identifier, but most do @@ -103,7 +105,7 @@ export class PypiDatasource extends Datasource { if (dep.info?.home_page) { dependency.homepage = dep.info.home_page; - if (githubRepoPattern.exec(dep.info.home_page)) { + if (isGitHubRepo(dep.info.home_page)) { dependency.sourceUrl = dep.info.home_page.replace( 'http://', 'https://' @@ -120,7 +122,7 @@ export class PypiDatasource extends Datasource { (lower.startsWith('repo') || lower === 'code' || lower === 'source' || - githubRepoPattern.exec(projectUrl)) + isGitHubRepo(projectUrl)) ) { dependency.sourceUrl = projectUrl; } From 0687799b2814458de8d5ad78fc49fe99aac46842 Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Wed, 29 Jun 2022 08:44:30 +0300 Subject: [PATCH 227/240] refactor(fs): Remove unused proxied functions (#16311) * refactor(fs): Remove unused proxied functions * Fix lint/test * Fix * Update lib/util/fs/index.spec.ts Co-authored-by: Michael Kriese Co-authored-by: Michael Kriese --- lib/util/fs/index.spec.ts | 4 ++-- lib/util/fs/proxies.spec.ts | 24 ------------------------ lib/util/fs/proxies.ts | 25 +------------------------ 3 files changed, 3 insertions(+), 50 deletions(-) delete mode 100644 lib/util/fs/proxies.spec.ts diff --git a/lib/util/fs/index.spec.ts b/lib/util/fs/index.spec.ts index b9af543aecc649..09b66be3efd876 100644 --- a/lib/util/fs/index.spec.ts +++ b/lib/util/fs/index.spec.ts @@ -1,4 +1,5 @@ import _findUp from 'find-up'; +import fs from 'fs-extra'; import { withDir } from 'tmp-promise'; import { join } from 'upath'; import { envMock } from '../../../test/exec-util'; @@ -7,7 +8,6 @@ import { GlobalConfig } from '../../config/global'; import { ensureCacheDir, ensureLocalDir, - exists, findLocalSiblingOrParent, findUpLocal, getSubDirectory, @@ -190,7 +190,7 @@ describe('util/fs/index', () => { const { dirFromEnv } = setupMock(tmpDir.path); const res = await ensureCacheDir('bundler'); expect(res).toEqual(dirFromEnv); - expect(await exists(dirFromEnv)).toBeTrue(); + expect(await fs.pathExists(dirFromEnv)).toBeTrue(); }, { unsafeCleanup: true } ); diff --git a/lib/util/fs/proxies.spec.ts b/lib/util/fs/proxies.spec.ts deleted file mode 100644 index feeae89591724c..00000000000000 --- a/lib/util/fs/proxies.spec.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Fixtures } from '../../../test/fixtures'; -import { exists, readFile, remove } from './proxies'; - -jest.mock('fs-extra', () => Fixtures.fsExtra()); - -describe('util/fs/proxies', () => { - beforeEach(() => { - Fixtures.reset(); - }); - - describe('remove', () => { - it('should call remove in fs-extra', async () => { - Fixtures.mock( - { - test: 'test', - }, - '/' - ); - expect(await readFile('/test', 'utf8')).toBe('test'); - await remove('/test'); - expect(await exists('/test')).toBeFalse(); - }); - }); -}); diff --git a/lib/util/fs/proxies.ts b/lib/util/fs/proxies.ts index 3fe9c68833b394..f291ff1e572f0c 100644 --- a/lib/util/fs/proxies.ts +++ b/lib/util/fs/proxies.ts @@ -1,5 +1,5 @@ import fs from 'fs-extra'; -import type { MoveOptions, WriteFileOptions } from 'fs-extra'; +import type { WriteFileOptions } from 'fs-extra'; // istanbul ignore next export function stat(path: string | Buffer): Promise { @@ -43,34 +43,11 @@ export function outputFile( return fs.outputFile(file, data, options ?? {}); } -export function remove(dir: string): Promise { - return fs.remove(dir); -} - // istanbul ignore next export function unlink(path: string | Buffer): Promise { return fs.unlink(path); } -// istanbul ignore next -export function exists(path: string): Promise { - return fs.pathExists(path); -} - -// istanbul ignore next -export function pathExists(path: string): Promise { - return fs.pathExists(path); -} - -// istanbul ignore next -export function move( - src: string, - dest: string, - options?: MoveOptions -): Promise { - return fs.move(src, dest, options ?? {}); -} - // istanbul ignore next export function readdir(path: string): Promise { return fs.readdir(path); From 851d8f4f7a5218cac8da978af6aa73326c018faa Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Wed, 29 Jun 2022 09:03:49 +0300 Subject: [PATCH 228/240] refactor(fs): Move `chmod` to `chmodLocalFile` (#16306) * refactor(fs): Move `chmod` to `chmodLocalFile` * More refactoring and tests * Fix tests * Apply suggestions from code review Co-authored-by: Michael Kriese * Fix prettier Co-authored-by: Michael Kriese --- .../manager/gradle-wrapper/artifacts.spec.ts | 16 +++++++- .../manager/gradle-wrapper/artifacts.ts | 15 ++------ lib/modules/manager/gradle-wrapper/utils.ts | 14 +++---- lib/util/fs/index.spec.ts | 38 +++++++++++++++++++ lib/util/fs/index.ts | 21 ++++++++++ lib/util/fs/proxies.ts | 8 ---- 6 files changed, 82 insertions(+), 30 deletions(-) diff --git a/lib/modules/manager/gradle-wrapper/artifacts.spec.ts b/lib/modules/manager/gradle-wrapper/artifacts.spec.ts index 9551f9d27e6ffd..70b7231865ac42 100644 --- a/lib/modules/manager/gradle-wrapper/artifacts.spec.ts +++ b/lib/modules/manager/gradle-wrapper/artifacts.spec.ts @@ -1,4 +1,5 @@ -import { readFile, stat } from 'fs-extra'; +import type { Stats } from 'fs'; +import { readFile } from 'fs-extra'; import { resolve } from 'upath'; import { envMock, exec, mockExecAll } from '../../../../test/exec-util'; import * as httpMock from '../../../../test/http-mock'; @@ -54,7 +55,12 @@ describe('modules/manager/gradle-wrapper/artifacts', () => { resetPrefetchedImages(); fs.readLocalFile.mockResolvedValue('test'); - fs.stat.mockImplementation((p) => stat(p)); + fs.statLocalFile.mockResolvedValue( + partial({ + isFile: () => true, + mode: 0o555, + }) + ); }); afterEach(() => { @@ -98,6 +104,12 @@ describe('modules/manager/gradle-wrapper/artifacts', () => { }); it('gradlew not found', async () => { + fs.statLocalFile.mockResolvedValue( + partial({ + isFile: () => false, + mode: 0o555, + }) + ); GlobalConfig.set({ ...adminConfig, localDir: 'some-dir' }); const res = await gradleWrapper.updateArtifacts({ packageFileName: 'gradle-wrapper.properties', diff --git a/lib/modules/manager/gradle-wrapper/artifacts.ts b/lib/modules/manager/gradle-wrapper/artifacts.ts index d3da5a3d55dcd3..220edc5eb36a8b 100644 --- a/lib/modules/manager/gradle-wrapper/artifacts.ts +++ b/lib/modules/manager/gradle-wrapper/artifacts.ts @@ -1,12 +1,10 @@ import is from '@sindresorhus/is'; import { quote } from 'shlex'; -import upath from 'upath'; -import { GlobalConfig } from '../../../config/global'; import { TEMPORARY_ERROR } from '../../../constants/error-messages'; import { logger } from '../../../logger'; import { exec } from '../../../util/exec'; import type { ExecOptions } from '../../../util/exec/types'; -import { readLocalFile, stat, writeLocalFile } from '../../../util/fs'; +import { readLocalFile, writeLocalFile } from '../../../util/fs'; import { getRepoStatus } from '../../../util/git'; import type { StatusResult } from '../../../util/git/types'; import { Http } from '../../../util/http'; @@ -62,16 +60,9 @@ export async function updateArtifacts({ config, }: UpdateArtifact): Promise { try { - const projectDir = GlobalConfig.get('localDir'); logger.debug({ updatedDeps }, 'gradle-wrapper.updateArtifacts()'); - const gradlew = gradleWrapperFileName(); - const gradlewPath = upath.resolve(projectDir, `./${gradlew}`); - let cmd = await prepareGradleCommand( - gradlew, - projectDir!, - await stat(gradlewPath).catch(() => null), - `wrapper` - ); + const gradlewFile = gradleWrapperFileName(); + let cmd = await prepareGradleCommand(gradlewFile, `wrapper`); if (!cmd) { logger.info('No gradlew found - skipping Artifacts update'); return null; diff --git a/lib/modules/manager/gradle-wrapper/utils.ts b/lib/modules/manager/gradle-wrapper/utils.ts index c990f20819f9e4..8fb41e5753ff73 100644 --- a/lib/modules/manager/gradle-wrapper/utils.ts +++ b/lib/modules/manager/gradle-wrapper/utils.ts @@ -1,9 +1,7 @@ -import type { Stats } from 'fs'; import os from 'os'; -import upath from 'upath'; import { GlobalConfig } from '../../../config/global'; import { logger } from '../../../logger'; -import { chmod } from '../../../util/fs'; +import { chmodLocalFile, statLocalFile } from '../../../util/fs'; import { newlineRegex, regEx } from '../../../util/regex'; import gradleVersioning from '../../versioning/gradle'; import { id as npmVersioning } from '../../versioning/npm'; @@ -27,16 +25,16 @@ export function gradleWrapperFileName(): string { export async function prepareGradleCommand( gradlewName: string, - cwd: string, - gradlew: Stats | null, args: string | null ): Promise { + const gradlewFile = gradleWrapperFileName(); + const gradlewStat = await statLocalFile(gradlewFile); // istanbul ignore if - if (gradlew?.isFile() === true) { + if (gradlewStat?.isFile() === true) { // if the file is not executable by others - if ((gradlew.mode & 0o1) === 0) { + if ((gradlewStat.mode & 0o1) === 0) { // add the execution permission to the owner, group and others - await chmod(upath.join(cwd, gradlewName), gradlew.mode | 0o111); + await chmodLocalFile(gradlewName, gradlewStat.mode | 0o111); } if (args === null) { return gradlewName; diff --git a/lib/util/fs/index.spec.ts b/lib/util/fs/index.spec.ts index 09b66be3efd876..31c2dc4ecfe503 100644 --- a/lib/util/fs/index.spec.ts +++ b/lib/util/fs/index.spec.ts @@ -6,6 +6,7 @@ import { envMock } from '../../../test/exec-util'; import { env, mockedFunction } from '../../../test/util'; import { GlobalConfig } from '../../config/global'; import { + chmodLocalFile, ensureCacheDir, ensureLocalDir, findLocalSiblingOrParent, @@ -15,6 +16,7 @@ import { localPathIsFile, readLocalDirectory, readLocalFile, + statLocalFile, writeLocalFile, } from '.'; @@ -240,4 +242,40 @@ describe('util/fs/index', () => { expect(res).toBeNull(); }); }); + + describe('chmodLocalFile', () => { + it('works', async () => { + await withDir( + async (tmpDir) => { + GlobalConfig.set({ localDir: tmpDir.path }); + await writeLocalFile('foo', 'bar'); + await chmodLocalFile('foo', 0o000); + expect(await readLocalFile('foo')).toBeNull(); + await chmodLocalFile('foo', 0o444); + expect((await readLocalFile('foo'))!.toString()).toBe('bar'); + }, + { unsafeCleanup: true } + ); + }); + }); + + describe('statLocalFile', () => { + it('works', async () => { + await withDir( + async (tmpDir) => { + GlobalConfig.set({ localDir: tmpDir.path }); + + expect(await statLocalFile('foo')).toBeNull(); + + await writeLocalFile('foo', 'bar'); + await chmodLocalFile('foo', 0o123); + + const res = await statLocalFile('foo'); + expect(res!.isFile()).toBeTrue(); + expect(res!.mode & 0o777).toBe(0o123); + }, + { unsafeCleanup: true } + ); + }); + }); }); diff --git a/lib/util/fs/index.ts b/lib/util/fs/index.ts index ad7076bf6e50aa..2b1f5a3bc5a068 100644 --- a/lib/util/fs/index.ts +++ b/lib/util/fs/index.ts @@ -195,3 +195,24 @@ export async function findUpLocal( // Return null if found file is outside of localDir return null; } + +export function chmodLocalFile( + fileName: string, + mode: string | number +): Promise { + const localDir = GlobalConfig.get('localDir'); + const fullFileName = upath.join(localDir, fileName); + return fs.chmod(fullFileName, mode); +} + +export async function statLocalFile( + fileName: string +): Promise { + const localDir = GlobalConfig.get('localDir'); + const fullFileName = upath.join(localDir, fileName); + try { + return await fs.stat(fullFileName); + } catch (_) { + return null; + } +} diff --git a/lib/util/fs/proxies.ts b/lib/util/fs/proxies.ts index f291ff1e572f0c..3c4e42d330bef0 100644 --- a/lib/util/fs/proxies.ts +++ b/lib/util/fs/proxies.ts @@ -6,14 +6,6 @@ export function stat(path: string | Buffer): Promise { return fs.stat(path); } -// istanbul ignore next -export function chmod( - path: string | Buffer, - mode: string | number -): Promise { - return fs.chmod(path, mode); -} - export async function readFile(fileName: string): Promise; export async function readFile( fileName: string, From bfc393ef000ea40f519688da62c75c4a2d642b31 Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Wed, 29 Jun 2022 09:23:36 +0300 Subject: [PATCH 229/240] refactor(fs): Don't proxy `writeFile` function (#16310) * refactor(fs): Don't proxy `writeFile` function * Fix * Update lib/workers/global/index.spec.ts Co-authored-by: Michael Kriese Co-authored-by: Michael Kriese --- lib/util/fs/proxies.ts | 8 -------- lib/workers/global/index.spec.ts | 7 +++++-- lib/workers/global/index.ts | 3 +-- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/lib/util/fs/proxies.ts b/lib/util/fs/proxies.ts index 3c4e42d330bef0..96cdbf822f2f02 100644 --- a/lib/util/fs/proxies.ts +++ b/lib/util/fs/proxies.ts @@ -18,14 +18,6 @@ export function readFile( return encoding ? fs.readFile(fileName, encoding) : fs.readFile(fileName); } -// istanbul ignore next -export function writeFile( - fileName: string, - fileContent: string -): Promise { - return fs.writeFile(fileName, fileContent); -} - // istanbul ignore next export function outputFile( file: string, diff --git a/lib/workers/global/index.spec.ts b/lib/workers/global/index.spec.ts index 680648a2dcf93d..2ac08c5256539f 100644 --- a/lib/workers/global/index.spec.ts +++ b/lib/workers/global/index.spec.ts @@ -1,6 +1,7 @@ import { expect } from '@jest/globals'; import { ERROR, WARN } from 'bunyan'; -import { fs, logger, mocked } from '../../../test/util'; +import * as _fs from 'fs-extra'; +import { logger, mocked } from '../../../test/util'; import * as _presets from '../../config/presets'; import { PlatformId } from '../../constants'; import { CONFIG_PRESETS_INVALID } from '../../constants/error-messages'; @@ -15,6 +16,9 @@ jest.mock('../repository'); jest.mock('../../util/fs'); jest.mock('../../config/presets'); +jest.mock('fs-extra'); +const fs = mocked(_fs); + // imports are readonly const repositoryWorker = _repositoryWorker; const configParser: jest.Mocked = _configParser as never; @@ -176,7 +180,6 @@ describe('workers/global/index', () => { endpoint: 'https://github.com/', writeDiscoveredRepos: '/tmp/renovate-output.json', }); - fs.writeFile.mockResolvedValueOnce(); expect(await globalWorker.start()).toBe(0); expect(fs.writeFile).toHaveBeenCalledTimes(1); diff --git a/lib/workers/global/index.ts b/lib/workers/global/index.ts index 70a32e5b6eb0c9..8997a11db184c1 100644 --- a/lib/workers/global/index.ts +++ b/lib/workers/global/index.ts @@ -16,7 +16,6 @@ import type { import { CONFIG_PRESETS_INVALID } from '../../constants/error-messages'; import { pkg } from '../../expose.cjs'; import { getProblems, logger, setMeta } from '../../logger'; -import { writeFile } from '../../util/fs'; import * as hostRules from '../../util/host-rules'; import * as repositoryWorker from '../repository'; import { autodiscoverRepositories } from './autodiscover'; @@ -133,7 +132,7 @@ export async function start(): Promise { if (is.nonEmptyString(config.writeDiscoveredRepos)) { const content = JSON.stringify(config.repositories); - await writeFile(config.writeDiscoveredRepos, content); + await fs.writeFile(config.writeDiscoveredRepos, content); logger.info( `Written discovered repositories to ${config.writeDiscoveredRepos}` ); From 11f41825ca231d3c6ce402e5c0b3326632115ef7 Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Wed, 29 Jun 2022 10:57:44 +0300 Subject: [PATCH 230/240] fix(fs): Windows CI tests (#16318) --- lib/util/fs/index.spec.ts | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/lib/util/fs/index.spec.ts b/lib/util/fs/index.spec.ts index 31c2dc4ecfe503..1829545a736ca4 100644 --- a/lib/util/fs/index.spec.ts +++ b/lib/util/fs/index.spec.ts @@ -243,36 +243,41 @@ describe('util/fs/index', () => { }); }); - describe('chmodLocalFile', () => { + describe('statLocalFile', () => { it('works', async () => { await withDir( async (tmpDir) => { GlobalConfig.set({ localDir: tmpDir.path }); + + expect(await statLocalFile('foo')).toBeNull(); + await writeLocalFile('foo', 'bar'); - await chmodLocalFile('foo', 0o000); - expect(await readLocalFile('foo')).toBeNull(); - await chmodLocalFile('foo', 0o444); - expect((await readLocalFile('foo'))!.toString()).toBe('bar'); + const stat = await statLocalFile('foo'); + expect(stat).toBeDefined(); + expect(stat!.isFile()).toBeTrue(); }, { unsafeCleanup: true } ); }); }); - describe('statLocalFile', () => { + describe('chmodLocalFile', () => { it('works', async () => { await withDir( async (tmpDir) => { GlobalConfig.set({ localDir: tmpDir.path }); - - expect(await statLocalFile('foo')).toBeNull(); - await writeLocalFile('foo', 'bar'); - await chmodLocalFile('foo', 0o123); + let stat = await statLocalFile('foo'); + const oldMode = stat!.mode & 0o777; + const newMode = oldMode & 0o555; // Remove `write` attributes (Windows-compatible) + + await chmodLocalFile('foo', newMode); + stat = await statLocalFile('foo'); + expect(stat!.mode & 0o777).toBe(newMode); - const res = await statLocalFile('foo'); - expect(res!.isFile()).toBeTrue(); - expect(res!.mode & 0o777).toBe(0o123); + await chmodLocalFile('foo', oldMode); + stat = await statLocalFile('foo'); + expect(stat!.mode & 0o777).toBe(oldMode); }, { unsafeCleanup: true } ); From 61aebaf0bbf2978bb911d74ef3e713139f283c46 Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Wed, 29 Jun 2022 11:39:57 +0200 Subject: [PATCH 231/240] fix: filter out rollback if followTag is true (#16296) --- lib/workers/repository/process/lookup/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/workers/repository/process/lookup/index.ts b/lib/workers/repository/process/lookup/index.ts index 157f31062cc207..d715332cfd109c 100644 --- a/lib/workers/repository/process/lookup/index.ts +++ b/lib/workers/repository/process/lookup/index.ts @@ -394,6 +394,12 @@ export async function lookupUpdates( (update) => update.newValue === currentValue ); } + // Handle a weird edge case involving followTag and fallbacks + if (rollbackPrs && followTag) { + res.updates = res.updates.filter( + (update) => res.updates.length === 1 || update.updateType !== 'rollback' + ); + } } catch (err) /* istanbul ignore next */ { if (err instanceof ExternalHostError || err.message === CONFIG_VALIDATION) { throw err; From 0d7c4300da8a6b99ffb097a4f95782d31865acc2 Mon Sep 17 00:00:00 2001 From: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Date: Wed, 29 Jun 2022 11:40:26 +0200 Subject: [PATCH 232/240] docs(presets): rewrite gitSignOff description (#16302) --- lib/config/presets/internal/default.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/config/presets/internal/default.ts b/lib/config/presets/internal/default.ts index f4aab01d38e701..7fb49dd7d31ae8 100644 --- a/lib/config/presets/internal/default.ts +++ b/lib/config/presets/internal/default.ts @@ -421,8 +421,7 @@ export const presets: Record = { }, }, gitSignOff: { - description: - 'Append Git Signed-off-by: signature to Git commits.', + description: 'Append `Signed-off-by:` to signoff Git commits.', commitBody: 'Signed-off-by: {{{gitAuthor}}}', }, npm: { From c2fbed9cd3d313efcbe4e67104aa6e3d9557ad8a Mon Sep 17 00:00:00 2001 From: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Date: Wed, 29 Jun 2022 12:07:55 +0200 Subject: [PATCH 233/240] docs(config options): rewrite `followTag` section (#16324) --- docs/usage/configuration-options.md | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index a3ae0ce688e2c6..cec8095debea21 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -825,13 +825,26 @@ For now, you can only use this option on the GitLab platform. Advanced functionality. Only use this if you're sure you know what you're doing. -This functionality requires that the datasource to support distribution streams/tags, such as npm does. +For `followTag` to work, the datasource must support distribution streams or tags, like for example npm does. -The primary use case for this option is if you are following a pre-release tag of a certain dependency, e.g. `typescript`'s `"insiders"` build. -If configured, Renovate bypasses its normal major/minor/patch upgrade logic and stable/unstable consistency logic and keeps your dependency version sync'd strictly to whatever version is in the tag. +The main usecase is to follow a pre-release tag of a dependency, say TypeScripts's `"insiders"` build: -Beware that Renovate follows tags strictly. -For example, if you are following a tag like `next` and then that stream is released as `stable` and `next` is no longer being updated then that means your dependencies also won't be getting updated. +```json +{ + "packageRules": [ + { + "matchPackageNames": ["typescript"], + "followTag": "insiders" + } + ] +} +``` + +If you've set a `followTag` then Renovate skips its normal major/minor/patch upgrade logic and stable/unstable consistency logic, and instead keeps your dependency version synced _strictly_ to the version in the tag. + +Renovate follows tags _strictly_, this can cause problems when a tagged stream is no longer maintained. +For example: you're following the `next` tag, but later the stream you actually want is called `stable` instead. +If `next` is no longer getting updates, you must switch your `followTag` to `stable` to get updates again. ## gitAuthor From 99b16becafc129d727e3eca8402ce7ec5891d75a Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Wed, 29 Jun 2022 13:18:12 +0200 Subject: [PATCH 234/240] refactor: remove unused properties (#16328) --- .../bazel/__snapshots__/extract.spec.ts.snap | 17 ----------------- lib/modules/manager/bazel/extract.ts | 3 +-- .../extract/__snapshots__/index.spec.ts.snap | 9 --------- lib/modules/manager/npm/extract/index.ts | 1 - lib/modules/manager/types.ts | 2 -- 5 files changed, 1 insertion(+), 31 deletions(-) diff --git a/lib/modules/manager/bazel/__snapshots__/extract.spec.ts.snap b/lib/modules/manager/bazel/__snapshots__/extract.spec.ts.snap index 73caee37c68cbd..8bf9586e76082e 100644 --- a/lib/modules/manager/bazel/__snapshots__/extract.spec.ts.snap +++ b/lib/modules/manager/bazel/__snapshots__/extract.spec.ts.snap @@ -44,7 +44,6 @@ Array [ )", }, "packageName": "google/subpar", - "repo": "google/subpar", }, Object { "currentValue": "0.6.0", @@ -60,7 +59,6 @@ Array [ )", }, "packageName": "bazelbuild/bazel-skylib", - "repo": "bazelbuild/bazel-skylib", }, Object { "currentValue": "0.5.0", @@ -79,7 +77,6 @@ Array [ )", }, "packageName": "bazelbuild/stardoc", - "repo": "bazelbuild/stardoc", }, ] `; @@ -100,7 +97,6 @@ Array [ )", }, "packageName": "lmirosevic/GBDeviceInfo", - "repo": "lmirosevic/GBDeviceInfo", }, Object { "currentDigest": "135d46b4c9423ee7d494c78a21ff621bc73c12f3", @@ -116,7 +112,6 @@ Array [ )", }, "packageName": "nelhage/rules_boost", - "repo": "nelhage/rules_boost", }, Object { "currentValue": "6.3.0", @@ -132,7 +127,6 @@ Array [ )", }, "packageName": "lmirosevic/GBDeviceInfo", - "repo": "lmirosevic/GBDeviceInfo", }, Object { "currentDigest": "135d46b4c9423ee7d494c78a21ff621bc73c12f3", @@ -148,7 +142,6 @@ Array [ )", }, "packageName": "nelhage/rules_boost", - "repo": "nelhage/rules_boost", }, Object { "currentValue": "v0.29.0", @@ -164,7 +157,6 @@ Array [ )", }, "packageName": "bazelbuild/rules_go", - "repo": "bazelbuild/rules_go", }, ] `; @@ -258,7 +250,6 @@ Array [ )", }, "packageName": "GoogleContainerTools/distroless", - "repo": "GoogleContainerTools/distroless", }, Object { "currentDigest": "d665ccfa3e9c90fa789671bf4ef5f7c19c5715c4", @@ -277,7 +268,6 @@ Array [ )", }, "packageName": "bazelbuild/bazel-toolchains", - "repo": "bazelbuild/bazel-toolchains", }, Object { "currentValue": "0.0.3", @@ -321,7 +311,6 @@ Array [ )", }, "packageName": "bazelbuild/rules_go", - "repo": "bazelbuild/rules_go", }, Object { "currentValue": "0.5.0", @@ -340,7 +329,6 @@ Array [ )", }, "packageName": "bazelbuild/bazel-skylib", - "repo": "bazelbuild/bazel-skylib", }, Object { "currentDigest": "446923c3756ceeaa75888f52fcbdd48bb314fbf8", @@ -356,7 +344,6 @@ Array [ )", }, "packageName": "GoogleContainerTools/distroless", - "repo": "GoogleContainerTools/distroless", }, Object { "currentValue": "v0.29.0", @@ -372,7 +359,6 @@ Array [ )", }, "packageName": "bazelbuild/rules_go", - "repo": "bazelbuild/rules_go", }, Object { "currentValue": "v0.24.0", @@ -391,7 +377,6 @@ Array [ )", }, "packageName": "bazelbuild/bazel-gazelle", - "repo": "bazelbuild/bazel-gazelle", }, Object { "currentDigest": "816c9085562cd7ee03e7f8188a1cfd942858cded", @@ -446,7 +431,6 @@ Array [ )", }, "packageName": "GoogleContainerTools/distroless", - "repo": "GoogleContainerTools/distroless", }, ] `; @@ -467,7 +451,6 @@ Array [ )", }, "packageName": "nelhage/rules_boost", - "repo": "nelhage/rules_boost", }, ] `; diff --git a/lib/modules/manager/bazel/extract.ts b/lib/modules/manager/bazel/extract.ts index 0833ecd38132b3..8562cd9aaeeddc 100644 --- a/lib/modules/manager/bazel/extract.ts +++ b/lib/modules/manager/bazel/extract.ts @@ -294,14 +294,13 @@ export function extractPackageFile( return; } dep.depName = depName; - dep.repo = parsedUrl.repo; if (regEx(/^[a-f0-9]{40}$/i).test(parsedUrl.currentValue)) { dep.currentDigest = parsedUrl.currentValue; } else { dep.currentValue = parsedUrl.currentValue; } dep.datasource = parsedUrl.datasource; - dep.packageName = dep.repo; + dep.packageName = parsedUrl.repo; deps.push(dep); } else if ( depType === 'container_pull' && diff --git a/lib/modules/manager/npm/extract/__snapshots__/index.spec.ts.snap b/lib/modules/manager/npm/extract/__snapshots__/index.spec.ts.snap index 0628a164eed571..83fe49cb5f9960 100644 --- a/lib/modules/manager/npm/extract/__snapshots__/index.spec.ts.snap +++ b/lib/modules/manager/npm/extract/__snapshots__/index.spec.ts.snap @@ -178,7 +178,6 @@ Object { "depName": "c", "depType": "dependencies", "gitRef": true, - "githubRepo": "owner/c", "packageName": "owner/c", "pinDigests": false, "prettyDepType": "dependency", @@ -199,7 +198,6 @@ Object { "depName": "e", "depType": "dependencies", "gitRef": true, - "githubRepo": "owner/e", "packageName": "owner/e", "prettyDepType": "dependency", "sourceUrl": "https://github.com/owner/e", @@ -211,7 +209,6 @@ Object { "depName": "f", "depType": "dependencies", "gitRef": true, - "githubRepo": "owner/f", "packageName": "owner/f", "pinDigests": false, "prettyDepType": "dependency", @@ -253,7 +250,6 @@ Object { "depName": "k", "depType": "dependencies", "gitRef": true, - "githubRepo": "owner/k", "packageName": "owner/k", "prettyDepType": "dependency", "sourceUrl": "https://github.com/owner/k", @@ -266,7 +262,6 @@ Object { "depName": "l", "depType": "dependencies", "gitRef": true, - "githubRepo": "owner/l", "packageName": "owner/l", "prettyDepType": "dependency", "sourceUrl": "https://github.com/owner/l", @@ -278,7 +273,6 @@ Object { "depName": "m", "depType": "dependencies", "gitRef": true, - "githubRepo": "owner/m", "packageName": "owner/m", "pinDigests": false, "prettyDepType": "dependency", @@ -291,7 +285,6 @@ Object { "depName": "n", "depType": "dependencies", "gitRef": true, - "githubRepo": "owner/n", "packageName": "owner/n", "pinDigests": false, "prettyDepType": "dependency", @@ -304,7 +297,6 @@ Object { "depName": "o", "depType": "dependencies", "gitRef": true, - "githubRepo": "owner/o", "packageName": "owner/o", "pinDigests": false, "prettyDepType": "dependency", @@ -317,7 +309,6 @@ Object { "depName": "p", "depType": "dependencies", "gitRef": true, - "githubRepo": "Owner/P", "packageName": "Owner/P", "pinDigests": false, "prettyDepType": "dependency", diff --git a/lib/modules/manager/npm/extract/index.ts b/lib/modules/manager/npm/extract/index.ts index cd15aebd610ae0..023f81b8773b47 100644 --- a/lib/modules/manager/npm/extract/index.ts +++ b/lib/modules/manager/npm/extract/index.ts @@ -334,7 +334,6 @@ export async function extractPackageFile( dep.skipReason = 'unversioned-reference'; return dep; } - dep.githubRepo = githubOwnerRepo; dep.sourceUrl = `https://github.com/${githubOwnerRepo}`; dep.gitRef = true; return dep; diff --git a/lib/modules/manager/types.ts b/lib/modules/manager/types.ts index 6ee514be284b9d..38b81ff98041c0 100644 --- a/lib/modules/manager/types.ts +++ b/lib/modules/manager/types.ts @@ -98,7 +98,6 @@ export interface Package extends ManagerData { groupName?: string; lineNumber?: number; packageName?: string | null; - repo?: string; target?: string; versioning?: string; dataType?: string; @@ -109,7 +108,6 @@ export interface Package extends ManagerData { packageFileVersion?: string; gitRef?: boolean; sourceUrl?: string | null; - githubRepo?: string; pinDigests?: boolean; currentRawValue?: string; major?: { enabled?: boolean }; From 12395f4a7b2b8e78a9fa1a2679e0a19241b13fca Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 29 Jun 2022 12:38:11 +0000 Subject: [PATCH 235/240] build(deps): update dependency simple-git to v3.9.0 (#16330) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index f54d17cc06526f..ba158859112838 100644 --- a/package.json +++ b/package.json @@ -204,7 +204,7 @@ "semver-stable": "3.0.0", "semver-utils": "1.1.4", "shlex": "2.1.0", - "simple-git": "3.8.0", + "simple-git": "3.9.0", "slugify": "1.6.5", "traverse": "0.6.6", "tslib": "2.4.0", diff --git a/yarn.lock b/yarn.lock index 68c73cbd384a47..850de80ea600fd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8496,10 +8496,10 @@ signale@^1.2.1: figures "^2.0.0" pkg-conf "^2.1.0" -simple-git@3.8.0: - version "3.8.0" - resolved "https://registry.yarnpkg.com/simple-git/-/simple-git-3.8.0.tgz#d93500f3d792cec365420c80ddc6cb782edf737d" - integrity sha512-nbR1PufcbvCaW90CiAXC1mM7OnEqLzjSOnySnq7Sd2kcVG6GxSa+DhxhFmCgxLv4kWCKmZagkCZSjfNAQTZwaw== +simple-git@3.9.0: + version "3.9.0" + resolved "https://registry.yarnpkg.com/simple-git/-/simple-git-3.9.0.tgz#0b29fa5b6749d32b6ce95ea2faaac359f5fce25d" + integrity sha512-twG3rcFMYASct3mJcCP8KBtmtN7V2s6cdO5IXVAe/ffIu6TjdkdVnatR+PGmcirKXiK5y28eIdCVF0i3UQypfQ== dependencies: "@kwsites/file-exists" "^1.1.1" "@kwsites/promise-deferred" "^1.1.1" From e174ad084b633e82d3a1f4a5f56241ea843d0ba8 Mon Sep 17 00:00:00 2001 From: Hasan Awad <90554456+hasanwhitesource@users.noreply.github.com> Date: Wed, 29 Jun 2022 18:31:49 +0300 Subject: [PATCH 236/240] feat(config/presets): add memory caching for config fetching (#16274) --- lib/config/presets/index.spec.ts | 39 ++++++++++++++++++++++++++++++++ lib/config/presets/index.ts | 20 ++++++++++------ 2 files changed, 52 insertions(+), 7 deletions(-) diff --git a/lib/config/presets/index.spec.ts b/lib/config/presets/index.spec.ts index 64290cf42174ef..5b1d3f333017a6 100644 --- a/lib/config/presets/index.spec.ts +++ b/lib/config/presets/index.spec.ts @@ -1,6 +1,8 @@ import { Fixtures } from '../../../test/fixtures'; import { mocked } from '../../../test/util'; +import * as memCache from '../../util/cache/memory'; import type { RenovateConfig } from '../types'; +import * as _github from './github'; import * as _local from './local'; import * as _npm from './npm'; import { @@ -17,6 +19,7 @@ jest.mock('./local'); const npm = mocked(_npm); const local = mocked(_local); +const gitHub = mocked(_github); const presetIkatyang = Fixtures.getJson('renovate-config-ikatyang.json'); @@ -48,6 +51,7 @@ describe('config/presets/index', () => { beforeEach(() => { config = {}; jest.clearAllMocks(); + memCache.init(); }); it('returns same if no presets', async () => { @@ -307,6 +311,41 @@ describe('config/presets/index', () => { labels: ['self-hosted resolved'], }); }); + + it('gets preset value from cache when it has been seen', async () => { + config.extends = ['github>username/preset-repo']; + config.packageRules = [ + { + matchManagers: ['github-actions'], + groupName: 'github-actions dependencies', + }, + ]; + gitHub.getPreset.mockResolvedValueOnce({ + packageRules: [ + { + matchDatasources: ['docker'], + matchPackageNames: ['ubi'], + versioning: 'regex', + }, + ], + }); + + expect(await presets.resolveConfigPresets(config)).toBeDefined(); + const res = await presets.resolveConfigPresets(config); + expect(res).toEqual({ + packageRules: [ + { + matchDatasources: ['docker'], + matchPackageNames: ['ubi'], + versioning: 'regex', + }, + { + matchManagers: ['github-actions'], + groupName: 'github-actions dependencies', + }, + ], + }); + }); }); describe('replaceArgs', () => { diff --git a/lib/config/presets/index.ts b/lib/config/presets/index.ts index 64594367e69c4c..9736ecc1c2c14f 100644 --- a/lib/config/presets/index.ts +++ b/lib/config/presets/index.ts @@ -5,6 +5,7 @@ import { } from '../../constants/error-messages'; import { logger } from '../../logger'; import { ExternalHostError } from '../../types/errors/external-host-error'; +import * as memCache from '../../util/cache/memory'; import { clone } from '../../util/clone'; import { regEx } from '../../util/regex'; import * as massage from '../massage'; @@ -18,7 +19,7 @@ import * as gitlab from './gitlab'; import * as internal from './internal'; import * as local from './local'; import * as npm from './npm'; -import type { ParsedPreset, PresetApi } from './types'; +import type { ParsedPreset, Preset, PresetApi } from './types'; import { PRESET_DEP_NOT_FOUND, PRESET_INVALID, @@ -218,12 +219,17 @@ export async function getPreset( } const { presetSource, repo, presetPath, presetName, tag, params } = parsePreset(preset); - let presetConfig = await presetSources[presetSource].getPreset({ - repo, - presetPath, - presetName, - tag, - }); + const cacheKey = `preset:${preset}`; + let presetConfig = memCache.get(cacheKey); + if (is.nullOrUndefined(presetConfig)) { + presetConfig = await presetSources[presetSource].getPreset({ + repo, + presetPath, + presetName, + tag, + }); + memCache.set(cacheKey, presetConfig); + } if (!presetConfig) { throw new Error(PRESET_DEP_NOT_FOUND); } From 5b115d41c3c9dd66ecc97f1f84373430d1041e44 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 30 Jun 2022 00:45:01 +0000 Subject: [PATCH 237/240] build(deps): update dependency find-packages to v9.0.5 (#16335) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 42 +++++++++++++++++++++--------------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/package.json b/package.json index ba158859112838..e6339412499fbe 100644 --- a/package.json +++ b/package.json @@ -167,7 +167,7 @@ "emojibase-regex": "6.0.1", "extract-zip": "2.0.1", "fast-safe-stringify": "2.1.1", - "find-packages": "9.0.4", + "find-packages": "9.0.5", "find-up": "5.0.0", "fs-extra": "10.1.0", "git-url-parse": "11.6.0", diff --git a/yarn.lock b/yarn.lock index 850de80ea600fd..1a6bb45c6153e0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1990,15 +1990,15 @@ dependencies: graceful-fs "^4.2.6" -"@pnpm/read-project-manifest@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@pnpm/read-project-manifest/-/read-project-manifest-3.0.4.tgz#111e315b32c2f951a53dd029249d1463ccf503ad" - integrity sha512-YtPdr82a1mrgQJefX3XZ8mp8yl9h50HTvyl3eqHjiZUB53ey1iFvkSzd9UjAeq2opeAnWeUK8JlMW/10KkUS1g== +"@pnpm/read-project-manifest@3.0.5": + version "3.0.5" + resolved "https://registry.yarnpkg.com/@pnpm/read-project-manifest/-/read-project-manifest-3.0.5.tgz#0b395e40772b7966bb16aaf75f6401c9e64d3a04" + integrity sha512-wskWUcxkjnOrDb7WFMcAZkQIUX4TG6a2+SSVLqYl6CAHgTRRwXUO4lCUBJhYCWuiiRvVoa1hzS/7cN42ZsT3mA== dependencies: "@pnpm/error" "3.0.1" "@pnpm/graceful-fs" "2.0.0" - "@pnpm/types" "8.2.0" - "@pnpm/write-project-manifest" "3.0.3" + "@pnpm/types" "8.3.0" + "@pnpm/write-project-manifest" "3.0.4" detect-indent "^6.0.0" fast-deep-equal "^3.1.3" is-windows "^1.0.2" @@ -2008,17 +2008,17 @@ sort-keys "^4.2.0" strip-bom "^4.0.0" -"@pnpm/types@8.2.0": - version "8.2.0" - resolved "https://registry.yarnpkg.com/@pnpm/types/-/types-8.2.0.tgz#752d19befb91e3358df303c44a3e0d8a6c5ff20b" - integrity sha512-Lr976vR4mezo3iL4bwGXyZFaDuVhkoko1Dr159mj+/GrqghiVmZFSZQQZNkfWEvMq1v3NSCTtPPzMTZASKJzCg== +"@pnpm/types@8.3.0": + version "8.3.0" + resolved "https://registry.yarnpkg.com/@pnpm/types/-/types-8.3.0.tgz#ef17c7c3569b2ea00ae122ff2d7fafa4f4185de2" + integrity sha512-RCO4nOX4N3C4RtWybxJ9WA2P/xQEeM7IhVP/b8WFkj9SJh2BH62HLoouWyf60XCB33pc+9yJpG//oZNHSQS7TA== -"@pnpm/write-project-manifest@3.0.3": - version "3.0.3" - resolved "https://registry.yarnpkg.com/@pnpm/write-project-manifest/-/write-project-manifest-3.0.3.tgz#1722e412bbffe12456ecfeaddf5f9ec1eb945403" - integrity sha512-nQBL/6iXTDOI3pYIUEb0VQLhjvgklpdstKP1fup5NuYUsvlNProVnWxHVxaU3y7kdAFcHGrHXJY4twLRX+pk8Q== +"@pnpm/write-project-manifest@3.0.4": + version "3.0.4" + resolved "https://registry.yarnpkg.com/@pnpm/write-project-manifest/-/write-project-manifest-3.0.4.tgz#c505f35d4d8549868df8d952f77f146a48eb5f4c" + integrity sha512-HO3dFnJfqUYp3Ix1p72hvWmBKnGZSVZAn/Nsqd/aw6OC9XIzlNAufeXQ26t9HRobXDmZyt8B5uk8wqAPLfdyCA== dependencies: - "@pnpm/types" "8.2.0" + "@pnpm/types" "8.3.0" json5 "^2.1.3" write-file-atomic "^3.0.3" write-yaml-file "^4.2.0" @@ -4701,13 +4701,13 @@ filter-obj@^1.1.0: resolved "https://registry.yarnpkg.com/filter-obj/-/filter-obj-1.1.0.tgz#9b311112bc6c6127a16e016c6c5d7f19e0805c5b" integrity sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ== -find-packages@9.0.4: - version "9.0.4" - resolved "https://registry.yarnpkg.com/find-packages/-/find-packages-9.0.4.tgz#f6429c8cf5dae0062d621360b8b7284c6ce7427a" - integrity sha512-+C7ND27Yv2L1ZyJFN1SV1Odkeo0YS8xIN6TPD3AMAIqtCe30BsPyOkYuhKLO5/Q7mtc14IIOmD1DP8+v3CYcpQ== +find-packages@9.0.5: + version "9.0.5" + resolved "https://registry.yarnpkg.com/find-packages/-/find-packages-9.0.5.tgz#97b9bcc4ec5e1612413bac6c4dafa29084f51d59" + integrity sha512-8A//5HSwbnmgOvyvTVWB+SNt/sPRBMZRr0EJ+xzylqHXUtGzV37HSFRTRWj0SgpY/8mW8GVoY1Grb6hysWEpWw== dependencies: - "@pnpm/read-project-manifest" "3.0.4" - "@pnpm/types" "8.2.0" + "@pnpm/read-project-manifest" "3.0.5" + "@pnpm/types" "8.3.0" fast-glob "^3.2.4" p-filter "^2.1.0" From 3b8bd95fe806c19e496d8e53b942a3af1db3ae30 Mon Sep 17 00:00:00 2001 From: Johannes Feichtner Date: Thu, 30 Jun 2022 07:06:22 +0200 Subject: [PATCH 238/240] fix: add return value for additionalRegistryURLs concat in resolveRegistryUrls (#16334) --- lib/modules/datasource/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/modules/datasource/index.ts b/lib/modules/datasource/index.ts index 2baaeb7f35973b..1595806132f99c 100644 --- a/lib/modules/datasource/index.ts +++ b/lib/modules/datasource/index.ts @@ -219,13 +219,13 @@ function resolveRegistryUrls( resolvedUrls = [...customUrls]; } else if (is.nonEmptyArray(defaultRegistryUrls)) { resolvedUrls = [...defaultRegistryUrls]; - resolvedUrls.concat(additionalRegistryUrls ?? []); + resolvedUrls = resolvedUrls.concat(additionalRegistryUrls ?? []); } else if (is.function_(datasource.defaultRegistryUrls)) { resolvedUrls = [...datasource.defaultRegistryUrls()]; - resolvedUrls.concat(additionalRegistryUrls ?? []); + resolvedUrls = resolvedUrls.concat(additionalRegistryUrls ?? []); } else if (is.nonEmptyArray(datasource.defaultRegistryUrls)) { resolvedUrls = [...datasource.defaultRegistryUrls]; - resolvedUrls.concat(additionalRegistryUrls ?? []); + resolvedUrls = resolvedUrls.concat(additionalRegistryUrls ?? []); } return massageRegistryUrls(resolvedUrls); } From 432a888cdba985a6ec5a6e425e6f21533dcd188d Mon Sep 17 00:00:00 2001 From: Yun Lai Date: Thu, 30 Jun 2022 17:54:48 +1000 Subject: [PATCH 239/240] fix: make http.stream apply hostRules & authentication (#16255) * fix(http): support asset download via octet-stream header in github http * Update lib/util/http/github.spec.ts Co-authored-by: Sergei Zharinov * fix: make http.stream apply hostRules & authentication * chore: fix disable host test for http.stream * Update lib/util/http/index.ts Co-authored-by: Rhys Arkins Co-authored-by: Sergei Zharinov Co-authored-by: Michael Kriese --- lib/util/http/index.spec.ts | 8 ++++++++ lib/util/http/index.ts | 9 ++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/util/http/index.spec.ts b/lib/util/http/index.spec.ts index d90ff7ac0b469e..d665e4b269f7e0 100644 --- a/lib/util/http/index.spec.ts +++ b/lib/util/http/index.spec.ts @@ -172,6 +172,14 @@ describe('util/http/index', () => { expect(httpMock.allUsed()).toBeTrue(); }); + it('disables hosts for stream', () => { + hostRules.add({ matchHost: 'renovate.com', enabled: false }); + + expect(() => http.stream('http://renovate.com/test')).toThrow( + HOST_DISABLED + ); + }); + it('retries', async () => { const NODE_ENV = process.env.NODE_ENV; try { diff --git a/lib/util/http/index.ts b/lib/util/http/index.ts index adf4eaf4e59a6c..76887143804bde 100644 --- a/lib/util/http/index.ts +++ b/lib/util/http/index.ts @@ -269,7 +269,8 @@ export class Http { } stream(url: string, options?: HttpOptions): NodeJS.ReadableStream { - const combinedOptions: any = { + // TODO: fix types (#7154) + let combinedOptions: any = { method: 'get', ...this.options, hostType: this.hostType, @@ -283,6 +284,12 @@ export class Http { } applyDefaultHeaders(combinedOptions); + combinedOptions = applyHostRules(resolvedUrl, combinedOptions); + if (combinedOptions.enabled === false) { + throw new Error(HOST_DISABLED); + } + combinedOptions = applyAuthorization(combinedOptions); + return got.stream(resolvedUrl, combinedOptions); } } From 1261d7039012d103fd24013c3b984fce8a84d19d Mon Sep 17 00:00:00 2001 From: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Date: Thu, 30 Jun 2022 11:37:50 +0200 Subject: [PATCH 240/240] docs(manager/regex): link to our Handlebars helpers (#16340) --- lib/modules/manager/regex/readme.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/modules/manager/regex/readme.md b/lib/modules/manager/regex/readme.md index 8543a9685c6dbe..44086feed2d896 100644 --- a/lib/modules/manager/regex/readme.md +++ b/lib/modules/manager/regex/readme.md @@ -6,6 +6,9 @@ This manager is unique in Renovate in that: - Through the use of the `regexManagers` config, multiple "regex managers" can be created for the same repository - It can extract any `datasource` +We have [additional Handlebars helpers](https://docs.renovatebot.com/templates/#additional-handlebars-helpers) which help you perform common transformations on the regex manager's template fields. +Also read the documentation for the [`regexManagers` config option](https://docs.renovatebot.com/configuration-options/#regexmanagers). + ### Required Fields The first two required fields are `fileMatch` and `matchStrings`.