Skip to content

Commit

Permalink
chore(infra): test Node.js v16 and expand "engines" range to include …
Browse files Browse the repository at this point in the history
…it (#713)

* infra(ci): Switch to using `cimg/` Docker images over `circleci/` images

The newer images are smaller and suggested to be widely cached.  In
practice, the older images are widely cached because they're still more
prevalent but happy to use the newer images, particularly since the older
images aren't getting as much in the way of updates anymore (e.g., there are
not any Node.js 16 images for it.)

* docs: Switch to using `NODE_VERSION` and `NPM_VERSION` for Netlify

Using this instead of `.nvmrc` since this allows more granular control over
the `npm` version that gets installed.

Ref: https://docs.netlify.com/configure-builds/manage-dependencies/#npm

* infra: Start running Node.js 16 tests

* chore: bump upper-bounds of `node` within `engines` to allow Node.js v16

* Remove unnecessary `engines` constraint on unpublished package

The constraint on this can be enforced exclusively at the monorepo level
since this package is not published and that constraint need not be conveyed
by any user at runtime.

* renovate: Intentionally disable the `circleci` manager

The "circleci" manager is intentionally disabled as of this commit.

While we do benefit from its updating of "Orb" versions, the CircleCI
manager also attempts to update Docker images using its "Docker" datasource.

This is really handy, in theory, but we have intentionally varying major
Node.js docker image identifiers in our CircleCI configuration to test on
each major Node.js platform!  I suspect that enabling the "circleci" manager
would cause all of these to update to the latest version (e.g., 16) when we
want them to be intentionally different!

I'm going to try to craft an fix for this, but I might do it upstream on
Renovate itself using its Regex manager.  It's also worth noting that there
is other configuration that could be used to _only_ renovate "orbs" on this
file, but I'm taking the short-cut route and not juggling with that right
now.  I can test the repository locally with my own copy of Renovate and
come up with another solution given some free time.
  • Loading branch information
abernix authored May 3, 2021
1 parent ca4acf0 commit a834c19
Show file tree
Hide file tree
Showing 16 changed files with 58 additions and 26 deletions.
28 changes: 24 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ jobs:
# at https://hub.docker.com/r/circleci/node/.

NodeJS 12:
executor: { name: oss/node, tag: '12' }
docker:
- image: cimg/node:12.22.1
steps:
- common_test_steps
# We will save the results of this one particular invocation to use in
Expand All @@ -69,13 +70,21 @@ jobs:
- ./**

NodeJS 14:
executor: { name: oss/node, tag: '14' }
docker:
- image: cimg/node:14.16.1
steps:
- common_test_steps

NodeJS 16:
docker:
- image: cimg/node:16.0.0
steps:
- common_test_steps

GraphQL Types:
description: "Assert generated GraphQL types are up to date"
executor: { name: oss/node, tag: '14' }
docker:
- image: cimg/node:14.16.1
steps:
- oss/install_specific_npm_version:
version: '7'
Expand All @@ -89,6 +98,9 @@ jobs:
type: executor
executor: << parameters.platform >>
environment:
# Note: This is a no-op at the second, but bear with me on this. If this
# comment is not removed by 2021-06-30 remove it along with the next line.
# renovate: datasource=github-tags depName=nodejs/node versioning=node
NODE_VERSION: 14.16.1
NPM_VERSION: 7.10.0
steps:
Expand Down Expand Up @@ -225,7 +237,10 @@ jobs:
name: Assert npm version
command: |
if ((npm --version) -Ne "${Env:NPM_VERSION}") { exit 1 }
- run: npm clean-install
- run:
name: npm clean-install
command: |
npm clean-install
- rust/test:
# This is prefixed in the orb with 'cargo-'
cache_version: v2-windows
Expand Down Expand Up @@ -270,6 +285,9 @@ workflows:
- NodeJS 14:
name: "JS: Node 14"
<<: *common_non_publish_filters
- NodeJS 16:
name: "JS: Node 16"
<<: *common_non_publish_filters
- GraphQL Types:
name: "GraphQL Types (up to date)"
<<: *common_non_publish_filters
Expand All @@ -287,13 +305,15 @@ workflows:
requires:
- "JS: Node 12"
- "JS: Node 14"
- "JS: Node 16"
- "GraphQL Types (up to date)"
- oss/dry_run:
name: "JS: Dry-run"
<<: *common_publish_filters
requires:
- "JS: Node 12"
- "JS: Node 14"
- "JS: Node 16"
- Rust
- "GraphQL Types (up to date)"
- oss/confirmation:
Expand Down
1 change: 0 additions & 1 deletion docs/.nvmrc

This file was deleted.

2 changes: 1 addition & 1 deletion docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"engines": {
"node": ">=14 <15",
"node": ">=14 <17",
"npm": "7.x"
},
"scripts": {
Expand Down
3 changes: 0 additions & 3 deletions federation-integration-testsuite-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
"url": "https://github.com/apollographql/federation/issues"
},
"homepage": "https://github.com/apollographql/federation#readme",
"engines": {
"node": ">=12"
},
"dependencies": {
"apollo-graphql": "^0.9.2",
"graphql-tag": "^2.10.4"
Expand Down
2 changes: 2 additions & 0 deletions federation-js/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
- _Nothing yet! Stay tuned!_

- Expand the range of supported `node` versions in the package's `engines` specifier to include the now-tested Node.js `16`. [PR #713](https://github.com/apollographql/federation/pull/713)

## v0.23.2

- Remove lingering `core-js` polyfill imports, they're no longer needed (since `@apollo/[email protected]` dropped support for <= Node.js v10) and their presence is problematic since `core-js` isn't defined as a dependency within the package. Update `apollo-graphql` dependency which resolves a missing dependency (`sha.js`) within that package. [PR #699](https://github.com/apollographql/federation/pull/699)
Expand Down
2 changes: 1 addition & 1 deletion federation-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"author": "Apollo <[email protected]>",
"license": "MIT",
"engines": {
"node": ">=12.13.0 <15.0"
"node": ">=12.13.0 <17.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion gateway-js/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

> The changes noted within this `vNEXT` section have not been released yet. New PRs and commits which introduce changes should include an entry in this `vNEXT` section as part of their development. When a release is being prepared, a new header will be (manually) created below and the appropriate changes within that release will be moved into the new section.
- _Nothing yet! Stay tuned!_
- Expand the range of supported `node` versions in the package's `engines` specifier to include the now-tested Node.js `16`. [PR #713](https://github.com/apollographql/federation/pull/713)

## v0.27.1

Expand Down
2 changes: 1 addition & 1 deletion gateway-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"apollo"
],
"engines": {
"node": ">=12.13.0 <15.0"
"node": ">=12.13.0 <17.0"
},
"license": "MIT",
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion harmonizer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"author": "Apollo <[email protected]>",
"license": "MIT",
"engines": {
"node": ">=12.13.0 <15.0"
"node": ">=12.13.0 <17.0"
},
"dependencies": {
"@apollo/federation": "file:../federation-js"
Expand Down
4 changes: 3 additions & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@
# presently wrong. I would encourage removing this eventually, but for now,
# we'll check to see if `/bin/false` returns true (it won't) as a gauge.
ignore = "/bin/false"

[build.environment]
NODE_VERSION = "14"
NPM_VERSION = "7"
13 changes: 5 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"codegen:check": "npm run codegen && git diff --exit-code"
},
"engines": {
"node": ">=6 <15",
"node": ">=12.13.0 <17.0",
"npm": "7.x"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion query-planner-js/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

> The changes noted within this `vNEXT` section have not been released yet. New PRs and commits which introduce changes should include an entry in this `vNEXT` section as part of their development. When a release is being prepared, a new header will be (manually) created below and the appropriate changes within that release will be moved into the new section.
- _Nothing yet! Stay tuned!_
- Expand the range of supported `node` versions in the package's `engines` specifier to include the now-tested Node.js `16`. [PR #713](https://github.com/apollographql/federation/pull/713)

# v0.1.4

Expand Down
2 changes: 1 addition & 1 deletion query-planner-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"apollo"
],
"engines": {
"node": ">=12.13.0 <15.0"
"node": ">=12.13.0 <17.0"
},
"license": "MIT",
"publishConfig": {
Expand Down
15 changes: 15 additions & 0 deletions renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@
"apollo-open-source"
],
"dependencyDashboard": true,
// The "circleci" manager is intentionally disabled right now (e.g., not
// included in this list). While we do benefit from its updating of "Orb"
// versions, the CircleCI manager also attempts to update Docker images using
// its "Docker" datasource. This is really handy, in theory, but we have
// intentionally varying major Node.js docker image identifiers in our
// CircleCI configuration to test on each major Node.js platform. Enabling
// the "circleci" manager would cause all of these to update to the latest
// version (e.g., 16) when we want them to be intentionally different!
// I'm going to try to craft an fix for this, but I might do it upstream
// on Renovate itself using its Regex manager. It's also worth noting that
// there is other configuration that could be used to _only_ renovate "orbs"
// on this file, but I'm taking the short-cut route and not juggling with
// that right now. I can test the repository locally with my own copy of
// Renovate and come up with another solution given some free time. -Jesse
"enabledManagers": ["npm", "cargo"],
"packageRules": [
// We set this to the lowest supported Node.js version to ensure we don't
// use newer Node.js APIs unknowingly during development which are going to
Expand Down

0 comments on commit a834c19

Please sign in to comment.