Skip to content

Commit

Permalink
Merge branch 'main' into refactor/remove-normalize-date-fn
Browse files Browse the repository at this point in the history
  • Loading branch information
zharinov committed Jan 13, 2025
2 parents 9a1408a + 76ff1df commit 3c42489
Show file tree
Hide file tree
Showing 42 changed files with 2,562 additions and 2,273 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ concurrency:
env:
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
NODE_VERSION: 22
PDM_VERSION: 2.22.1 # renovate: datasource=pypi depName=pdm
PDM_VERSION: 2.22.2 # renovate: datasource=pypi depName=pdm
DRY_RUN: true
TEST_LEGACY_DECRYPTION: true
SPARSE_CHECKOUT: |-
Expand Down Expand Up @@ -304,7 +304,7 @@ jobs:
os: ${{ runner.os }}

- name: Lint markdown
uses: DavidAnson/markdownlint-cli2-action@eb5ca3ab411449c66620fe7f1b3c9e10547144b0 # v18.0.0
uses: DavidAnson/markdownlint-cli2-action@a23dae216ce3fee4db69da41fed90d2a4af801cf # v19.0.0

- name: Lint fenced code blocks
run: pnpm doc-fence-check
Expand Down Expand Up @@ -411,7 +411,7 @@ jobs:
- name: Save coverage artifacts
if: (success() || failure()) && github.event.pull_request.draft != true && matrix.coverage
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: ${{ matrix.upload-artifact-name }}
path: |
Expand Down Expand Up @@ -567,7 +567,7 @@ jobs:
run: pnpm test-e2e:pack

- name: Upload
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: renovate-package
path: renovate-0.0.0-semantic-release.tgz
Expand Down Expand Up @@ -611,7 +611,7 @@ jobs:
run: pnpm test:docs

- name: Upload
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: docs
path: tmp/docs/
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
uses: github/codeql-action/init@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1
with:
languages: javascript

Expand All @@ -51,7 +51,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@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
uses: github/codeql-action/autobuild@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -65,4 +65,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
uses: github/codeql-action/analyze@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1
4 changes: 2 additions & 2 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: 'Upload artifact'
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard.
- name: 'Upload to code-scanning'
uses: github/codeql-action/upload-sarif@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
uses: github/codeql-action/upload-sarif@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1
with:
sarif_file: results.sarif
2 changes: 1 addition & 1 deletion .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
format: 'sarif'
output: 'trivy-results.sarif'

- uses: github/codeql-action/upload-sarif@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
- uses: github/codeql-action/upload-sarif@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1
with:
sarif_file: trivy-results.sarif
category: 'docker-image-${{ matrix.tag }}'
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22.11.0
22.13.0
2 changes: 1 addition & 1 deletion docs/usage/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ Make sure to install the Google Cloud SDK into the custom image, as you need the
For example:

```Dockerfile
FROM renovate/renovate:39.91.0
FROM renovate/renovate:39.104.1
# Include the "Docker tip" which you can find here https://cloud.google.com/sdk/docs/install
# under "Installation" for "Debian/Ubuntu"
RUN ...
Expand Down
10 changes: 5 additions & 5 deletions docs/usage/examples/self-hosting.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ It builds `latest` based on the `main` branch and all SemVer tags are published
```sh title="Example of valid tags"
docker run --rm renovate/renovate
docker run --rm renovate/renovate:39
docker run --rm renovate/renovate:39.91
docker run --rm renovate/renovate:39.91.0
docker run --rm renovate/renovate:39.104
docker run --rm renovate/renovate:39.104.1
```

<!-- prettier-ignore -->
Expand Down Expand Up @@ -62,7 +62,7 @@ spec:
- name: renovate
# Update this to the latest available and then enable Renovate on
# the manifest
image: renovate/renovate:39.91.0
image: renovate/renovate:39.104.1
args:
- user/repo
# Environment Variables
Expand Down Expand Up @@ -121,7 +121,7 @@ spec:
template:
spec:
containers:
- image: renovate/renovate:39.91.0
- image: renovate/renovate:39.104.1
name: renovate-bot
env: # For illustration purposes, please use secrets.
- name: RENOVATE_PLATFORM
Expand Down Expand Up @@ -367,7 +367,7 @@ spec:
containers:
- name: renovate
# Update this to the latest available and then enable Renovate on the manifest
image: renovate/renovate:39.91.0
image: renovate/renovate:39.104.1
volumeMounts:
- name: ssh-key-volume
readOnly: true
Expand Down
1 change: 1 addition & 0 deletions lib/data/monorepo.json
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,7 @@
"strapi": "https://github.com/strapi/strapi",
"strum": "https://github.com/Peternator7/strum",
"stryker-js": "https://github.com/stryker-mutator/stryker-js",
"stylex-swc": "https://github.com/Dwlad90/stylex-swc-plugin",
"surveyjs": "https://github.com/surveyjs/surveyjs",
"swashbuckle-aspnetcore": "https://github.com/domaindrivendev/Swashbuckle.AspNetCore",
"system.io.abstractions": "https://github.com/System-IO-Abstractions/System.IO.Abstractions/",
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/datasource/azure-pipelines-tasks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class AzurePipelinesTasksDatasource extends Datasource {
key: (url: string) => url,
ttlMinutes: 24 * 60,
})
async getTasks<ResT, Schema extends ZodType<ResT> = ZodType<ResT>>(
async getTasks<Schema extends ZodType>(
url: string,
opts: HttpOptions,
schema: Schema,
Expand Down
5 changes: 1 addition & 4 deletions lib/modules/datasource/bitrise/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { parseGitUrl } from '../../../util/git/url';
import { GithubHttp } from '../../../util/http/github';
import { fromBase64 } from '../../../util/string';
import { joinUrlParts } from '../../../util/url';
import { parseSingleYaml } from '../../../util/yaml';
import { GithubContentResponse } from '../../platform/github/schema';
import semver from '../../versioning/semver';
import { Datasource } from '../datasource';
Expand Down Expand Up @@ -111,9 +110,7 @@ export class BitriseDatasource extends Datasource {
}

const content = fromBase64(body.content);
const { published_at, source_code_url } = parseSingleYaml(content, {
customSchema: BitriseStepFile,
});
const { published_at, source_code_url } = BitriseStepFile.parse(content);

result.releases.push({
version: versionDir.name,
Expand Down
11 changes: 7 additions & 4 deletions lib/modules/datasource/bitrise/schema.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { z } from 'zod';
import { Yaml } from '../../../util/schema-utils';

export const BitriseStepFile = z.object({
published_at: z.string(),
source_code_url: z.string().optional(),
});
export const BitriseStepFile = Yaml.pipe(
z.object({
published_at: z.string(),
source_code_url: z.string().optional(),
}),
);
2 changes: 1 addition & 1 deletion lib/modules/datasource/conan/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const defaultRegistryUrl = 'https://center2.conan.io/';
export const datasource = 'conan';

export const conanDatasourceRegex = regEx(
/(?<name>[a-zA-Z\-_0-9]+)\/(?<version>[^@/\n]+)(?<userChannel>@\S+\/\S+)/gim,
/^(?<name>[a-zA-Z\-_0-9]+)\/(?<version>[^@/\n]+)(?<userChannel>@\S+\/\S+)$/im,
);

export function getConanPackage(packageName: string): ConanPackage {
Expand Down
1 change: 1 addition & 0 deletions lib/modules/datasource/conan/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ describe('modules/datasource/conan/index', () => {
version: '1.1.1',
},
],
sourceUrl: 'https://fake.conan.url.com',
});
});

Expand Down
85 changes: 32 additions & 53 deletions lib/modules/datasource/conan/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { logger } from '../../../logger';
import { cache } from '../../../util/cache/package/decorator';
import { GithubHttp } from '../../../util/http/github';
import { ensureTrailingSlash, joinUrlParts } from '../../../util/url';
import { parseSingleYaml } from '../../../util/yaml';
import * as allVersioning from '../../versioning';
import { Datasource } from '../datasource';
import type {
Expand All @@ -13,19 +12,14 @@ import type {
ReleaseResult,
} from '../types';
import { isArtifactoryServer } from '../util';
import { datasource, defaultRegistryUrl, getConanPackage } from './common';
import {
conanDatasourceRegex,
datasource,
defaultRegistryUrl,
getConanPackage,
} from './common';
import type {
ConanCenterReleases,
ConanJSON,
ConanLatestRevision,
ConanProperties,
ConanRevisionJSON,
ConanRevisionsJSON,
ConanYAML,
} from './types';
} from './schema';

export class ConanDatasource extends Datasource {
static readonly id = datasource;
Expand Down Expand Up @@ -59,16 +53,12 @@ export class ConanDatasource extends Datasource {
return null;
}
const url = `https://api.github.com/repos/conan-io/conan-center-index/contents/recipes/${conanName}/config.yml`;
const res = await this.githubHttp.get(url, {
headers: { accept: 'application/vnd.github.v3.raw' },
});
// TODO: use schema (#9610)
const doc = parseSingleYaml<ConanYAML>(res.body);
return {
releases: Object.keys(doc?.versions ?? {}).map((version) => ({
version,
})),
};
const { body: result } = await this.githubHttp.getYaml(
url,
{ headers: { accept: 'application/vnd.github.v3.raw' } },
ConanCenterReleases,
);
return result;
}

@cache({
Expand All @@ -94,10 +84,11 @@ export class ConanDatasource extends Datasource {
conanPackage.userAndChannel,
'/revisions',
);
const revisionRep =
await this.http.getJson<ConanRevisionsJSON>(revisionLookUp);
const revisions = revisionRep?.body.revisions;
return revisions?.[0].revision ?? null;
const { body: digest } = await this.http.getJson(
revisionLookUp,
ConanLatestRevision,
);
return digest;
}

@cache({
Expand Down Expand Up @@ -135,25 +126,16 @@ export class ConanDatasource extends Datasource {
);

try {
const rep = await this.http.getJson<ConanJSON>(lookupUrl);
const versions = rep?.body;
if (versions) {
const rep = await this.http.getJson(lookupUrl);
const conanJson = ConanJSON.parse(rep.body);
if (conanJson) {
logger.trace({ lookupUrl }, 'Got conan api result');
const dep: ReleaseResult = { releases: [] };

for (const resultString of Object.values(versions.results ?? {})) {
conanDatasourceRegex.lastIndex = 0;
const fromMatch = conanDatasourceRegex.exec(resultString);
if (fromMatch?.groups?.version && fromMatch?.groups?.userChannel) {
const version = fromMatch.groups.version;
if (fromMatch.groups.userChannel === userAndChannel) {
const result: Release = {
version,
};
dep.releases.push(result);
}
}
}
const conanJsonReleases: Release[] = conanJson
.filter(({ userChannel }) => userChannel === userAndChannel)
.map(({ version }) => ({ version }));
dep.releases.push(...conanJsonReleases);

try {
if (isArtifactoryServer(rep)) {
Expand Down Expand Up @@ -182,25 +164,22 @@ export class ConanDatasource extends Datasource {
url,
`v2/conans/${conanPackage.conanName}/${latestVersion}/${conanPackage.userAndChannel}/latest`,
);
const revResp =
await this.http.getJson<ConanRevisionJSON>(latestRevisionUrl);
const packageRev = revResp.body.revision;
const {
body: { revision: packageRev },
} = await this.http.getJson(latestRevisionUrl, ConanRevisionJSON);

const [user, channel] = conanPackage.userAndChannel.split('/');
const packageUrl = joinUrlParts(
`${groups.host}/artifactory/api/storage/${groups.repo}`,
`${user}/${conanPackage.conanName}/${latestVersion}/${channel}/${packageRev}/export/conanfile.py?properties=conan.package.url`,
);
const packageUrlResp =
await this.http.getJson<ConanProperties>(packageUrl);

if (
packageUrlResp.body.properties &&
'conan.package.url' in packageUrlResp.body.properties
) {
const conanPackageUrl =
packageUrlResp.body.properties['conan.package.url'][0];
dep.sourceUrl = conanPackageUrl;
const { body: conanProperties } = await this.http.getJson(
packageUrl,
ConanProperties,
);
const { sourceUrl } = conanProperties;
if (sourceUrl) {
dep.sourceUrl = sourceUrl;
}
}
} catch (err) {
Expand Down
Loading

0 comments on commit 3c42489

Please sign in to comment.