Skip to content

Commit

Permalink
update concurrency
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed May 16, 2023
1 parent 38679e2 commit 219910f
Show file tree
Hide file tree
Showing 28 changed files with 390 additions and 368 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build_initial.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,21 @@ concurrency:

env:
NAPI_CLI_VERSION: 2.14.7
TURBO_VERSION: 1.9.4
TURBO_VERSION: 1.9.6
RUST_TOOLCHAIN: nightly-2023-03-09
PNPM_VERSION: 7.24.3
NODE_MAINTENANCE_VERSION: 16
NODE_LTS_VERSION: 18
TEST_CONCURRENCY: 6
TEST_CONCURRENCY: 10
# TODO: remove after testing
NEXT_TEST_CONTINUE_ON_ERROR: 'true'

jobs:
build-initial:
name: build-initial
uses: vercel/next.js/.github/workflows/build_reusable.yml@ijjk/update-ci-workflow
with:
afterBuild: pnpm lint && apt install moreutils jq -y && ./scripts/check-examples.sh && ./scripts/check-pre-compiled.sh
secrets: inherit

testDev:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build_reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ on:

env:
NAPI_CLI_VERSION: 2.14.7
TURBO_VERSION: 1.9.4
TURBO_VERSION: 1.9.6
RUST_TOOLCHAIN: nightly-2023-03-09
PNPM_VERSION: 7.24.3
NODE_MAINTENANCE_VERSION: 16
NODE_LTS_VERSION: 18
TEST_CONCURRENCY: 8
TEST_CONCURRENCY: 10
# TODO: remove after testing
NEXT_TEST_CONTINUE_ON_ERROR: 'true'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_test_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name: Build, test, and deploy

env:
NAPI_CLI_VERSION: 2.14.7
TURBO_VERSION: 1.9.4
TURBO_VERSION: 1.9.6
RUST_TOOLCHAIN: nightly-2023-03-09
PNPM_VERSION: 7.24.3
NODE_MAINTENANCE_VERSION: 16
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_test_deploy_new.yml.bak
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: Build, test, and deploy

env:
NAPI_CLI_VERSION: 2.14.7
TURBO_VERSION: 1.9.4
TURBO_VERSION: 1.9.6
RUST_TOOLCHAIN: nightly-2023-03-09
PNPM_VERSION: 7.24.3
NODE_MAINTENANCE_VERSION: 16
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_request_stats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: Generate Pull Request Stats

env:
NAPI_CLI_VERSION: 2.14.7
TURBO_VERSION: 1.9.4
TURBO_VERSION: 1.9.6
RUST_TOOLCHAIN: nightly-2023-03-09
PNPM_VERSION: 7.24.3

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/trigger_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ name: Trigger Release

env:
NAPI_CLI_VERSION: 2.14.7
TURBO_VERSION: 1.9.4
TURBO_VERSION: 1.9.6
RUST_TOOLCHAIN: nightly-2023-03-09
PNPM_VERSION: 7.24.3
NODE_MAINTENANCE_VERSION: 16
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@
"tree-kill": "1.2.2",
"ts-node": "10.9.1",
"tsec": "0.2.1",
"turbo": "1.9.4",
"turbo": "1.9.6",
"typescript": "4.8.2",
"unfetch": "4.2.0",
"wait-port": "0.2.2",
Expand Down
19 changes: 15 additions & 4 deletions packages/next/src/telemetry/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ import { _postPayload } from './post-payload'
import { getRawProjectId } from './project-id'
import { AbortController } from 'next/dist/compiled/@edge-runtime/primitives/abort-controller'
import fs from 'fs'
// Note: cross-spawn is not used here as it causes
// a new command window to appear when we don't want it to
import { spawn } from 'child_process'

// This is the key that stores whether or not telemetry is enabled or disabled.
const TELEMETRY_KEY_ENABLED = 'telemetry.enabled'
Expand Down Expand Up @@ -214,7 +211,9 @@ export class Telemetry {
// Acts as `Promise#finally` because `catch` transforms the error
.then((res) => {
// Clean up the event to prevent unbounded `Set` growth
this.queue.delete(prom)
if (!deferred) {
this.queue.delete(prom)
}
return res
})

Expand Down Expand Up @@ -242,11 +241,23 @@ export class Telemetry {
// if we fail to abort ignore this event
}
})
fs.mkdirSync(this.distDir, { recursive: true })
fs.writeFileSync(
path.join(this.distDir, '_events.json'),
JSON.stringify(allEvents)
)

// Note: cross-spawn is not used here as it causes
// a new command window to appear when we don't want it to
const child_process =
require('child_process') as typeof import('child_process')

// we use spawnSync when debugging to ensure logs are piped
// correctly to stdout/stderr
const spawn = this.NEXT_TELEMETRY_DEBUG
? child_process.spawnSync
: child_process.spawn

spawn(process.execPath, [require.resolve('./detached-flush'), mode, dir], {
detached: !this.NEXT_TELEMETRY_DEBUG,
windowsHide: true,
Expand Down

0 comments on commit 219910f

Please sign in to comment.