Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,15 @@ jobs:
python-version: 3.14

- name: Run local tests
env:
APIFY_CLI_DEBUG_ERROR_FILE: ${{ github.workspace }}/cli-debug-errors.log
run: pnpm run test:local

- name: Print hidden CLI errors (debug)
if: ${{ always() }}
shell: bash
run: cat cli-debug-errors.log 2>/dev/null || echo "No CLI errors recorded"

test_api:
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[docs build]') }}

Expand Down Expand Up @@ -134,8 +141,14 @@ jobs:
- name: Run API tests
env:
TEST_USER_TOKEN: ${{ secrets.APIFY_TEST_USER_API_TOKEN }}
APIFY_CLI_DEBUG_ERROR_FILE: ${{ github.workspace }}/cli-debug-errors.log
run: pnpm run test:api

- name: Print hidden CLI errors (debug)
if: ${{ always() }}
shell: bash
run: cat cli-debug-errors.log 2>/dev/null || echo "No CLI errors recorded"

test_python_support:
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[docs build]') }}

Expand Down Expand Up @@ -175,8 +188,14 @@ jobs:
- name: Run Python tests
env:
TEST_USER_TOKEN: ${{ secrets.APIFY_TEST_USER_API_TOKEN }}
APIFY_CLI_DEBUG_ERROR_FILE: ${{ github.workspace }}/cli-debug-errors.log
run: pnpm run test:python

- name: Print hidden CLI errors (debug)
if: ${{ always() }}
shell: bash
run: cat cli-debug-errors.log 2>/dev/null || echo "No CLI errors recorded"

# Aggregate gate for the whole Python Support matrix. Branch protection requires only this single
# check, so the matrix versions can change without having to update the required checks in lockstep.
test_python_support_result:
Expand Down
2 changes: 1 addition & 1 deletion src/commands/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export class CreateCommand extends ApifyCommand<typeof CreateCommand> {
// Start fetching manifest immediately to prevent
// annoying delays that sometimes happen on CLI startup.
const manifestPromise = fetchManifest().catch((err) => {
return new Error(`Could not fetch template list from server. Cause: ${err?.message}`);
return new Error(`Could not fetch template list from server. Cause: ${err?.message}`, { cause: err });
});

actorName = await ensureValidActorName(actorName);
Expand Down
14 changes: 14 additions & 0 deletions src/lib/command-framework/apify-command.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/* eslint-disable max-classes-per-file */

Check warning on line 1 in src/lib/command-framework/apify-command.ts

View workflow job for this annotation

GitHub Actions / Lint & Format

oxlint

src/lib/command-framework/apify-command.ts:1:1: Unused eslint-disable directive (no problems were reported).

import { appendFileSync } from 'node:fs';
import process from 'node:process';
import type { parseArgs, ParseArgsConfig, ParseArgsOptionDescriptor } from 'node:util';
import { inspect } from 'node:util';

import type { Awaitable } from '@crawlee/types';
import chalk from 'chalk';
Expand Down Expand Up @@ -412,6 +414,18 @@

await this.run();
} catch (err: any) {
// DEBUG ONLY, do not merge: vitest `silent` and console spies hide this error in CI.
if (process.env.APIFY_CLI_DEBUG_ERROR_FILE) {
try {
appendFileSync(
process.env.APIFY_CLI_DEBUG_ERROR_FILE,
`[${new Date().toISOString()}] command=${this.commandString} cwd=${process.cwd()}\n${inspect(err, { depth: 6 })}\n\n`,
);
} catch {
// ignore
}
}

error({ message: err.message });
process.exitCode ||= 1;
} finally {
Expand Down Expand Up @@ -993,13 +1007,13 @@

const instance = new (command as typeof BuiltApifyCommand)(entrypoint, command.name, command.name);

// eslint-disable-next-line dot-notation

Check warning on line 1010 in src/lib/command-framework/apify-command.ts

View workflow job for this annotation

GitHub Actions / Lint & Format

oxlint

src/lib/command-framework/apify-command.ts:1010:2: Unused eslint-disable directive (no problems were reported).
instance['skipTelemetry'] = true;

// eslint-disable-next-line dot-notation

Check warning on line 1013 in src/lib/command-framework/apify-command.ts

View workflow job for this annotation

GitHub Actions / Lint & Format

oxlint

src/lib/command-framework/apify-command.ts:1013:2: Unused eslint-disable directive (no problems were reported).
instance['skipNotices'] = true;

// eslint-disable-next-line dot-notation

Check warning on line 1016 in src/lib/command-framework/apify-command.ts

View workflow job for this annotation

GitHub Actions / Lint & Format

oxlint

src/lib/command-framework/apify-command.ts:1016:2: Unused eslint-disable directive (no problems were reported).
await instance['_run'](rawObject);

return instance;
Expand Down
Loading