Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into veryspry/fix-wind…
Browse files Browse the repository at this point in the history
…ows-node-manifest
  • Loading branch information
gatsbybot committed Nov 4, 2021
2 parents 57a733d + c9a35ed commit 873ffce
Show file tree
Hide file tree
Showing 1,414 changed files with 106,242 additions and 66,008 deletions.
166 changes: 86 additions & 80 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@ executors:
parameters:
image:
type: string
# First 10.x LTS release, but old Yarn
default: "12.13.0"
default: "14.17.0"
docker:
- image: cimg/node:<< parameters.image >>
environment:
GATSBY_CPU_COUNT: 2

aliases:
e2e-executor: &e2e-executor
docker:
- image: cypress/browsers:node12.18.3-chrome87-ff82
- image: cypress/browsers:node14.15.0-chrome86-ff82
environment:
GATSBY_CPU_COUNT: 2

restore_cache: &restore_cache
restore_cache:
Expand Down Expand Up @@ -63,6 +66,7 @@ aliases:
- /blog.+/

test_template: &test_template
parallelism: 4
parameters:
npm_rebuild:
type: boolean
Expand All @@ -75,12 +79,17 @@ aliases:
condition: << parameters.npm_rebuild >>
steps:
- run: npm rebuild
- run: yarn list react
- run: yarn why lmdb-store
- run:
command: node --max-old-space-size=2048 ./node_modules/.bin/jest -w 1 --ci
name: Step debug info
command: |
yarn list react
yarn why lmdb-store
- run:
name: Run tests
command: yarn jest --ci --runInBand $(yarn -s jest --listTests | sed 's/\/home\/circleci\/project\///g' | circleci tests split)
environment:
GENERATE_JEST_REPORT: true
NODE_OPTIONS: --max-old-space-size=2048
GENERATE_JEST_REPORT: "true"
JEST_JUNIT_OUTPUT_DIR: ./test-results/jest-node/
JEST_JUNIT_OUTPUT_NAME: results.xml
- store_test_results:
Expand All @@ -96,7 +105,7 @@ aliases:
requires:
- lint
- typecheck
- unit_tests_node12
- unit_tests_node14

e2e_tests_production_runtime_alias: &e2e_tests_production_runtime_alias
<<: *e2e-executor
Expand Down Expand Up @@ -128,22 +137,6 @@ aliases:
- notify-status:
condition: << parameters.nightly >>

e2e_tests_gatsby-image_alias: &e2e_tests_gatsby-image_alias
<<: *e2e-executor
parameters:
nightly:
type: boolean
default: false
environment:
CYPRESS_PROJECT_ID: ave32k
CYPRESS_RECORD_KEY: fb3cb6e0-a0f9-48b2-aa9a-95e8ef150a85
steps:
- e2e-test:
test_path: e2e-tests/gatsby-image
skip_file_change_test: << parameters.nightly >>
- notify-status:
condition: << parameters.nightly >>

commands:
notify-status:
parameters:
Expand All @@ -155,7 +148,7 @@ commands:
condition: << parameters.condition >>
steps:
- slack/status:
channel: eng-react-integration-status
channel: eng-react-integration-status

e2e-test:
parameters:
Expand Down Expand Up @@ -198,7 +191,7 @@ jobs:
- checkout
- run: ./scripts/assert-changed-files.sh "packages/*|(e2e|integration)-tests/*|.circleci/*|scripts/e2e-test.sh|yarn.lock"
# python 2 is not built in and node-gyp needs it to build lmdb
- run: apt-get update && apt-get install python -y
- run: sudo apt-get update && sudo apt-get install python -y
- <<: *restore_cache
- <<: *install_node_modules
- <<: *check_lockfile
Expand All @@ -209,7 +202,8 @@ jobs:
- persist_to_workspace:
root: ./
paths:
- "*"
- "packages/"
- "node_modules/"

lint:
executor: node
Expand All @@ -236,11 +230,6 @@ jobs:
- run: yarn typecheck
- run: yarn check-repo-fields

unit_tests_node12:
executor:
name: node
<<: *test_template

unit_tests_node14:
executor:
name: node
Expand All @@ -253,20 +242,22 @@ jobs:
image: "14.17.0"
environment:
GATSBY_EXPERIMENTAL_LMDB_STORE: 1
GATSBY_EXPERIMENTAL_LMDB_INDEXES: 1
GATSBY_EXPERIMENTAL_PARALLEL_QUERY_RUNNING: 1
<<: *test_template

integration_tests_gatsby_source_wordpress:
machine: true
machine:
image: "ubuntu-2004:202107-02"
steps:
- run:
command: |
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
echo ' [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
- run: nvm install v12
- run: nvm alias default v12
- run: nvm use v12
- run: npm i -g yarn@1.22.10
- run: nvm install v14
- run: nvm alias default v14
- run: nvm use v14
- run: npm i -g yarn@1.22.11
- e2e-test:
test_path: integration-tests/gatsby-source-wordpress

Expand Down Expand Up @@ -362,6 +353,15 @@ jobs:
- run: # Quick upgrade to the v2 (any version, we just need the real set version)
command: yarn policies set-version berry
working_directory: /tmp/e2e-tests/gatsby-pnp
- run: # Explicitly set nodeLinker to avoid Yarn selecting node_modules due to the Yarn 1.x lockfile
command: yarn config set nodeLinker pnp
working_directory: /tmp/e2e-tests/gatsby-pnp
- run: # Allow installs to change the lockfile
command: yarn config set enableImmutableInstalls false
working_directory: /tmp/e2e-tests/gatsby-pnp
- run: # Don't allow any fallback to root dependencies
command: yarn config set pnpFallbackMode none
working_directory: /tmp/e2e-tests/gatsby-pnp
- run: # Forces to use the local packages
command: yarn link --all --private ~/project
working_directory: /tmp/e2e-tests/gatsby-pnp
Expand All @@ -378,15 +378,6 @@ jobs:
command: 'DEBUG=start-server-and-test yarn start-server-and-test "yarn develop 2>&1 | tee log.txt" :8000 "! cat log.txt | grep -E ''ERROR #|Require stack:''"'
working_directory: /tmp/e2e-tests/gatsby-pnp

e2e_tests_gatsby-image:
<<: *e2e_tests_gatsby-image_alias

e2e_tests_gatsby-image_with_experimental_react:
<<: *e2e_tests_gatsby-image_alias

e2e_tests_gatsby-image_with_next_react:
<<: *e2e_tests_gatsby-image_alias

e2e_tests_development_runtime:
<<: *e2e_tests_development_runtime_alias

Expand Down Expand Up @@ -485,14 +476,25 @@ jobs:
steps:
- checkout
# jq is helpful for parsing json & python required for node-gyp to build lmdb
- run: apt-get update && apt-get install jq python -y
- run: sudo apt-get update && sudo apt-get install jq python -y
- <<: *restore_cache
- <<: *install_node_modules
- run: yarn markdown
- run: git config --global user.name "GatsbyJS Bot"
- run: git config --global user.email "core-team@gatsbyjs.com"
- run: sh ./scripts/publish-starters.sh "starters/*"

update_changelogs:
executor: node
steps:
- checkout
- run: sudo apt-get update && sudo apt-get install jq python -y
- <<: *restore_cache
- <<: *install_node_modules
- run: git config --global user.name "GatsbyJS Bot"
- run: git config --global user.email "core-team@gatsbyjs.com"
- run: node scripts/gatsby-changelog-generator/update-and-open-pr.js

update_i18n_source:
executor: node
steps:
Expand Down Expand Up @@ -520,6 +522,7 @@ jobs:
working_directory: ~/project/scripts/i18n

windows_unit_tests:
parallelism: 4
executor:
name: win/default
shell: powershell.exe
Expand All @@ -533,28 +536,30 @@ jobs:
# keys:
# - yarn-packages-v2-{{ checksum "yarn.lock" }}
# - yarn-packages-v2-

- <<: *attach_to_bootstrap
- run:
name: Install node 12.13
name: Install node 14.17 and yarn
command: |
nvm install 12.13.0
nvm alias default 12.13.0
nvm use 12.13.0
nvm install 14.17.0
nvm alias default 14.17.0
nvm use 14.17.0
choco install yarn
- run:
name: Set yarn timeout
command: yarn config set network-timeout 300000
- run:
name: Install node modules
command: yarn --frozen-lockfile
# Caching is slow, so disabling
# - save_cache:
# paths:
# - C:\Users\circleci\AppData\Local\Yarn\Cache
# key: yarn-packages-v2-{{ checksum "yarn.lock" }}
- run: yarn npm-run-all -s check-versions "lerna-prepare --concurrency=4 --stream"
name: Rebuild packages for windows
command: |
Remove-Item -Recurse -Force -Path "node_modules/sharp/"
yarn
- run:
name: "Run Tests"
command: yarn jest -w 1 --ci
name: Run tests
command: yarn jest --ci --runInBand ((yarn jest --listTests) | Foreach-Object {$_ -replace '.*\\packages', 'packages'} | Foreach-Object {$_ -replace '\\', '/'} | circleci tests split --split-by=timings)
environment:
NODE_OPTIONS: --max-old-space-size=2048
GENERATE_JEST_REPORT: "true"
JEST_JUNIT_OUTPUT_DIR: ./test-results/jest-node/
JEST_JUNIT_OUTPUT_NAME: results.xml
- store_test_results:
path: ./test-results/jest-node/

bootstrap-with-experimental-react:
executor: node
Expand All @@ -565,7 +570,7 @@ jobs:
steps:
- checkout
# python 2 is not built in and node-gyp needs it to build lmdb
- run: apt-get update && apt-get install python -y
- run: sudo apt-get update && sudo apt-get install python -y
- run:
name: "Update React to prerelease"
command: "REACT_CHANNEL=<< parameters.version >> node ./scripts/upgrade-react"
Expand Down Expand Up @@ -602,10 +607,6 @@ workflows:
jobs:
- bootstrap-with-experimental-react:
version: "next"
- e2e_tests_gatsby-image_with_next_react:
nightly: true
requires:
- bootstrap-with-experimental-react
- e2e_tests_development_runtime_with_next_react:
nightly: true
requires:
Expand All @@ -625,10 +626,6 @@ workflows:
jobs:
- bootstrap-with-experimental-react:
version: "experimental"
- e2e_tests_gatsby-image_with_experimental_react:
nightly: true
requires:
- bootstrap-with-experimental-react
- e2e_tests_development_runtime_with_experimental_react:
nightly: true
requires:
Expand All @@ -638,6 +635,22 @@ workflows:
requires:
- bootstrap-with-experimental-react

# Ideally, we should trigger this when any new release is created, sadly there is no easy way to do it:
# - Can't rely on tags: GitHub won't send webhook to CircleCI when there are more than 3 tags in one push
# See: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#push
# - Can't rely on pushes to "release/*" branches because we have "Only build pull requests" option enabled
# (so pushes without pull requests are ignored by CircleCI)
nightly-update-changelogs:
triggers:
- schedule:
cron: "0 0 * * 1,2,3,4,5"
filters:
branches:
only:
- master
jobs:
- update_changelogs

build-test:
jobs:
- bootstrap
Expand All @@ -649,11 +662,6 @@ workflows:
<<: *ignore_docs
requires:
- lint
- unit_tests_node12:
<<: *ignore_docs
requires:
- lint
- typecheck
- bootstrap
- unit_tests_node14:
<<: *ignore_docs
Expand Down Expand Up @@ -696,8 +704,6 @@ workflows:
<<: *e2e-test-workflow
- e2e_tests_path-prefix:
<<: *e2e-test-workflow
- e2e_tests_gatsby-image:
<<: *e2e-test-workflow
- e2e_tests_gatsby-static-image:
<<: *e2e-test-workflow
- e2e_tests_visual-regression:
Expand Down
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ integration-tests
packages/*/*.js
packages/gatsby-source-shopify/**/*.js
packages/gatsby-plugin-preload-fonts/prepare/*.js
packages/gatsby-image/withIEPolyfill/index.js
packages/gatsby/cache-dir/commonjs/**/*
packages/gatsby-admin/public
packages/gatsby/gatsby-admin-public
Expand Down
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ module.exports = {
__PATH_PREFIX__: true,
__BASE_PATH__: true,
__ASSET_PREFIX__: true,
_CFLAGS_: true,
__GATSBY: true,
},
rules: {
"@babel/no-unused-expressions": [
Expand Down
5 changes: 3 additions & 2 deletions .github/ISSUE_TEMPLATE/BUG_REPORT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ body:
Please fill out each section below. This info allows Gatsby maintainers to diagnose (and fix!) your issue as quickly as possible. Otherwise we might need to close the issue without e.g. clear reproduction steps.
Also please verify that your issue is present in `gatsby@next`, too. The `next` version is the latest beta version of Gatsby and has any pending changes that are in the next stable release.
Bug reports also shoulnd't be used for support requests about a specific problem in your site, please use GitHub Discussions for that.
Useful Links:
- Documentation: https://www.gatsbyjs.com/docs/
Expand All @@ -22,7 +23,7 @@ body:
options:
- label: "This issue is not a duplicate. Before opening a new issue, please search existing issues: https://github.com/gatsbyjs/gatsby/issues"
required: true
- label: "This issue is not a question, feature request, RFC, or anything other than a bug report. Please post those things in GitHub Discussions: https://github.com/gatsbyjs/gatsby/discussions"
- label: "This issue is not a question, feature request, RFC, or anything other than a bug report directly related to Gatsby. Please post those things in GitHub Discussions: https://github.com/gatsbyjs/gatsby/discussions"
required: true
- type: textarea
attributes:
Expand All @@ -36,7 +37,7 @@ body:
attributes:
label: Reproduction Link
placeholder: "https://github.com/username/repository-name/"
description: "Link to a reproduction (GitHub repository, Codesandbox, etc.). How to make a minimal reproduction: https://gatsby.dev/reproduction"
description: "Link to a reproduction (GitHub repository, Codesandbox, etc.). **Do not link to your actual project**, but provide a minimal reproduction in a fresh project -- how to make a minimal reproduction: https://gatsby.dev/reproduction"
validations:
required: true
- type: textarea
Expand Down
Loading

0 comments on commit 873ffce

Please sign in to comment.