diff --git a/.circleci/config.yml b/.circleci/config.yml index 81fa7244cd..579fd143a9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -38,8 +38,6 @@ parameters: common_job_environment: &common_job_environment CARGO_NET_GIT_FETCH_WITH_CLI: true RUST_BACKTRACE: full - NODE_VERSION: 14.17.5 - NPM_VERSION: 7.10.0 commands: linux_install_baseline: @@ -77,87 +75,17 @@ commands: tar -xf jaeger.tar.gz mv jaeger-1.33.0-windows-amd64 jaeger - # This job sets up our nodejs dependencies, - # and makes sure everything is ready to run integration tests - macos_prepare_node_env: + # This job makes sure everything is ready to run integration tests + macos_prepare_env: steps: - #TODO[igni]: check for node version before we try to install it - # Installing this with the curl nvm command was proving difficult, - # so I've opted to just install the .pkg. Should be the same net - # result, even if liked the opportunity for symmetry with Linux. - - run: - name: Installing Node.js with a .pkg. - command: | - 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 "/" - sudo npm install --global npm@${NPM_VERSION} - - run: - name: Assert Node.js version - command: test "$(node --version)" = "v${NODE_VERSION}" - - run: - name: Assert npm version - command: test "$(npm --version)" = "${NPM_VERSION}" - run: # The jaeger exporter won't work without this name: Increase udp packet size command: | sudo sysctl net.inet.udp.maxdgram=65536 sudo sysctl net.inet.udp.maxdgram - linux_prepare_node_env: - steps: - #TODO[igni]: check for node version before we try to install it - - run: - name: Install nvm - command: | - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash - echo '. ~/.nvm/nvm.sh' >> $BASH_ENV - - run: - name: Install desired Node.js version - command: | - nvm install $NODE_VERSION - nvm alias default $NODE_VERSION - npm install --global npm@${NPM_VERSION} - - run: - name: Assert Node.js version - command: test "$(node --version)" = "v${NODE_VERSION}" - - run: - name: Assert npm version - command: test "$(npm --version)" = "${NPM_VERSION}" - windows_prepare_node_env: - #TODO[igni]: check for node version before we try to install it - steps: - - run: - name: Install desired Node.js version with nvm - command: | - nvm install ${Env:NODE_VERSION} - nvm on - - run: - # https://github.com/coreybutler/nvm-windows/issues/300 - # Have to move the command out of the way because it can't - # overwrite itself otherwise. This is madness, but apparently - # accepted. Other things I tried: using yarn to install npm, - # using http://npm.im/npm-windows-upgrade and even shouting. - name: Install specific version of npm in a crazy Windows way - command: | - $node_dir = (get-item (get-command npm).source).directory.fullname - foreach ($cmd in @("npm", "npx")) { - foreach ($ext in @(".ps1", ".cmd", "")) { - if (Test-Path "$node_dir/$cmd$ext") { - rename-item -path (join-path -path $node_dir -childpath "$cmd$ext") "${cmd}-orig${ext}" - } - } - } - npm-orig install --global "npm@${Env:NPM_VERSION}" - - run: - name: Assert Node.js version - command: | - if ((node --version) -Ne "v${Env:NODE_VERSION}") { exit 1 } - - run: - name: Assert npm version - command: | - if ((npm --version) -Ne "${Env:NPM_VERSION}") { exit 1 } - - windows_prepare_rust_env: + windows_prepare_env: steps: - run: name: Install rustup @@ -179,7 +107,7 @@ commands: [net] git-fetch-with-cli = true "@ - prepare_rust_env: + prepare_env: steps: - rust/install: version: stable @@ -238,9 +166,11 @@ commands: build_common_permutations: steps: - - rust/build: - with_cache: false - crate: --locked -p apollo-router + - run: + name: cargo check workspace + command: | + set -e -o pipefail + cargo check --locked build_all_permutations: steps: - build_common_permutations @@ -346,8 +276,7 @@ jobs: equal: [*rust_linux_executor, << parameters.platform >>] steps: - linux_install_baseline - - linux_prepare_node_env - - prepare_rust_env + - prepare_env - xtask_lint: os: linux check_compliance: @@ -364,8 +293,7 @@ jobs: equal: [*rust_linux_executor, << parameters.platform >>] steps: - linux_install_baseline - - linux_prepare_node_env - - prepare_rust_env + - prepare_env - xtask_check_compliance: os: linux build: @@ -382,8 +310,7 @@ jobs: equal: [*rust_linux_executor, << parameters.platform >>] steps: - linux_install_baseline - - linux_prepare_node_env - - prepare_rust_env + - prepare_env - build_workspace: os: linux - when: @@ -391,16 +318,14 @@ jobs: equal: [*rust_windows_executor, << parameters.platform >>] steps: - windows_install_baseline - - windows_prepare_node_env - - windows_prepare_rust_env + - windows_prepare_env - windows_build_workspace - when: condition: equal: [*rust_macos_executor, << parameters.platform >>] steps: - macos_install_baseline - - macos_prepare_node_env - - prepare_rust_env + - prepare_env - build_workspace: os: macos test: @@ -417,8 +342,7 @@ jobs: equal: [*rust_linux_executor, << parameters.platform >>] steps: - linux_install_baseline - - linux_prepare_node_env - - prepare_rust_env + - prepare_env - test_workspace: os: linux - when: @@ -426,16 +350,14 @@ jobs: equal: [*rust_windows_executor, << parameters.platform >>] steps: - windows_install_baseline - - windows_prepare_node_env - - windows_prepare_rust_env + - windows_prepare_env - windows_test_workspace - when: condition: equal: [*rust_macos_executor, << parameters.platform >>] steps: - macos_install_baseline - - macos_prepare_node_env - - prepare_rust_env + - prepare_env - test_workspace: os: macos @@ -465,23 +387,6 @@ jobs: - run: brew install cmake - rust/install: version: stable - # Installing this with the curl nvm command was proving difficult, - # so I've opted to just install the .pkg. Should be the same net - # result, even if liked the opportunity for symmetry with Linux. - - run: - name: Installing Node.js with a .pkg. - command: | - 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 "/" - - run: - name: Install specific version of npm - command: | - sudo npm install --global npm@${NPM_VERSION} - - run: - name: Assert Node.js version - command: test "$(node --version)" = "v${NODE_VERSION}" - - run: - name: Assert npm version - command: test "$(npm --version)" = "${NPM_VERSION}" - run: command: > cargo xtask dist @@ -510,22 +415,6 @@ jobs: sudo apt-get install -y libssl-dev - rust/install: version: stable - - run: - name: Install nvm - command: curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash - - run: echo '. ~/.nvm/nvm.sh' >> $BASH_ENV - - run: - name: Install desired Node.js version - command: | - nvm install $NODE_VERSION - nvm alias default $NODE_VERSION - npm install --global npm@${NPM_VERSION} - - run: - name: Assert Node.js version - command: test "$(node --version)" = "v${NODE_VERSION}" - - run: - name: Assert npm version - command: test "$(npm --version)" = "${NPM_VERSION}" - run: command: > cargo xtask dist @@ -559,36 +448,6 @@ jobs: [net] git-fetch-with-cli = true "@ - - run: - name: Install desired Node.js version with nvm - command: | - nvm install ${Env:NODE_VERSION} - nvm on - - run: - # https://github.com/coreybutler/nvm-windows/issues/300 - # Have to move the command out of the way because it can't - # overwrite itself otherwise. This is madness, but apparently - # accepted. Other things I tried: using yarn to install npm, - # using http://npm.im/npm-windows-upgrade and even shouting. - name: Install specific version of npm in a crazy Windows way - command: | - $node_dir = (get-item (get-command npm).source).directory.fullname - foreach ($cmd in @("npm", "npx")) { - foreach ($ext in @(".ps1", ".cmd", "")) { - if (Test-Path "$node_dir/$cmd$ext") { - rename-item -path (join-path -path $node_dir -childpath "$cmd$ext") "${cmd}-orig${ext}" - } - } - } - npm-orig install --global "npm@${Env:NPM_VERSION}" - - run: - name: Assert Node.js version - command: | - if ((node --version) -Ne "v${Env:NODE_VERSION}") { exit 1 } - - run: - name: Assert npm version - command: | - if ((npm --version) -Ne "${Env:NPM_VERSION}") { exit 1 } - run: command: > cargo xtask dist diff --git a/.tool-versions b/.tool-versions deleted file mode 100644 index 448cd193fc..0000000000 --- a/.tool-versions +++ /dev/null @@ -1,5 +0,0 @@ -# If updating this, you *must* also change the channel in rust-toolchain.toml -# renovate-automation: rustc version -rust 1.61.0 - -nodejs 16.9.1 diff --git a/Cargo.lock b/Cargo.lock index 8f0be2b916..3acabff190 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -352,9 +352,9 @@ dependencies = [ [[package]] name = "async-channel" -version = "1.6.1" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319" +checksum = "e14485364214912d3b19cc3435dde4df66065127f05fa0d75c712f36f12c2f28" dependencies = [ "concurrent-queue", "event-listener", @@ -4008,10 +4008,11 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "1.1.3" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" +checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" dependencies = [ + "once_cell", "thiserror", "toml", ] @@ -4483,8 +4484,9 @@ dependencies = [ [[package]] name = "router-bridge" -version = "0.1.0" -source = "git+https://github.com/apollographql/federation-rs.git?tag=defer-alpha4#5ce2e2b3fc8e4f8e6f8350bb1b68d8e8d639bf26" +version = "0.1.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f76769e567afde5e5e51f36f96bc734b35eb77d38668f6cf07e2784b3f303ed" dependencies = [ "anyhow", "async-channel", diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index 259f95e806..f0edd78171 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -152,6 +152,11 @@ By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/p ## 🛠 Maintenance +### Depend on published `router-bridge` ([PR #1613](https://github.com/apollographql/router/issues/1613)) + +We have published the `router-bridge` to crates.io, which removes the need for router developers to have nodejs installed. + +By [@o0Ignition0o](https://github.com/o0Ignition0o) in https://github.com/apollographql/router/pull/1613 ### Re-organize our release steps checklist ([PR #1605](https://github.com/apollographql/router/pull/1605)) diff --git a/apollo-router-scaffold/templates/base/.tool-versions b/apollo-router-scaffold/templates/base/.tool-versions deleted file mode 100644 index f7ab9da118..0000000000 --- a/apollo-router-scaffold/templates/base/.tool-versions +++ /dev/null @@ -1,4 +0,0 @@ -# renovate-automation: rustc version -rust 1.61.0 - -nodejs 16.9.1 diff --git a/apollo-router/Cargo.toml b/apollo-router/Cargo.toml index 795c82caf7..6bfc2a706a 100644 --- a/apollo-router/Cargo.toml +++ b/apollo-router/Cargo.toml @@ -119,7 +119,7 @@ reqwest = { version = "0.11.11", default-features = false, features = [ "json", "stream", ] } -router-bridge = { git = "https://github.com/apollographql/federation-rs.git", tag = "defer-alpha4" } +router-bridge = "0.1.0-alpha.1" schemars = { version = "0.8.10", features = ["url"] } sha2 = "0.10.2" serde = { version = "1.0.144", features = ["derive", "rc"] }