Skip to content

Commit

Permalink
Merge branch 'main' into feat/debian-datasource
Browse files Browse the repository at this point in the history
  • Loading branch information
oxdev03 committed Aug 25, 2024
2 parents 78399ec + 00a20a8 commit 82ec24f
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 36 deletions.
1 change: 1 addition & 0 deletions lib/config/presets/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export const removedPresets: Record<string, string | null> = {
'customManagers:helmChartYamlAppVersions',
'regexManagers:mavenPropertyVersions': 'customManagers:mavenPropertyVersions',
'regexManagers:tfvarsVersions': 'customManagers:tfvarsVersions',
'workarounds:reduceRepologyServerLoad': null,
};

const renamedMonorepos: Record<string, string> = {
Expand Down
12 changes: 0 additions & 12 deletions lib/config/presets/internal/workarounds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export const presets: Record<string, Preset> = {
'workarounds:ignoreHttp4sDigestMilestones',
'workarounds:typesNodeVersioning',
'workarounds:nodeDockerVersioning',
'workarounds:reduceRepologyServerLoad',
'workarounds:doNotUpgradeFromAlpineStableToEdge',
'workarounds:supportRedHatImageVersion',
'workarounds:javaLTSVersions',
Expand Down Expand Up @@ -201,17 +200,6 @@ export const presets: Record<string, Preset> = {
},
],
},
reduceRepologyServerLoad: {
description:
'Limit requests to reduce load on Repology servers until we can fix this properly, see issue `#10133`.',
hostRules: [
{
concurrentRequestLimit: 1,
matchHost: 'repology.org',
maxRequestsPerSecond: 0.5,
},
],
},
supportRedHatImageVersion: {
description:
'Use specific versioning for Red Hat-maintained container images.',
Expand Down
6 changes: 4 additions & 2 deletions lib/util/git/private-key.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ describe('util/git/private-key', () => {
-----BEGIN OPENSSH PRIVATE KEY-----
some-private-key with-passphrase
some-private-key with-passphrase
-----END OPENSSH PRIVATE KEY-----`);
-----END OPENSSH PRIVATE KEY-----
`);
await expect(writePrivateKey()).rejects.toThrow();
});

Expand All @@ -98,7 +99,8 @@ some-private-key with-passphrase
-----BEGIN OPENSSH PRIVATE KEY-----
some-private-key
some-private-key
-----END OPENSSH PRIVATE KEY-----`;
-----END OPENSSH PRIVATE KEY-----
`;
const privateKeyFile = upath.join(os.tmpdir() + '/git-private-ssh.key');
const publicKeyFile = `${privateKeyFile}.pub`;
const publicKey = 'some-public-key';
Expand Down
6 changes: 5 additions & 1 deletion lib/util/git/private-key.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ abstract class PrivateKey {
protected abstract readonly gpgFormat: string;

constructor(key: string) {
this.key = key.trim();
this.key = key;
addSecretForSanitizing(this.key, 'global');
logger.debug(
'gitPrivateKey: successfully set (but not yet written/configured)',
Expand Down Expand Up @@ -57,6 +57,10 @@ abstract class PrivateKey {
class GPGKey extends PrivateKey {
protected readonly gpgFormat = 'openpgp';

constructor(key: string) {
super(key.trim());
}

protected async importKey(): Promise<string | undefined> {
const keyFileName = upath.join(os.tmpdir() + '/git-private-gpg.key');
await fs.outputFile(keyFileName, this.key);
Expand Down
8 changes: 8 additions & 0 deletions lib/util/http/rate-limits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ const concurrencyDefaults: ConcurrencyLimitRule[] = [
matchHost: 'registry.npmjs.org',
concurrency: 999,
},
{
matchHost: 'repology.org',
concurrency: 1,
},
{
matchHost: '*',
concurrency: 16,
Expand All @@ -35,6 +39,10 @@ const throttleDefaults: ThrottleLimitRule[] = [
matchHost: 'https://plugins.gradle.org',
throttleMs: 50,
},
{
matchHost: 'repology.org',
throttleMs: 2000,
},
];

let throttleLimits: ThrottleLimitRule[] = [];
Expand Down
8 changes: 8 additions & 0 deletions lib/workers/repository/reconfigure/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ describe('workers/repository/reconfigure/index', () => {
GlobalConfig.reset();
});

it('no effect when running with platform=local', async () => {
GlobalConfig.set({ platform: 'local' });
await validateReconfigureBranch(config);
expect(logger.debug).toHaveBeenCalledWith(
'Not attempting to reconfigure when running with local platform',
);
});

it('no effect on repo with no reconfigure branch', async () => {
scm.branchExists.mockResolvedValueOnce(false);
await validateReconfigureBranch(config);
Expand Down
8 changes: 8 additions & 0 deletions lib/workers/repository/reconfigure/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import is from '@sindresorhus/is';
import JSON5 from 'json5';
import { GlobalConfig } from '../../../config/global';
import type { RenovateConfig } from '../../../config/types';
import { validateConfig } from '../../../config/validation';
import { logger } from '../../../logger';
Expand Down Expand Up @@ -43,6 +44,13 @@ export async function validateReconfigureBranch(
config: RenovateConfig,
): Promise<void> {
logger.debug('validateReconfigureBranch()');
if (GlobalConfig.get('platform') === 'local') {
logger.debug(
'Not attempting to reconfigure when running with local platform',
);
return;
}

const context = config.statusCheckNames?.configValidation;

const branchName = getReconfigureBranchName(config.branchPrefix!);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@
"nyc": "17.0.0",
"pretty-format": "29.7.0",
"rimraf": "6.0.1",
"semantic-release": "24.0.0",
"semantic-release": "24.1.0",
"tar": "7.4.3",
"tmp-promise": "3.0.3",
"ts-jest": "29.2.4",
Expand Down
40 changes: 20 additions & 20 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 82ec24f

Please sign in to comment.