Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
gatsbybot committed Apr 5, 2020
2 parents adbd5c7 + 25f2276 commit a6a38c7
Show file tree
Hide file tree
Showing 865 changed files with 174,096 additions and 8,085 deletions.
155 changes: 111 additions & 44 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ executors:
parameters:
image:
type: string
default: "10"
default: "10.13"
docker:
- image: circleci/node:<< parameters.image >>

Expand Down Expand Up @@ -69,7 +69,7 @@ aliases:
- /blog.+/
requires:
- lint
- unit_tests_node8
- unit_tests_node10

e2e_tests_production_runtime_alias: &e2e_tests_production_runtime_alias
<<: *e2e-executor
Expand Down Expand Up @@ -152,6 +152,8 @@ commands:
- run:
command: npm install
working_directory: << parameters.working_directory >>
environment:
NUM_PAGES: << parameters.NUM_PAGES >>
- run:
command: npm run build
working_directory: << parameters.working_directory >>
Expand All @@ -166,6 +168,8 @@ commands:
- run:
command: npm install
working_directory: << parameters.working_directory >>
environment:
NUM_PAGES: << parameters.NUM_PAGES >>
- run:
command: npm run build
working_directory: << parameters.working_directory >>
Expand All @@ -190,7 +194,10 @@ commands:
type: string
test_command:
type: string
default: "" # if unset, e2e-test.sh specifies the command
default: "yarn test"
run_loki:
type: boolean
default: false
steps:
- <<: *attach_to_bootstrap
# In case of failure, add these steps again. Cache probably got deleted
Expand All @@ -201,7 +208,17 @@ commands:
condition: << parameters.skip_file_change_test >>
steps:
- run: ./scripts/assert-changed-files.sh "<< parameters.trigger_pattern >>|<< parameters.test_path >>/*"
- run: ./scripts/e2e-test.sh "<< parameters.test_path >>" "<< parameters.test_command >>"
- run:
name: Run tests (using defaults)
command: ./scripts/e2e-test.sh "<< parameters.test_path >>" "<< parameters.test_command >>"

- when:
condition: << parameters.run_loki >>
steps:
- run:
command: GATSBY_DB_NODES=loki << parameters.test_command >>
name: Run tests (using Loki)
working_directory: << parameters.test_path >>

version: 2.1

Expand All @@ -214,7 +231,7 @@ jobs:
- <<: *install_node_modules
- <<: *persist_cache
# persist our git checkout and node_modules as the next step (assert-changed-files) might exit this step
# when no files have changed (master). We still need to have these files for jobs like lint & unit_tests_node8
# when no files have changed (master). We still need to have these files for jobs like lint & unit_tests_node10
- persist_to_workspace:
root: ./
paths:
Expand All @@ -238,12 +255,6 @@ jobs:
- run: yarn typecheck
- run: yarn check-repo-fields

unit_tests_node8:
executor:
name: node
image: "8"
<<: *test_template

unit_tests_node10:
executor: node
<<: *test_template
Expand Down Expand Up @@ -271,12 +282,31 @@ jobs:
- e2e-test:
test_path: integration-tests/long-term-caching

integration_tests_cache_resilience:
executor: node
steps:
- e2e-test:
test_path: integration-tests/cache-resilience
run_loki: true

integration_tests_gatsby_pipeline:
executor: node
steps:
- e2e-test:
test_path: integration-tests/gatsby-pipeline

integration_tests_gatsby_cli:
<<: *e2e-executor
executor: node
steps:
- <<: *attach_to_bootstrap
- run:
name: Assert Changed Files
command: ./scripts/assert-changed-files.sh "packages/gatsby-cli/*|packages/gatsby/*|integration-tests/gatsby-cli/*"
- run:
name: Run tests (using defaults)
command: cd integration-tests/gatsby-cli && yarn && yarn test

integration_tests_structured_logging:
executor: node
steps:
Expand Down Expand Up @@ -412,147 +442,179 @@ jobs:
benchmark_markdown_id_512:
docker:
- image: "circleci/node:12"
resource_class: xlarge
steps:
- run-benchmark:
working_directory: benchmarks/markdown_id
NUM_PAGES: "512"
BENCHMARK_CONTENT_SOURCE: MDX
BENCHMARK_CONTENT_SOURCE: MARKDOWN
BENCHMARK_REPO_NAME: gatsbyjs/gatsby/benchmarks/markdown_id
BENCHMARK_SITE_TYPE: BLOG

benchmark_markdown_id_4096:
docker:
- image: "circleci/node:12"
resource_class: xlarge
steps:
- run-benchmark:
working_directory: benchmarks/markdown_id
NUM_PAGES: "4096"
BENCHMARK_CONTENT_SOURCE: MDX
BENCHMARK_CONTENT_SOURCE: MARKDOWN
BENCHMARK_REPO_NAME: gatsbyjs/gatsby/benchmarks/markdown_id
BENCHMARK_SITE_TYPE: BLOG

benchmark_markdown_id_8192:
docker:
- image: "circleci/node:12"
resource_class: xlarge
steps:
- run-benchmark:
working_directory: benchmarks/markdown_id
NUM_PAGES: "8192"
BENCHMARK_CONTENT_SOURCE: MDX
BENCHMARK_CONTENT_SOURCE: MARKDOWN
BENCHMARK_REPO_NAME: gatsbyjs/gatsby/benchmarks/markdown_id
BENCHMARK_SITE_TYPE: BLOG

benchmark_markdown_id_32768:
docker:
- image: "circleci/node:12"
resource_class: xlarge
steps:
- run-benchmark:
working_directory: benchmarks/markdown_id
NUM_PAGES: "32768"
BENCHMARK_CONTENT_SOURCE: MDX
BENCHMARK_CONTENT_SOURCE: MARKDOWN
BENCHMARK_REPO_NAME: gatsbyjs/gatsby/benchmarks/markdown_id
BENCHMARK_SITE_TYPE: BLOG

benchmark_markdown_slug_512:
docker:
- image: "circleci/node:12"
resource_class: xlarge
steps:
- run-benchmark:
working_directory: benchmarks/markdown_slug
NUM_PAGES: "512"
BENCHMARK_CONTENT_SOURCE: MDX
BENCHMARK_CONTENT_SOURCE: MARKDOWN
BENCHMARK_REPO_NAME: gatsbyjs/gatsby/benchmarks/markdown_slug
BENCHMARK_SITE_TYPE: BLOG

benchmark_markdown_slug_4096:
docker:
- image: "circleci/node:12"
resource_class: xlarge
steps:
- run-benchmark:
working_directory: benchmarks/markdown_slug
NUM_PAGES: "4096"
BENCHMARK_CONTENT_SOURCE: MDX
BENCHMARK_CONTENT_SOURCE: MARKDOWN
BENCHMARK_REPO_NAME: gatsbyjs/gatsby/benchmarks/markdown_slug
BENCHMARK_SITE_TYPE: BLOG

benchmark_markdown_slug_8192:
docker:
- image: "circleci/node:12"
resource_class: xlarge
steps:
- run-benchmark:
working_directory: benchmarks/markdown_slug
NUM_PAGES: "8192"
BENCHMARK_CONTENT_SOURCE: MDX
BENCHMARK_CONTENT_SOURCE: MARKDOWN
BENCHMARK_REPO_NAME: gatsbyjs/gatsby/benchmarks/markdown_slug
BENCHMARK_SITE_TYPE: BLOG

benchmark_markdown_slug_32768:
docker:
- image: "circleci/node:12"
resource_class: xlarge
steps:
- run-benchmark:
working_directory: benchmarks/markdown_slug
NUM_PAGES: "32768"
BENCHMARK_CONTENT_SOURCE: MDX
BENCHMARK_CONTENT_SOURCE: MARKDOWN
BENCHMARK_REPO_NAME: gatsbyjs/gatsby/benchmarks/markdown_slug
BENCHMARK_SITE_TYPE: BLOG

benchmark_markdown_table_512:
docker:
- image: "circleci/node:12"
resource_class: xlarge
steps:
- run-benchmark:
working_directory: benchmarks/markdown_table
NUM_PAGES: "512"
BENCHMARK_CONTENT_SOURCE: MDX
BENCHMARK_CONTENT_SOURCE: MARKDOWN
BENCHMARK_REPO_NAME: gatsbyjs/gatsby/benchmarks/markdown_table
BENCHMARK_SITE_TYPE: BLOG

benchmark_markdown_table_4096:
docker:
- image: "circleci/node:12"
resource_class: xlarge
steps:
- run-benchmark:
working_directory: benchmarks/markdown_table
NUM_PAGES: "4096"
BENCHMARK_CONTENT_SOURCE: MDX
BENCHMARK_CONTENT_SOURCE: MARKDOWN
BENCHMARK_REPO_NAME: gatsbyjs/gatsby/benchmarks/markdown_table
BENCHMARK_SITE_TYPE: BLOG

benchmark_markdown_table_8192:
docker:
- image: "circleci/node:12"
resource_class: xlarge
steps:
- run-benchmark:
working_directory: benchmarks/markdown_table
NUM_PAGES: "8192"
BENCHMARK_CONTENT_SOURCE: MDX
BENCHMARK_CONTENT_SOURCE: MARKDOWN
BENCHMARK_REPO_NAME: gatsbyjs/gatsby/benchmarks/markdown_table
BENCHMARK_SITE_TYPE: BLOG

benchmark_markdown_table_32768:
docker:
- image: "circleci/node:12"
resource_class: xlarge
steps:
- run-benchmark:
working_directory: benchmarks/markdown_table/benchmarks/markdown_table
working_directory: benchmarks/markdown_table
NUM_PAGES: "32768"
BENCHMARK_CONTENT_SOURCE: MDX
BENCHMARK_CONTENT_SOURCE: MARKDOWN
BENCHMARK_REPO_NAME: gatsbyjs/gatsby/benchmarks/markdown_table
BENCHMARK_SITE_TYPE: BLOG

benchmark_mdx_512:
docker:
- image: "circleci/node:12"
steps:
- run-benchmark:
working_directory: benchmarks/mdx
NUM_PAGES: "512"
BENCHMARK_CONTENT_SOURCE: MDX
BENCHMARK_REPO_NAME: gatsbyjs/gatsby/benchmarks/mdx
BENCHMARK_SITE_TYPE: BLOG

benchmark_mdx_4096:
docker:
- image: "circleci/node:12"
steps:
- run-benchmark:
working_directory: benchmarks/mdx
NUM_PAGES: "4096"
BENCHMARK_CONTENT_SOURCE: MDX
BENCHMARK_REPO_NAME: gatsbyjs/gatsby/benchmarks/mdx
BENCHMARK_SITE_TYPE: BLOG

benchmark_mdx_8192:
docker:
- image: "circleci/node:12"
steps:
- run-benchmark:
working_directory: benchmarks/mdx
NUM_PAGES: "8192"
BENCHMARK_CONTENT_SOURCE: MDX
BENCHMARK_REPO_NAME: gatsbyjs/gatsby/benchmarks/mdx
BENCHMARK_SITE_TYPE: BLOG

benchmark_mdx_32768:
docker:
- image: "circleci/node:12"
steps:
- run-benchmark:
working_directory: benchmarks/mdx
NUM_PAGES: "32768"
BENCHMARK_CONTENT_SOURCE: MDX
BENCHMARK_REPO_NAME: gatsbyjs/gatsby/benchmarks/mdx
BENCHMARK_SITE_TYPE: BLOG

workflows:
version: 2

Expand All @@ -570,9 +632,13 @@ workflows:
- benchmark_markdown_table_4096
- benchmark_markdown_table_8192
- benchmark_markdown_table_32768
- benchmark_mdx_512
- benchmark_mdx_4096
- benchmark_mdx_8192
- benchmark_mdx_32768
triggers:
- schedule:
cron: 12 3 * * *
cron: 22 16 * * *
filters:
branches:
only:
Expand Down Expand Up @@ -633,30 +699,31 @@ workflows:
- lint:
requires:
- bootstrap
- unit_tests_node8:
<<: *ignore_docs
requires:
- bootstrap
- unit_tests_node10:
<<: *ignore_docs
requires:
- lint
- unit_tests_node8
- bootstrap
- unit_tests_node12:
<<: *ignore_docs
requires:
- lint
- unit_tests_node8
- bootstrap
- unit_tests_www:
requires:
- lint
- unit_tests_node8
- bootstrap
- integration_tests_long_term_caching:
<<: *e2e-test-workflow
- integration_tests_cache_resilience:
<<: *e2e-test-workflow
- integration_tests_gatsby_pipeline:
<<: *e2e-test-workflow
- integration_tests_structured_logging:
<<: *e2e-test-workflow
- integration_tests_gatsby_cli:
requires:
- bootstrap
- e2e_tests_path-prefix:
<<: *e2e-test-workflow
- e2e_tests_gatsby-image:
Expand Down
13 changes: 13 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,19 @@ module.exports = {
plugins: ["@typescript-eslint/eslint-plugin"],
rules: {
...TSEslint.configs.recommended.rules,
// This rule is great. It helps us not throw on types for areas that are
// easily inferrable. However we have a desire to have all function inputs
// and outputs declaratively typed. So this let's us ignore the parameters
// inferrable lint.
"@typescript-eslint/no-inferrable-types": [
"error",
{ ignoreParameters: true },
],
// This rule tries to ensure we use camelCase for all variables, properties
// functions, etc. However, it is not always possible to ensure properties
// are camelCase. Specifically we have `node.__gatsby_resolve` which breaks
// this rule. This allows properties to be whatever they need to be.
"@typescript-eslint/camelcase": ["error", { properties: "never" }],
// This rule tries to prevent using `require()`. However in node code,
// there are times where this makes sense. And it specifically is causing
// problems in our tests where we often want this functionality for module
Expand Down
Loading

0 comments on commit a6a38c7

Please sign in to comment.