Skip to content

Commit 502f49f

Browse files
authored
chore: drop outdated warning message (#463)
Update message for outdated version SDK, as link `https://help.apify.com/en/articles/3184510-updates-and-versioning-of-apify-sdk` is no longer available.
1 parent 1a36bb2 commit 502f49f

File tree

3 files changed

+1
-73
lines changed

3 files changed

+1
-73
lines changed

packages/apify/src/actor.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,7 @@ import { KeyValueStore } from './key_value_store.js';
5151
import { PlatformEventManager } from './platform_event_manager.js';
5252
import type { ProxyConfigurationOptions } from './proxy_configuration.js';
5353
import { ProxyConfiguration } from './proxy_configuration.js';
54-
import {
55-
checkCrawleeVersion,
56-
getSystemInfo,
57-
printOutdatedSdkWarning,
58-
} from './utils.js';
54+
import { checkCrawleeVersion, getSystemInfo } from './utils.js';
5955

6056
export interface InitOptions {
6157
storage?: StorageClient;
@@ -492,7 +488,6 @@ export class Actor<Data extends Dictionary = Dictionary> {
492488

493489
checkCrawleeVersion();
494490
log.info('System info', getSystemInfo());
495-
printOutdatedSdkWarning();
496491

497492
// reset global config instance to respect APIFY_ prefixed env vars
498493
CoreConfiguration.globalConfig = Configuration.getGlobalConfig();

packages/apify/src/utils.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ import { version as crawleeVersion } from '@crawlee/core/package.json';
66
// @ts-ignore if we enable resolveJsonModule, we end up with `src` folder in `dist`
77
import { version as apifyClientVersion } from 'apify-client/package.json';
88
import { pathExistsSync, readJSONSync } from 'fs-extra';
9-
import semver from 'semver';
10-
11-
import { APIFY_ENV_VARS } from '@apify/consts';
12-
import log from '@apify/log';
139

1410
// @ts-ignore if we enable resolveJsonModule, we end up with `src` folder in `dist`
1511
import { version as apifyVersion } from '../package.json';
@@ -77,17 +73,3 @@ export function checkCrawleeVersion() {
7773
}
7874
}
7975
}
80-
81-
/**
82-
* Prints a warning if this version of Apify SDK is outdated.
83-
* @ignore
84-
*/
85-
export function printOutdatedSdkWarning() {
86-
if (process.env[APIFY_ENV_VARS.DISABLE_OUTDATED_WARNING]) return;
87-
const latestApifyVersion = process.env[APIFY_ENV_VARS.SDK_LATEST_VERSION];
88-
if (!latestApifyVersion || !semver.lt(apifyVersion, latestApifyVersion))
89-
return;
90-
91-
log.warning(`You are using an outdated version (${apifyVersion}) of Apify SDK. We recommend you to update to the latest version (${latestApifyVersion}).
92-
Read more about Apify SDK versioning at: https://help.apify.com/en/articles/3184510-updates-and-versioning-of-apify-sdk`);
93-
}

test/apify/utils.test.ts

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import semver from 'semver';
88
import { APIFY_ENV_VARS } from '@apify/consts';
99
import log from '@apify/log';
1010

11-
import { printOutdatedSdkWarning } from '../../packages/apify/src/utils.js';
12-
1311
describe('Actor.isAtHome()', () => {
1412
test('works', () => {
1513
expect(Actor.isAtHome()).toBe(false);
@@ -42,53 +40,6 @@ describe('Actor.newClient()', () => {
4240
});
4341
});
4442

45-
describe('printOutdatedSdkWarning()', () => {
46-
const currentVersion = require('../../packages/apify/package.json').version; // eslint-disable-line
47-
48-
afterEach(() => {
49-
delete process.env[APIFY_ENV_VARS.SDK_LATEST_VERSION];
50-
delete process.env[APIFY_ENV_VARS.DISABLE_OUTDATED_WARNING];
51-
});
52-
53-
test('should do nothing when ENV_VARS.SDK_LATEST_VERSION is not set', () => {
54-
const spy = vitest.spyOn(log, 'warning');
55-
56-
printOutdatedSdkWarning();
57-
58-
expect(spy).not.toHaveBeenCalled();
59-
});
60-
61-
test('should do nothing when ENV_VARS.DISABLE_OUTDATED_WARNING is set', () => {
62-
const spy = vitest.spyOn(log, 'warning');
63-
64-
process.env[APIFY_ENV_VARS.DISABLE_OUTDATED_WARNING] = '1';
65-
printOutdatedSdkWarning();
66-
67-
expect(spy).not.toHaveBeenCalled();
68-
});
69-
70-
test('should correctly work when outdated', () => {
71-
const spy = vitest.spyOn(log, 'warning');
72-
73-
process.env[APIFY_ENV_VARS.SDK_LATEST_VERSION] = semver.inc(
74-
currentVersion,
75-
'minor',
76-
)!;
77-
printOutdatedSdkWarning();
78-
79-
expect(spy).toHaveBeenCalledTimes(1);
80-
});
81-
82-
test('should correctly work when up to date', () => {
83-
const spy = vitest.spyOn(log, 'warning');
84-
85-
process.env[APIFY_ENV_VARS.SDK_LATEST_VERSION] = '0.13.0';
86-
printOutdatedSdkWarning();
87-
88-
expect(spy).not.toHaveBeenCalled();
89-
});
90-
});
91-
9243
describe('createRequestDebugInfo()', () => {
9344
test('handles Puppeteer response', () => {
9445
const request = {

0 commit comments

Comments
 (0)