1
0
mirror of synced 2025-12-30 03:01:36 -05:00
Commit Graph

549 Commits

Author SHA1 Message Date
Peter Bengtsson
a39614fdcf remove supertest dependency (#28572)
* remove supertest dependency

* remove bad test
2022-06-16 15:56:41 +00:00
Peter Bengtsson
d4692b208e put the full plan name in the page titles (#28450)
* put the full plan name in the page titles

* fix tests
2022-06-16 13:29:23 +00:00
Peter Bengtsson
071c95a91c make miniToc pure data and no html strings (#28517)
* make miniToc pure data and no html strings

* fixups

* some types refactoring
2022-06-15 18:31:36 +00:00
Kevin Heis
71fedb1f31 Update to helmet 5 (#28488)
* Update to helmet 5

* Disable cross-origin-embedder-policy

* Update helmet.js

* Update helmet.js

* Add CORS on get / options

* Update helmet.js

* Update helmet.js

* Update helmet.js

* Update helmet.js

* Revert "Update helmet.js"

This reverts commit 61ad2fb641ca16a31bf148164c395f2ba91e1734.

* Open up github domains

* Include self

* Update helmet.js

* Update helmet.js
2022-06-14 21:43:25 +00:00
Peter Bengtsson
c45c378ad7 memoize reading lib/graphql/static/schema*.json files (#28443) 2022-06-13 18:21:22 +00:00
brannon
000a34a1a7 Add explicit config value to enable Fastly testing. 2022-06-03 09:52:02 -06:00
brannon
e7ec9ad487 Merge branch 'main' into brannon-serve-stale-content 2022-06-02 17:33:13 -06:00
brannon
d575b8edd6 Update Fastly test middleware to run in staging ONLY.
Add ability to set more headers to mimic real content responses.
Add ability to inject errors, to help in validating behavior.
2022-06-02 17:19:53 -06:00
Peter Bengtsson
d014f36222 fix external redirects (#28063)
* fix external redirects

* oops

* feedbacked
2022-06-02 02:06:29 +00:00
Peter Bengtsson
7e614adc12 wrap async middlewares correctly (#28030)
* wrap async middlewares correctly

* clean up more

* feedbacked
2022-06-01 15:13:23 +00:00
Mike Surowiec
8baf00154f disable per-request logging in production (#28056)
* disable per-request logging in production

* cleanup log disabling

Co-authored-by: Peter Bengtsson <mail@peterbe.com>
2022-05-31 21:34:10 +00:00
Peter Bengtsson
107d1d9176 understanding when the archived fallback redirects are used (#28128) 2022-05-31 18:27:44 +00:00
Peter Bengtsson
0340760554 remove spotContentFlaws middleware (#28068) 2022-05-31 18:19:16 +00:00
Peter Bengtsson
31c3fc36b2 don't fail on posting comment from English link checker (#28059)
* don't fail on posting comment from English link checker

* small correction on line break and longer timeout patience

* feedbacked
2022-05-31 18:05:39 +00:00
Peter Bengtsson
ca5e538c1b correct statsd prefix for cache full rendering (#27983) 2022-05-25 10:53:09 -04:00
Peter Bengtsson
75c0ec5cab /en/ permanent redirects to /en should be CDN cacheable (#27976) 2022-05-25 13:51:16 +00:00
Peter Bengtsson
9bef33aec4 let front door handle invalid paths (#27954) 2022-05-24 18:30:05 +00:00
Peter Bengtsson
5874a9c13b Don't bother render-caching if no next data script (#27944) 2022-05-24 15:39:33 +00:00
Mike Surowiec
fac6d5a85c feat: remove sigsci (#27932) 2022-05-24 09:49:19 -05:00
Peter Bengtsson
bb9bfac634 increase overload protection max delay to 500ms (#27912)
Co-authored-by: Mike Surowiec <mikesurowiec@users.noreply.github.com>
2022-05-24 00:42:59 +00:00
Peter Bengtsson
bfd9ae0aed fast root redirect (#27925) 2022-05-23 21:36:58 +00:00
Peter Bengtsson
e53f40cfc6 Optimize rendering cache (#27917)
* Optimize rendering cache

* deleted the wrong return

* put it back

* oops. thanks eslint
2022-05-23 18:32:05 +00:00
Peter Bengtsson
18504871b9 cache full rendering (#25424)
* cache full rendering

* still not working with gzip

* progress progress progress

* smaller

* hacky progress

* small fixes

* wip

* lock file

* wip

* wip

* package-lock updates

* wip

* search DOM in lowercase

* simplify

* with instrument

* improve test coverage

* mutateCheeriobodyByRequest

* fix

* remove renderContentCacheByContex

* disable render caching in sync-search

* diables things in github/github link checker

* gzip lru

* tidying up

* updated

* correct tests

* fix: move userLanguage to LanguagesContext

* Revert "fix: move userLanguage to LanguagesContext"

This reverts commit d7c05d958c71eaad496eb46764eb845d80b866ca.

* contexts ftw

* fixed rendering tests

* oops for got new file

* nits addressed

Co-authored-by: Mike Surowiec <mikesurowiec@users.noreply.github.com>
2022-05-23 12:12:09 +00:00
brannon
295de2e979 Change cache test env vars to read from HTTP headers instead. 2022-05-19 15:33:09 -06:00
brannon
6f5255cb92 Add comments explaining the purpose of the fastly-cache-test middleware. 2022-05-19 14:50:56 -06:00
brannon
b3ca430d48 Add env var to control stale cache parameters 2022-05-19 13:15:18 -06:00
brannon
671b9a81b9 Add endpoint for testing different cache settings in Fastly 2022-05-19 12:59:35 -06:00
Peter Bengtsson
27246f0c2a 300ms maxEventLoopDelay in overload-protection (#27656) 2022-05-18 03:00:07 +00:00
Peter Bengtsson
b0d1d5cd20 fix use of DISABLE_OVERLOAD_PROTECTION (#27711) 2022-05-16 13:51:38 +00:00
Peter Bengtsson
5630a4139a process.env.DISABLE_OVERLOAD_PROTECTION (#27692) 2022-05-13 15:29:52 -07:00
Peter Bengtsson
677d6a0bc9 unbreak sync-search by making overload protection configurable (#27680) 2022-05-13 16:51:37 +00:00
Peter Bengtsson
1108ecda90 remove loader.io middleware (#27678) 2022-05-13 08:16:19 -07:00
Peter Bengtsson
8580fb5e42 fast HEAD requests (#27672)
* fast HEAD requests

* update test
2022-05-13 14:46:57 +00:00
Peter Bengtsson
46303ebba7 more patience in the overload-protection (#27654) 2022-05-12 18:17:24 +00:00
Mike Surowiec
b93a3ec387 feat: add overload-protection (#27612)
* feat: add overload-protection

* Update middleware/overload-protection.js

Co-authored-by: Peter Bengtsson <mail@peterbe.com>

* fix: tests

Co-authored-by: Peter Bengtsson <mail@peterbe.com>
2022-05-12 16:34:25 +00:00
Mike Surowiec
ed8eda1f60 feat: add signal sciences (#27640)
* tmp: add sigsci

* add sigsci.js

* add sigsci.js

* feat: add sigsci to middleware

* convert sigsci to esmodule

* add sigsci-agent to docker-compose.tmpl
2022-05-12 16:15:17 +00:00
Peter Bengtsson
6605154221 Revert "Fastly Signal Science agent and module (#27529)" (#27624)
This reverts commit aae78966ef.
2022-05-11 14:39:47 -07:00
Peter Bengtsson
aae78966ef Fastly Signal Science agent and module (#27529)
* Fastly Signal Science agent and module

* create an assets/build.txt

* try that

* don't experiment with build-args

* do it not just for public builds

* fix comment

* remove experimentation

* actually try using it

* bit louder

* correction

* remove debug logging
2022-05-11 21:18:01 +00:00
Peter Bengtsson
36da8f2c73 expose build SHA (#27542)
* expose build SHA

* dbg

* dbg

* dbg

* sub

* oops

* oops

* try this

* debugging

* debugging

* debugging

* debugging

* debugging

* without quotes

* typo

* typo

* singular

* mention in Dockerfile

* plural

* does this work

* does this work

* tidying up

* no cache

* Update middleware/index.js

Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com>

Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com>
2022-05-11 19:14:30 +00:00
Peter Bengtsson
7211419ef1 remove stray console log (#27440) 2022-05-03 15:30:03 -04:00
Rachael Sewell
749efd7b99 Rest redirect endpoint (#27027) 2022-04-25 16:14:04 +00:00
Grace Park
b98c83e924 REST operations sidebar (#26225)
* testing out a rest operations sidebar

* cleanup

* renamed 5 files

* renamed 5 files

* set redirect_from on 5 files

* renamed 1 files

* renamed 1 files

* renamed 3 files

* renamed 1 files

* renamed 1 files

* renamed 3 files

* renamed 1 files

* renamed 2 files

* renamed 1 files

* renamed 4 files

* renamed 15 files

* renamed 2 files

* renamed 6 files

* renamed 1 files

* renamed 4 files

* renamed 7 files

* renamed 1 files

* renamed 3 files

* renamed 3 files

* renamed 1 files

* renamed 5 files

* renamed 1 files

* renamed 1 files

* renamed 3 files

* renamed 4 files

* renamed 1 files

* renamed 1 files

* renamed 2 files

* renamed 4 files

* renamed 1 files

* renamed 1 files

* renamed 1 files

* renamed 6 files

* renamed 6 files

* renamed 4 files

* move files

* adding more

* updating to add restcontext and start of removing data/reusables/rest-reference

* removed data/reusables

* add a RestMiniTocItem and updating the filtering to add a subcategory so all manually added H3s are in mini tocs in addition to operations

* remove console log

* [WIP]: REST New Proposal Sidebar (#26471)

* saving

* update sidebar

* remove console log

* update guides and overview

* import Category for category level rest pages

* update undefined restOperations

* update restOperationData category and subcategory levels"

* minor updates

* update get mini toc items function

* updating REST context for sidebar

* updating rest data

* remove console logs

* WIP: mini-toc-ing the sidebar

Co-authored-by: Robert Sese <rsese@github.com>

* A little cleanup

* Fix first subcategory link and add some comments

* updating anchor links in sidebar

* adding updates

* remove standalone

* update product and maptopic pages using article context

* add conditional link wrapper

* fix sidebar toggle and versions for enterprise admin

* update versions per subcategory

* Highlight sidebar link for current page

* Update miniToc hash links and hash change tracking

* fix unique key in CollapsibleSection

* Fix list markup

* remove title

* update permissions

* Hide minitocs on landing (#26594)

* hide minitocs on landing page

* simplify page components and remove minitoc from sidebar for guides/overview

* fix carats and category fix

* remove id

Co-authored-by: Grace Park <gracepark@github.com>

* updating content based on versions script check with the OpenAPI

* update script and content files

* update script and content/rest files

* update to add TocLanding

* update script

* update index files

* add codespaces repository-secrets

* remove openapi schema check script

* remove minitocs at the top

* add h2 about the {title} api

* fix tests/unit/openapi-schema.js

* Fix linting tests

* fix search/topics test

* fix tests/unit/pages test

* update rest/reference links in components

* run prettier

* Update components/rest/RestReferencePage.tsx

Co-authored-by: Rachael Sewell <rachmari@github.com>

* Update components/rest/RestReferencePage.tsx

Co-authored-by: Rachael Sewell <rachmari@github.com>

* Update pages/[versionId]/rest/[category]/[subcategory].tsx

Co-authored-by: Rachael Sewell <rachmari@github.com>

* Update pages/[versionId]/rest/[category]/[subcategory].tsx

Co-authored-by: Rachael Sewell <rachmari@github.com>

* Update pages/[versionId]/rest/[category]/[subcategory].tsx

Co-authored-by: Rachael Sewell <rachmari@github.com>

* Update pages/[versionId]/rest/[category]/[subcategory].tsx

Co-authored-by: Rachael Sewell <rachmari@github.com>

* Update tests/unit/openapi-schema.js

Co-authored-by: Rachael Sewell <rachmari@github.com>

* updating comment location

* remove dependabot override

* remove path-utils current product update for rest

* run linter

* remove dependabot.md and remove h2 heading on restreference

* update the correct product to rest for rest pages

* adding comments for updates to path-utils

* remove console log

* REST sidebar: handle legacy v3 redirects (#26686)

* Add script to handle legacy v3 REST redirects

* Run the script

* Handle a redirect to a redirect

* Update REST test URLs

* 'await' and test runs subcategory of checks

* Update REST URLs for routing/developer-site-redirects tests

* Update developer-redirects fixture with new REST URLs

* Resolve merge conflicts

* Update rest-redirects fixture with new REST URLs

* Fix broken links with REST pages re-org

* redirectTo could be undefined

* Fix script for posterity, can't redirect paths with hashes

* Remove invalid hash redirects

* Typically don't need to save one-off scripts

* Undo redirect changes (not necessary for handling v3 redirects)

* Remove script-added redirects

* Update old v3 redirects with new REST URLs

* No more GHES search indexing page

* 'org' not 'organization'

* Update fixture data for new REST URLs

* revert any content directory changes

Co-authored-by: Grace Park <gracepark@github.com>
Co-authored-by: Rachael Sewell <rachmari@github.com>

* Adding test rest (#26750)

* add test to check openapi schema versions and content rest frontmatter versions

* update lib/redirects

* fix test and add error messages

* adding repository secrets

* adding repository-secrets.md

* Revert "update lib/redirects"

This reverts commit 3aafe28265764d5bc09c0c478c8e0ca099c8fbcf.

* remove lib/redirects changes and console logs

* Update lib/rest/index.js

Co-authored-by: Rachael Sewell <rachmari@github.com>

* update unique key

* Rest client side redirects (#26754)

* adding tags subcategory for the rest content repos category

* run prettier

* bug fix for anchor scrolls" (#26892)

* updating width size for rest reference page

* Rest sidebar consolidation (#26862)

* refactor sidebar

* fix articlecontext provider issue on rest product landing page for all versions

* fix a bug, create new component

* revert change to create new component and fix bug

Co-authored-by: Rachael Sewell <rachmari@github.com>

* Set currentAnchor with a hashchange handler (#26923)

* Rest sidebar design tweaks (#26807)

* Rest sidebar design tweaks

* tweak color to subtle

* use muted color and margin for line

* update to design feedback

Co-authored-by: Grace Park <gracepark@github.com>

* Remove cheerio from rest-collapsible (#26948)

* remove cheerio from rest-collapsible

* update type

* adding endswith instead

* use productId instead

* one off edge case for secret-scanning

* Reorganize subcategory and category, Update pre -> div, Add RestContext (#26950)

* reorganize subcategory and category

* add RestContext

* update comment

* update for endpoints page

* add comment

* move object to restcontext

* remove effectiveDate in restcontext

* remove width calculation for rest reference page

* fix adding manual writer's minitocs to sidebar

* update with feedback

* update comment

* update isRestReferencePage

* remove page component and fix bug

* adding back rest/index.tsx

Co-authored-by: Rachael Sewell <rachmari@github.com>

* update content/rest"

* add back design tweak

* update to div

* update margins on rest api reference

* remove page component

* adding tests

* separate product from rest sidebar (#27065)

* separate product from rest sidebar

* Use ProductCollapsibleSections for product pages

* fix tests

Co-authored-by: Robert Sese <rsese@github.com>
Co-authored-by: Grace Park <gracepark@github.com>

* Rest sidebar translations (#27052)

* update translations

* remove general test

Co-authored-by: Robert Sese <rsese@github.com>
Co-authored-by: Rachael Sewell <rachmari@github.com>
2022-04-20 10:19:48 -07:00
Peter Bengtsson
3b1b69002b measure invalid paths handled (#26734) 2022-04-06 16:47:47 +00:00
Peter Bengtsson
a4def10b2c remove rate limiter and slow-down middleware (#26709)
* remove rate limiter and slow-down middleware

* update package-lock.json after node-fetch removal in main
2022-04-05 19:38:25 +00:00
Peter Bengtsson
68400c52a8 don't test external early-access in unit tests (#26612)
* don't test external early-access in unit tests

* make the rendering tests less weird && gg push
2022-04-04 21:00:14 +00:00
Peter Bengtsson
0a0c83db5b refactor early access breadcrumbs (#26558)
* refactor early access breadcrumbs

* Update permissions metadata to include users and teams with explicit access

* Inform users of permission requirement for dependabot alerts

* Apply suggestions from code review

* version previews (#26571)

* update search indexes

* New translation batch for pt (#26591)

* Add crowdin translations

* Run script/i18n/homogenize-frontmatter.js

* Run script/i18n/fix-translation-errors.js

* Run script/i18n/lint-translation-files.js --check rendering

* run script/i18n/reset-files-with-broken-liquid-tags.js --language=pt

* run script/i18n/reset-known-broken-translation-files.js

* Update subcategories for Codespaces (#25812)

* Version actions for GHES, use reusables (#26004)

Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com>
Co-authored-by: Sarah Edwards <skedwards88@github.com>

* New translation batch for ja (#26599)

* Add crowdin translations

* Run script/i18n/homogenize-frontmatter.js

* Run script/i18n/lint-translation-files.js --check rendering

* run script/i18n/reset-files-with-broken-liquid-tags.js --language=ja

* run script/i18n/reset-known-broken-translation-files.js

* Check in ja CSV report

Co-authored-by: Grace Park <gracepark@github.com>

* New translation batch for cn (#26598)

* Add crowdin translations

* Run script/i18n/homogenize-frontmatter.js

* Run script/i18n/lint-translation-files.js --check rendering

* run script/i18n/reset-files-with-broken-liquid-tags.js --language=cn

* run script/i18n/reset-known-broken-translation-files.js

* Check in cn CSV report

Co-authored-by: Grace Park <gracepark@github.com>

* New translation batch for es (#26597)

* Add crowdin translations

* Run script/i18n/homogenize-frontmatter.js

* Run script/i18n/fix-translation-errors.js

* Run script/i18n/lint-translation-files.js --check rendering

* run script/i18n/reset-files-with-broken-liquid-tags.js --language=es

* run script/i18n/reset-known-broken-translation-files.js

* Check in es CSV report

Co-authored-by: Grace Park <gracepark@github.com>

* update search indexes

* Rename xxtest-devcontainer.json to devcontainer.json

* Delete .devcontainer/java-environment directory

* Delete .devcontainer/ruby-environment directory

* Update development.md

* Update CONTRIBUTING.md

* Add link to troubleshooting (#26514)

* update search indexes

* fix old tests

Co-authored-by: Anthony Swierkosz <anthony@swierkosz.dev>
Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com>
Co-authored-by: Sarah Edwards <skedwards88@github.com>
Co-authored-by: GitHub Actions <action@github.com>
Co-authored-by: docubot <67483024+docubot@users.noreply.github.com>
Co-authored-by: Brian McManus <bdmac@github.com>
Co-authored-by: Lucas Costi <lucascosti@users.noreply.github.com>
Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com>
Co-authored-by: Grace Park <gracepark@github.com>
Co-authored-by: hubwriter <hubwriter@github.com>
2022-04-01 10:25:07 -04:00
Peter Bengtsson
bd57e258dc don't send response headers if response is done (#26550)
* don't send response headers if response is done

* better
2022-03-30 13:36:12 +00:00
Sarah Schneider
9bb36a17d4 remove Insights-specific logic and update comment (#26483)
Co-authored-by: Grace Park <gracepark@github.com>
2022-03-29 18:18:34 +00:00
Peter Bengtsson
8362602503 do rendering end-to-end tests with a real server (#26169)
* reinstate

* start server manually

* routing tests too

* skip more

* sleep more and fail if not 200

* use e2etest for content/ too

* feedbacked
2022-03-18 17:06:12 -04:00
Mike Surowiec
31acea648d feat: add slow down middleware (#26207)
* feat: add slow down middleware

Co-authored-by: Peter Bengtsson <mail@peterbe.com>
2022-03-15 13:31:12 -05:00