Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: make diagnostic shutdown safer, use bun for holodeck server #9705

Merged
merged 47 commits into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
0abcbaf
refactor diagnostic for safer teardown
runspired Mar 1, 2025
4d21b59
make holodeck cleanup appropriately
runspired Mar 2, 2025
2faad63
fix request test and improve diagnostic a little bit
runspired Mar 2, 2025
6487669
fix more tests
runspired Mar 2, 2025
d873d32
cleanup config
runspired Mar 2, 2025
2c93499
cleanup dependencies for fastboot scenario
runspired Mar 2, 2025
00865b8
fix types
runspired Mar 2, 2025
9c0f311
fixup more tests
runspired Mar 2, 2025
d85383d
fixup more tests
runspired Mar 2, 2025
3f05a6b
dont launch holodeck for main test app (yet)
runspired Mar 2, 2025
9305381
ensure less noise in CI
runspired Mar 2, 2025
4be9893
some improvements
runspired Mar 2, 2025
89db302
a new approach
runspired Mar 3, 2025
5800815
attempt no sync
runspired Mar 3, 2025
455ff98
use internal sync
runspired Mar 3, 2025
507511d
more cleanup
runspired Mar 3, 2025
1ee2fd9
fix sync
runspired Mar 3, 2025
13ff9cc
fix install
runspired Mar 3, 2025
7ea7324
fix more missing peers
runspired Mar 3, 2025
70f2d8a
more vite cleanup
runspired Mar 3, 2025
a4ae8c1
fix more tests, make diagnostic easier to launch
runspired Mar 3, 2025
9f260c8
disable caching
runspired Mar 3, 2025
68e2acc
try something
runspired Mar 3, 2025
38c7b4e
fix no-cache
runspired Mar 3, 2025
62deec8
fix missing testem
runspired Mar 3, 2025
dfa1e19
try fastboot again
runspired Mar 3, 2025
e2ff3ed
cleanup
runspired Mar 3, 2025
706c27b
cleanup
runspired Mar 3, 2025
6fe273c
try
runspired Mar 3, 2025
023e08c
updated lockfile with new npmrc settings
runspired Mar 3, 2025
fd33326
fixup comment
runspired Mar 3, 2025
b933056
fixup fastboot
runspired Mar 3, 2025
cab3d62
fix prod tests
runspired Mar 3, 2025
9da5f5f
restore settings
runspired Mar 3, 2025
00367fc
fix deprecation test
runspired Mar 3, 2025
e738484
make nicer?
runspired Mar 3, 2025
192f193
keep some changes
runspired Mar 3, 2025
4a38c88
fix it
runspired Mar 3, 2025
508a90c
fix newline
runspired Mar 3, 2025
956a542
dont use turbo
runspired Mar 3, 2025
c76596f
fixup more commands?
runspired Mar 3, 2025
5319b0e
maybe
runspired Mar 3, 2025
03a3f0f
fixup
runspired Mar 3, 2025
d097272
still use exec
runspired Mar 3, 2025
df2cc99
fix scneario
runspired Mar 4, 2025
401bb0e
update npmrc text
runspired Mar 4, 2025
5c8662d
fix quote mark
runspired Mar 4, 2025
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
5 changes: 5 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ runs:
sudo apt install libnss3-tools
brew install mkcert

- name: 'Setup DBus for Chrome'
shell: bash
run: |
echo "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus" >> $GITHUB_ENV

- name: Configure Parallel Builds
if: ${{ inputs.parallel-build == 'true' }}
shell: bash
Expand Down
30 changes: 18 additions & 12 deletions .github/workflows/compat-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,24 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run Tests
run: pnpm test:vite
floating-dependencies:
timeout-minutes: 9
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: ./.github/actions/setup
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies w/o lockfile
run: pnpm install --no-lockfile
- name: Basic Tests
run: pnpm test
###
# This Test No Longer Works Because pnpm install --no-lockfile
# returns exit code 1 whenever there is a lockfile present and
# changes are made to node_modules. This is probably a bug in pnpm.
###
#
# floating-dependencies:
# timeout-minutes: 9
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
# - uses: ./.github/actions/setup
# with:
# repo-token: ${{ secrets.GITHUB_TOKEN }}
# - name: Install dependencies w/o lockfile
# run: pnpm install --no-lockfile
# - name: Basic Tests
# run: pnpm test
node-version-test:
name: Use Node.js ${{ matrix.node-version }}
timeout-minutes: 10
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,11 @@ jobs:
timeout-minutes: 12
env:
CI: true
run: pnpm test:try-one ${{ matrix.scenario }} -- ember test --test-port=0
run: |
cd tests/main;
pnpm exec ember try:one ${{ matrix.scenario }} --skip-cleanup;
pnpm build:tests;
pnpm run test;

releases:
timeout-minutes: 12
Expand All @@ -201,4 +205,8 @@ jobs:
- name: Basic tests with ${{ matrix.release }}
env:
CI: true
run: pnpm test:try-one ${{ matrix.release }} -- ember test --test-port=0
run: |
cd tests/main;
pnpm exec ember try:one ${{ matrix.release }} --skip-cleanup;
pnpm build:tests;
pnpm run test;
175 changes: 150 additions & 25 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,31 +1,156 @@
# package-import-method=hardlink
# module-exists will report false answers for the test apps
# unless we avoid hoisting
# while this is "true" this actually sets hoisting to "false"
# because we have a hoist-pattern. This basically just lets us
# use the very narrowly scoped hoist-pattern.
hoist=true
# Fastboot Doesnt respect node_modules resolution for whitelisted deps
# https://github.com/ember-fastboot/ember-cli-fastboot/issues/901
hoist-pattern[]=*node-fetch*

# we want true but cannot use true until the below issue is fixed
# https://github.com/pnpm/pnpm/issues/5340
strict-peer-dependencies=true
auto-install-peers=false # probably apps should set this to true, but we need to test with it false to be sure we aren't the bad citizen
dedupe-peer-dependents=false # this currently introduces more bugs than it fixes
resolve-peers-from-workspace-root=false # if its not declared we don't want it resolved: ensure tests are truly isolated
## Woo! A Config File!
##
## This file is used to configure the behavior of pnpm.
## If adjusting settings, please document the "why" in comments.
##
## It may also be good to understand that we intentionally are
## not using `hoisting` and using `injected` workspace packages
## to ensure properly isolated dep trees for test apps.
#
## things like `moduleExists` from @embroider/macros will report false answers
## for the test apps unless we avoid hoisting.
##
## Note, if we ever need to hoist something, we can use hoist-pattern[]=""
## For instance: hoist-pattern[]=*node-fetch*
## to hoist the specific thing we need and set this to `true`. When true
## and a hoist-pattern is present only the hoist-pattern will be hoisted.
#
hoist=false

## We should consider removing these
## But historically this was the default for pnpm
## and there is cleanup to do to make things work
## without these
## Its also just useful to have these tools top-level
#
public-hoist-pattern[]=*eslint*
public-hoist-pattern[]=*prettier*

## Ideally this would be dynamic as in CI we only have 4 CPUs
## While locally we have 10-16 CPUs. The more CPUs we use during
## install, generally the faster the install will be.
##
child-concurrency=10

## This is the default but its good to be explicit
## This helps us to ensure we are using the workspace
## version of a package.
##
save-workspace-protocol=rolling

## The current default is "highest" but we want to be explicit
## Since we also just want to ensure we are always using the
## latest versions of things we can.
##
resolution-mode=highest
dedupe-direct-deps=true
child-concurrency=10
ignore-dep-scripts=true
dedupe-injected-deps=false
link-workspace-packages=deep
hoist-workspace-packages=false

## This is documented in a slightly different place in the pnpm
## docs. If this setting is true (the default) then pnpm will
## run the pre* and post* versions of a script when running other
## scripts. For instance running "build" would also run "prebuild"
## and "postbuild". This is not the behavior we want.
##
enable-pre-post-scripts=false

## We use volta to manage our node and pnpm versions, so we do not
## want pnpm to manage these for us.
##
manage-package-manager-versions=false

## This is now the default but we want to be explicit
## This prevents security exploits from packages running
## arbitrary code during install. It also speeds up install times.
## Our own packages will still run their installation scripts
##
ignore-dep-scripts=true

## Make sure we don't troll ourselves when updating deps
##
verify-deps-before-run=true

## We do not want to auto-install peers because
## We want to ensure we understand what is actually required
## So that if a consuming app uses strict mode things will work
##
## This said, Apps should probably set this to true
##
auto-install-peers=false

## We want to error if we did not setup required peers correctly
## However, this pnpm bug prevents us using this as it will
## error when using `--no-lockfile` without reporting any errors
## https://github.com/pnpm/pnpm/issues/8382
##
strict-peer-dependencies=false

## We use so many similarly grouped peers, we want to make the
## peer-groups easier to distinguish.
## This forces a shorter sha for all groups (vs the default of 1000)
##
peers-suffix-max-length=40
virtual-store-dir-max-length=40

## If a dependency is not declared, we do not want to accidentally
## resolve it from the workspace root. This is a common source of
## bugs in monorepos.
##
resolve-peers-from-workspace-root=false

## Our Workspace Packages are "injected" so prevent
## devDependencies from being exposed and to allow
## for us to test optional peerDependencies.
##
inject-workspace-packages=true

public-hoist-pattern[]=*eslint*
public-hoist-pattern[]=*prettier*
## This also means we do not want to hoist them to the root
## As this would both expose them to all other packages AND
## results in them using symlinks instead of hardlinks
##
hoist-workspace-packages=false

## We use the `workspace:*` protocol for all workspace
## packages.
## In theory it would be nice to use `deep` here just in case
## we missed something so that we could tell pnpm to use the
## workspace version of a package if it exists. At any depth.
##
## However, it seems that deep/true result in workspace packages
## that are dependencies being symlinked instead of hardlinked
## more often, even at the top-level of a package, which is not
## what we want.
##
link-workspace-packages=false # deep

## Update injected dependencies when needed
## This will rerun after various "build" scripts
## In our published packages.
##
## Unfortunately, this does not run after scripts in
## the monorepo root, so we have added a special "sync"
## script to handle this.
##
sync-injected-deps-after-scripts[]=build:pkg
sync-injected-deps-after-scripts[]=build:infra
sync-injected-deps-after-scripts[]=build:glint
sync-injected-deps-after-scripts[]=sync

## In keeping with our "no hoisting" and "no auto-peers" and
## "isolated dep trees", we also want to avoid other things
## that lead to reliance on hoisting.
## In general, deduping leads to hoisting. This particular
## setting causes direct-dependencies to resolve from the
## workspace root if already in root. We don't want this.
##
dedupe-direct-deps=false

## We do not want to dedupe peer dependencies as this
## results in hoisting and violates optional peer isolation.
##
dedupe-peer-dependents=false

## We do not want to dedupe injected dependencies as this
## results in hoisting and violates optional peer isolation.
##
dedupe-injected-deps=false

## Fin
27 changes: 16 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,23 @@
},
"scripts": {
"takeoff": "FORCE_COLOR=2 pnpm install --prefer-offline --reporter=append-only",
"prepare": "turbo run build:infra; pnpm --filter './packages/*' run --parallel --if-present sync-hardlinks; turbo run build:pkg; pnpm run prepare:types; pnpm run _task:sync-hardlinks;",
"prepare:types": "tsc --build --force; turbo run build:glint;",
"prepare": "export TURBO_FORCE=true; turbo run build:pkg; pnpm run prepare:types;",
"prepare:types": "export TURBO_FORCE=true; tsc --build --force; turbo run build:glint;",
"release": "./release/index.ts",
"build": "turbo _build --log-order=stream --filter=./packages/* --concurrency=10;",
"_task:sync-hardlinks": "pnpm run -r --parallel --if-present sync-hardlinks;",
"sync": "pnpm --filter './packages/*' run --parallel --if-present sync",
"build:docs": "mkdir -p packages/-ember-data/dist && cd ./docs-generator && node ./compile-docs.js",
"lint:tests": "turbo --log-order=stream lint --filter=./tests/* --continue --concurrency=10",
"lint:pkg": "turbo --log-order=stream lint --filter=./packages/* --continue --concurrency=10",
"lint": "pnpm run _task:sync-hardlinks; turbo --log-order=stream lint --continue --concurrency=10",
"lint:fix": "pnpm run _task:sync-hardlinks; turbo --log-order=stream lint --continue --concurrency=10 -- --fix",
"lint": "turbo --log-order=stream lint --continue --concurrency=10",
"lint:fix": "turbo --log-order=stream lint --continue --concurrency=10 -- --fix",
"lint:prettier": "prettier --check --cache --cache-location=.prettier-cache --log-level=warn .",
"lint:prettier:fix": "prettier --write --cache --cache-location=.prettier-cache --log-level=warn .",
"preinstall": "npx only-allow pnpm",
"check:test-types": "turbo --log-order=stream check:types --filter=./{tests,config}/* --continue --concurrency=10",
"check:types": "pnpm run _task:sync-hardlinks; bun run check:test-types",
"test": "pnpm run _task:sync-hardlinks; pnpm turbo test --concurrency=1",
"test:production": "pnpm run _task:sync-hardlinks; pnpm turbo test:production --concurrency=1",
"test:try-one": "pnpm --filter main-test-app run test:try-one",
"check:types": "bun run check:test-types",
"test": "pnpm turbo test --concurrency=1",
"test:production": "pnpm turbo test:production --concurrency=1",
"test:docs": "FORCE_COLOR=2 pnpm build:docs && pnpm run -r --workspace-concurrency=-1 --if-present --reporter=append-only --reporter-hide-prefix test:docs",
"test:blueprints": "pnpm run -r --workspace-concurrency=-1 --if-present test:blueprints",
"test:fastboot": "pnpm run -r --workspace-concurrency=-1 --if-present test:fastboot",
Expand Down Expand Up @@ -135,6 +134,13 @@
"@glimmer/component": "*"
}
},
"ember-exam": {
"peerDependencies": {
"ember-cli": "*",
"ember-qunit": "*",
"qunit": "*"
}
},
"@ember/test-helpers": {
"dependencies": {
"webpack": "*"
Expand Down Expand Up @@ -174,8 +180,7 @@
"testem@3.11.0": "patches/testem@3.11.0.patch",
"@ember/test-helpers@3.3.0": "patches/@ember__test-helpers@3.3.0.patch",
"@ember/test-helpers@4.0.4": "patches/@ember__test-helpers@4.0.4.patch",
"@ember/test-helpers@5.1.0": "patches/@ember__test-helpers@5.1.0.patch",
"pnpm-sync-dependencies-meta-injected": "patches/pnpm-sync-dependencies-meta-injected.patch"
"@ember/test-helpers@5.1.0": "patches/@ember__test-helpers@5.1.0.patch"
}
}
}
4 changes: 1 addition & 3 deletions packages/-ember-data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
"scripts": {
"lint": "eslint . --quiet --cache --cache-strategy=content",
"build:pkg": "vite build;",
"prepack": "bun run build:pkg",
"sync-hardlinks": "bun run sync-dependencies-meta-injected"
"prepack": "pnpm run build:pkg"
},
"ember-addon": {
"main": "addon-main.cjs",
Expand Down Expand Up @@ -113,7 +112,6 @@
"@warp-drive/internal-config": "workspace:*",
"ember-source": "~5.12.0",
"eslint": "^9.12.0",
"pnpm-sync-dependencies-meta-injected": "0.0.14",
"vite": "^5.2.11",
"typescript": "^5.7.2",
"qunit": "^2.18.0"
Expand Down
5 changes: 2 additions & 3 deletions packages/-warp-drive/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"author": "Chris Thoburn <runspired@users.noreply.github.com>",
"scripts": {
"build:pkg": "vite build;",
"prepack": "bun run build:pkg",
"sync-hardlinks": "bun run sync-dependencies-meta-injected"
"prepack": "pnpm run build:pkg",
"sync": "echo \"syncing\""
},
"bin": {
"warp-drive": "./dist/warp-drive.js",
Expand Down Expand Up @@ -59,7 +59,6 @@
"@babel/plugin-transform-typescript": "^7.24.5",
"@babel/preset-typescript": "^7.24.1",
"@warp-drive/internal-config": "workspace:*",
"pnpm-sync-dependencies-meta-injected": "0.0.14",
"typescript": "^5.7.2",
"vite": "^5.2.11"
},
Expand Down
5 changes: 2 additions & 3 deletions packages/active-record/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"scripts": {
"lint": "eslint . --quiet --cache --cache-strategy=content",
"build:pkg": "vite build;",
"prepack": "bun run build:pkg",
"sync-hardlinks": "bun run sync-dependencies-meta-injected"
"prepack": "pnpm run build:pkg",
"sync": "echo \"syncing\""
},
"ember-addon": {
"main": "addon-main.cjs",
Expand Down Expand Up @@ -65,7 +65,6 @@
"@warp-drive/core-types": "workspace:*",
"@warp-drive/internal-config": "workspace:*",
"ember-source": "~5.12.0",
"pnpm-sync-dependencies-meta-injected": "0.0.14",
"vite": "^5.2.11",
"typescript": "^5.7.2"
},
Expand Down
4 changes: 1 addition & 3 deletions packages/adapter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
"scripts": {
"lint": "eslint . --quiet --cache --cache-strategy=content",
"build:pkg": "vite build;",
"prepack": "bun run build:pkg",
"sync-hardlinks": "bun run sync-dependencies-meta-injected"
"prepack": "pnpm run build:pkg"
},
"ember-addon": {
"main": "addon-main.cjs",
Expand Down Expand Up @@ -80,7 +79,6 @@
"@warp-drive/core-types": "workspace:*",
"@warp-drive/internal-config": "workspace:*",
"ember-source": "~5.12.0",
"pnpm-sync-dependencies-meta-injected": "0.0.14",
"typescript": "^5.7.2",
"vite": "^5.2.11"
},
Expand Down
Loading
Loading