Skip to content

Commit cb345d3

Browse files
authored
chore: Use published router-bridge (#1613)
part of #491 We have published the `router-bridge` to crates.io, which removes the need for router developers to have nodejs installed.
1 parent 1e93afb commit cb345d3

File tree

6 files changed

+31
-174
lines changed

6 files changed

+31
-174
lines changed

.circleci/config.yml

Lines changed: 17 additions & 158 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ parameters:
3838
common_job_environment: &common_job_environment
3939
CARGO_NET_GIT_FETCH_WITH_CLI: true
4040
RUST_BACKTRACE: full
41-
NODE_VERSION: 14.17.5
42-
NPM_VERSION: 7.10.0
4341

4442
commands:
4543
linux_install_baseline:
@@ -77,87 +75,17 @@ commands:
7775
tar -xf jaeger.tar.gz
7876
mv jaeger-1.33.0-windows-amd64 jaeger
7977
80-
# This job sets up our nodejs dependencies,
81-
# and makes sure everything is ready to run integration tests
82-
macos_prepare_node_env:
78+
# This job makes sure everything is ready to run integration tests
79+
macos_prepare_env:
8380
steps:
84-
#TODO[igni]: check for node version before we try to install it
85-
# Installing this with the curl nvm command was proving difficult,
86-
# so I've opted to just install the .pkg. Should be the same net
87-
# result, even if liked the opportunity for symmetry with Linux.
88-
- run:
89-
name: Installing Node.js with a .pkg.
90-
command: |
91-
curl "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}.pkg" > "$HOME/Downloads/node.pkg" && sudo installer -store -pkg "$HOME/Downloads/node.pkg" -target "/"
92-
sudo npm install --global npm@${NPM_VERSION}
93-
- run:
94-
name: Assert Node.js version
95-
command: test "$(node --version)" = "v${NODE_VERSION}"
96-
- run:
97-
name: Assert npm version
98-
command: test "$(npm --version)" = "${NPM_VERSION}"
9981
- run:
10082
# The jaeger exporter won't work without this
10183
name: Increase udp packet size
10284
command: |
10385
sudo sysctl net.inet.udp.maxdgram=65536
10486
sudo sysctl net.inet.udp.maxdgram
105-
linux_prepare_node_env:
106-
steps:
107-
#TODO[igni]: check for node version before we try to install it
108-
- run:
109-
name: Install nvm
110-
command: |
111-
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
112-
echo '. ~/.nvm/nvm.sh' >> $BASH_ENV
113-
- run:
114-
name: Install desired Node.js version
115-
command: |
116-
nvm install $NODE_VERSION
117-
nvm alias default $NODE_VERSION
118-
npm install --global npm@${NPM_VERSION}
119-
- run:
120-
name: Assert Node.js version
121-
command: test "$(node --version)" = "v${NODE_VERSION}"
122-
- run:
123-
name: Assert npm version
124-
command: test "$(npm --version)" = "${NPM_VERSION}"
12587
126-
windows_prepare_node_env:
127-
#TODO[igni]: check for node version before we try to install it
128-
steps:
129-
- run:
130-
name: Install desired Node.js version with nvm
131-
command: |
132-
nvm install ${Env:NODE_VERSION}
133-
nvm on
134-
- run:
135-
# https://github.com/coreybutler/nvm-windows/issues/300
136-
# Have to move the command out of the way because it can't
137-
# overwrite itself otherwise. This is madness, but apparently
138-
# accepted. Other things I tried: using yarn to install npm,
139-
# using http://npm.im/npm-windows-upgrade and even shouting.
140-
name: Install specific version of npm in a crazy Windows way
141-
command: |
142-
$node_dir = (get-item (get-command npm).source).directory.fullname
143-
foreach ($cmd in @("npm", "npx")) {
144-
foreach ($ext in @(".ps1", ".cmd", "")) {
145-
if (Test-Path "$node_dir/$cmd$ext") {
146-
rename-item -path (join-path -path $node_dir -childpath "$cmd$ext") "${cmd}-orig${ext}"
147-
}
148-
}
149-
}
150-
npm-orig install --global "npm@${Env:NPM_VERSION}"
151-
- run:
152-
name: Assert Node.js version
153-
command: |
154-
if ((node --version) -Ne "v${Env:NODE_VERSION}") { exit 1 }
155-
- run:
156-
name: Assert npm version
157-
command: |
158-
if ((npm --version) -Ne "${Env:NPM_VERSION}") { exit 1 }
159-
160-
windows_prepare_rust_env:
88+
windows_prepare_env:
16189
steps:
16290
- run:
16391
name: Install rustup
@@ -179,7 +107,7 @@ commands:
179107
[net]
180108
git-fetch-with-cli = true
181109
"@
182-
prepare_rust_env:
110+
prepare_env:
183111
steps:
184112
- rust/install:
185113
version: stable
@@ -238,9 +166,11 @@ commands:
238166

239167
build_common_permutations:
240168
steps:
241-
- rust/build:
242-
with_cache: false
243-
crate: --locked -p apollo-router
169+
- run:
170+
name: cargo check workspace
171+
command: |
172+
set -e -o pipefail
173+
cargo check --locked
244174
build_all_permutations:
245175
steps:
246176
- build_common_permutations
@@ -346,8 +276,7 @@ jobs:
346276
equal: [*rust_linux_executor, << parameters.platform >>]
347277
steps:
348278
- linux_install_baseline
349-
- linux_prepare_node_env
350-
- prepare_rust_env
279+
- prepare_env
351280
- xtask_lint:
352281
os: linux
353282
check_compliance:
@@ -364,8 +293,7 @@ jobs:
364293
equal: [*rust_linux_executor, << parameters.platform >>]
365294
steps:
366295
- linux_install_baseline
367-
- linux_prepare_node_env
368-
- prepare_rust_env
296+
- prepare_env
369297
- xtask_check_compliance:
370298
os: linux
371299
build:
@@ -382,25 +310,22 @@ jobs:
382310
equal: [*rust_linux_executor, << parameters.platform >>]
383311
steps:
384312
- linux_install_baseline
385-
- linux_prepare_node_env
386-
- prepare_rust_env
313+
- prepare_env
387314
- build_workspace:
388315
os: linux
389316
- when:
390317
condition:
391318
equal: [*rust_windows_executor, << parameters.platform >>]
392319
steps:
393320
- windows_install_baseline
394-
- windows_prepare_node_env
395-
- windows_prepare_rust_env
321+
- windows_prepare_env
396322
- windows_build_workspace
397323
- when:
398324
condition:
399325
equal: [*rust_macos_executor, << parameters.platform >>]
400326
steps:
401327
- macos_install_baseline
402-
- macos_prepare_node_env
403-
- prepare_rust_env
328+
- prepare_env
404329
- build_workspace:
405330
os: macos
406331
test:
@@ -417,25 +342,22 @@ jobs:
417342
equal: [*rust_linux_executor, << parameters.platform >>]
418343
steps:
419344
- linux_install_baseline
420-
- linux_prepare_node_env
421-
- prepare_rust_env
345+
- prepare_env
422346
- test_workspace:
423347
os: linux
424348
- when:
425349
condition:
426350
equal: [*rust_windows_executor, << parameters.platform >>]
427351
steps:
428352
- windows_install_baseline
429-
- windows_prepare_node_env
430-
- windows_prepare_rust_env
353+
- windows_prepare_env
431354
- windows_test_workspace
432355
- when:
433356
condition:
434357
equal: [*rust_macos_executor, << parameters.platform >>]
435358
steps:
436359
- macos_install_baseline
437-
- macos_prepare_node_env
438-
- prepare_rust_env
360+
- prepare_env
439361
- test_workspace:
440362
os: macos
441363

@@ -465,23 +387,6 @@ jobs:
465387
- run: brew install cmake
466388
- rust/install:
467389
version: stable
468-
# Installing this with the curl nvm command was proving difficult,
469-
# so I've opted to just install the .pkg. Should be the same net
470-
# result, even if liked the opportunity for symmetry with Linux.
471-
- run:
472-
name: Installing Node.js with a .pkg.
473-
command: |
474-
curl "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}.pkg" > "$HOME/Downloads/node.pkg" && sudo installer -store -pkg "$HOME/Downloads/node.pkg" -target "/"
475-
- run:
476-
name: Install specific version of npm
477-
command: |
478-
sudo npm install --global npm@${NPM_VERSION}
479-
- run:
480-
name: Assert Node.js version
481-
command: test "$(node --version)" = "v${NODE_VERSION}"
482-
- run:
483-
name: Assert npm version
484-
command: test "$(npm --version)" = "${NPM_VERSION}"
485390
- run:
486391
command: >
487392
cargo xtask dist
@@ -510,22 +415,6 @@ jobs:
510415
sudo apt-get install -y libssl-dev
511416
- rust/install:
512417
version: stable
513-
- run:
514-
name: Install nvm
515-
command: curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
516-
- run: echo '. ~/.nvm/nvm.sh' >> $BASH_ENV
517-
- run:
518-
name: Install desired Node.js version
519-
command: |
520-
nvm install $NODE_VERSION
521-
nvm alias default $NODE_VERSION
522-
npm install --global npm@${NPM_VERSION}
523-
- run:
524-
name: Assert Node.js version
525-
command: test "$(node --version)" = "v${NODE_VERSION}"
526-
- run:
527-
name: Assert npm version
528-
command: test "$(npm --version)" = "${NPM_VERSION}"
529418
- run:
530419
command: >
531420
cargo xtask dist
@@ -559,36 +448,6 @@ jobs:
559448
[net]
560449
git-fetch-with-cli = true
561450
"@
562-
- run:
563-
name: Install desired Node.js version with nvm
564-
command: |
565-
nvm install ${Env:NODE_VERSION}
566-
nvm on
567-
- run:
568-
# https://github.com/coreybutler/nvm-windows/issues/300
569-
# Have to move the command out of the way because it can't
570-
# overwrite itself otherwise. This is madness, but apparently
571-
# accepted. Other things I tried: using yarn to install npm,
572-
# using http://npm.im/npm-windows-upgrade and even shouting.
573-
name: Install specific version of npm in a crazy Windows way
574-
command: |
575-
$node_dir = (get-item (get-command npm).source).directory.fullname
576-
foreach ($cmd in @("npm", "npx")) {
577-
foreach ($ext in @(".ps1", ".cmd", "")) {
578-
if (Test-Path "$node_dir/$cmd$ext") {
579-
rename-item -path (join-path -path $node_dir -childpath "$cmd$ext") "${cmd}-orig${ext}"
580-
}
581-
}
582-
}
583-
npm-orig install --global "npm@${Env:NPM_VERSION}"
584-
- run:
585-
name: Assert Node.js version
586-
command: |
587-
if ((node --version) -Ne "v${Env:NODE_VERSION}") { exit 1 }
588-
- run:
589-
name: Assert npm version
590-
command: |
591-
if ((npm --version) -Ne "${Env:NPM_VERSION}") { exit 1 }
592451
- run:
593452
command: >
594453
cargo xtask dist

.tool-versions

Lines changed: 0 additions & 5 deletions
This file was deleted.

Cargo.lock

Lines changed: 8 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

NEXT_CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,11 @@ By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/p
172172

173173
## 🛠 Maintenance
174174

175+
### Depend on published `router-bridge` ([PR #1613](https://github.com/apollographql/router/issues/1613))
176+
177+
We have published the `router-bridge` to crates.io, which removes the need for router developers to have nodejs installed.
178+
179+
By [@o0Ignition0o](https://github.com/o0Ignition0o) in https://github.com/apollographql/router/pull/1613
175180

176181
### Re-organize our release steps checklist ([PR #1605](https://github.com/apollographql/router/pull/1605))
177182

apollo-router-scaffold/templates/base/.tool-versions

Lines changed: 0 additions & 4 deletions
This file was deleted.

apollo-router/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ reqwest = { version = "0.11.11", default-features = false, features = [
119119
"json",
120120
"stream",
121121
] }
122-
router-bridge = { git = "https://github.com/apollographql/federation-rs.git", tag = "defer-alpha4" }
122+
router-bridge = "0.1.0-alpha.1"
123123
schemars = { version = "0.8.10", features = ["url"] }
124124
sha2 = "0.10.2"
125125
serde = { version = "1.0.144", features = ["derive", "rc"] }

0 commit comments

Comments
 (0)