1
0
mirror of synced 2025-12-21 10:57:10 -05:00
Commit Graph

81 Commits

Author SHA1 Message Date
Peter Bengtsson
ae3dadfc66 cache asset images more aggressively (#23553)
* cache asset images more aggressively

* more careful about which gets the manual surrogate key

* fix rendered-content-link-checker script too

* feedbacked
2021-12-10 13:01:48 +00:00
Peter Bengtsson
7b5711e095 cache archived enterproxy proxy responses much longer (#23456)
* cache archived enterproxy proxy responses much longer

* Update middleware/archived-enterprise-versions.js

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

Co-authored-by: Rachael Sewell <rachmari@github.com>
2021-12-08 19:55:12 +00:00
Peter Bengtsson
7c66d4456f static assets should not use csrf (Set-Cookie) (#23357)
* static assets should not use csrf (Set-Cookie)

Part of #1316

* move setFastlySurrogateKey up too
2021-12-06 13:00:34 +00:00
Kevin Heis
86b6b1ad6f Remove storybook (#21037)
* Remove storybook

* Update index.js
2021-08-23 12:07:54 -07:00
Kevin Heis
8d7bb82e47 Add basic auth to storybook (#20955)
* Add basic auth to storybook

* Update index.js

* Update index.js
2021-08-18 14:03:35 -07:00
Kevin Heis
ae7b652463 Create a storybook with callout component (#20902)
* Create a storybook with callout component

* Add to dist/storybook

* Remove references to dist dir, storybook takes place

* Update Callout.stories.tsx

* Update Dockerfile

* Update Dockerfile
2021-08-17 20:28:59 +00:00
Grace Park
27aa5d92ea Remove FEATURE_NEXTJS Flag Part 1 (#20176)
* cleanup FEATURE_NEXTJS

* fixing some server tests

* updating article a for server tests

* update h2 to h4 map topic tests

* data off on TOCs

* updating dropdown article versions links

* Update so markdown renders in intros

* updating typo and all server tests are now passing

* remove nextjs feature flag

* head.js tests pass

* updating article-version-picker

* remove nextjs feature flag browser test

* update header.js tests

* fix page-titles.js test

* fix deprecated-enterprise versions

* adding early access

* testing

* getting childTocItem

* fixing table of contents to show child toc items

* updated to 2 because the sidebar article also has the same link

* remove comment

* updating pick

* Update TocLandingContext.tsx

* update package.json and change className to h4 for h2

* updating with mikes feedback

* remove a.active test

* React clean up: Delete unnecessary layouts/includes Part 2 (#20143)

* Delete unnecessary layouts

* setting back tests failing :(

* update layouts

* delete unnecessary includes

* remove github-ae-release-notes and updating layouts

* remove a.active test
2021-07-16 14:54:25 -07:00
Kevin Heis
8a56437c93 Pretty format (#20352)
* Update prettier flow to include JS

* Run prettier

* ...run prettier
2021-07-14 14:35:01 -07:00
Kevin Heis
42e785b0a8 Migrate CommonJS to ESM (#20301)
* First run of script

* Get the app running --- ish

* Get NextJS working

* Remove `node:`

* Get more tests passing in unit directory

* Update FailBot test to use nock

* Update test.yml

* Update Dockerfile

* tests/content fixes

* Update page.js

* Update build-changelog.js

* updating tests/routing

* Update orphan-tests.js

* updating tests/rendering

* Update .eslintrc.js

* Update .eslintrc.js

* Install jest/globals

* "linting" tests

* staging update to server.mjs

* Change '.github/allowed-actions.js' to a ESM export

* Lint

* Fixes for the main package.json

* Move Jest to be last in the npm test command so we can pass args

* Just use 'npm run lint' in the npm test command

* update algolia label script

* update openapi script

* update require on openapi

* Update enterprise-algolia-label.js

* forgot JSON.parse

* Update lunr-search-index.js

* Always explicitly include process.cwd() for JSON file reads pathed from project root

* update graphql/update-files.js script

* Update other npm scripts using jest to pass ESM NODE_OPTIONS

* Update check-for-enterprise-issues-by-label.js for ESM

* Update create-enterprise-issue.js for ESM

* Import jest global for browser tests

* Convert 'script/deploy' to ESM

Co-authored-by: Grace Park <gracepark@github.com>
Co-authored-by: James M. Greene <jamesmgreene@github.com>
2021-07-14 13:49:18 -07:00
James M. Greene
2dbae93c53 Try to prevent late/duplicate response errors (#20077)
* Ensure all Express 'next' calls include 'return's

* Add headersSent checks during archived versions flow

* Return a 404 earlier if archived resource fetch fails

* Short-circuit responses for archived stuff

* Be more careful about responding to and short-circuiting after search requests

* Fix tests
2021-06-28 19:31:54 +00:00
Sarah Schneider
7e3e75616c Merge branch 'main' of github.com:github/docs-internal into feature-versioning 2021-06-23 15:59:37 -04:00
James M. Greene
7ee7a1aaaa Merge branch 'main' into feature-versioning 2021-06-22 15:28:34 -05:00
Grace Park
23f586bb93 merge and fix conflicts 2021-06-22 11:41:10 -07:00
Grace Park
d3d1902414 Merge pull request #20017 from github/upgrade-esm
Enforce and Move to Top Level require
2021-06-22 11:27:48 -07:00
Mike Surowiec
a24d01f78a Fix NextJS 500s (#20048)
* feat: allow server to contextualize request when on a /_next/data path

* add client side routing test, run lint

* enable nextjs client side routing
2021-06-22 17:30:40 +00:00
Grace Park
7f6a277a8e clear out dynamic require 2021-06-18 13:08:28 -07:00
Grace Park
b688ac036c update instrument middleware 2021-06-18 12:14:08 -07:00
Grace Park
0762734b43 fixed easy global requires 2021-06-17 18:39:38 -07:00
Sarah Schneider
a1c1a81b94 Merge branch 'main' of github.com:github/docs-internal into feature-versioning 2021-06-15 19:41:29 -04:00
Mike Surowiec
306f6fc75e Enable more react pages (#19935)
* enable more react landing pages

* move nextjs page logic to separate middleware

* enable codespaces landing page + fixes

* enable /education

* enable /admin

* use pathToRegexp to match routes for react rendering

* run lint

* fix: typo in url

* update sidebar test
2021-06-15 13:31:17 -07:00
Sarah Schneider
a200a74a0f Merge branch 'main' into support-short-versions 2021-06-14 19:52:04 -04:00
Mike Surowiec
6fbfa7d263 feat: add catch for bad accept-language header, prevent downstream 500 (#19909) 2021-06-14 22:45:29 +00:00
Sarah Schneider
7466e24a9b Merge branch 'main' of github.com:github/docs-internal into support-short-versions 2021-06-11 15:25:20 -04:00
Felicity Chapman
23b0b84111 Add Code security landing and guides pages (#19650) 2021-06-10 20:14:56 +00:00
Sarah Schneider
5d6d2d2cb7 Merge branch 'main' of github.com:github/docs-internal into support-short-versions 2021-06-09 17:00:37 -04:00
Sarah Schneider
d1cf56abd5 add short names = true to context object so we can access them in Liquid conditionals 2021-06-09 16:58:19 -04:00
Sarah Schneider
52daa592d3 Merge branch 'main' of github.com:github/docs-internal into middleware-perf-part2 2021-06-04 13:58:30 -04:00
Sarah Schneider
3a75d49a4f add middleware to enable feature-based versioning 2021-05-28 19:46:18 -04:00
Sarah Schneider
4008de0e4f Merge branch 'main' into github-ae-release-notes 2021-05-28 15:17:35 -04:00
James M. Greene
256a58777a Override helmet's referrerPolicy to enable archived asset proxying (#19624)
Fixes https://github.com/github/docs-internal/issues/19504
2021-05-28 17:02:33 +00:00
Sarah Schneider
ff718d7fc1 Merge branch 'main' of github.com:github/docs-internal into github-ae-release-notes 2021-05-24 10:00:07 -04:00
Sarah Schneider
1945b8a3d4 remove tree rendering middleware now that it happens in warm server 2021-05-21 12:06:53 -04:00
Sarah Schneider
5978edb47b remove feature flagged code 2021-05-20 10:01:33 -04:00
Kevin Heis
f6acb1f08a Update dependencies (#19408)
* Update dependencies 2

* Lint fixes

* Update graphql packages

* Update changelog-entry.json

* Update @octokit/rest

* Update commander with help from @rachmari

@rachmari

* Upgrade helmet

* Upgrade js-yaml

* Update server.js

* Update cheerio

* Revert "Update cheerio"

This reverts commit 8aa17c39fbf564ee554037d89e7a473027d16984.
2021-05-19 17:32:47 +00:00
Mike Surowiec
eaddbc5db7 feat: add nextjs middleware handling (#19139)
* feat: add nextjs middleware handling split

* fix: eslint errors

* fix: filter boolean from csp list

* fix: feature flag nextjs server start

* feat: add prettier rules for ts,tsx files

* fix: remove unnecessary async from next middleware

* fix: next middleware name

* Update tsconfig.json

Co-authored-by: James M. Greene <JamesMGreene@github.com>

* Update next-env.d.ts

Co-authored-by: James M. Greene <JamesMGreene@github.com>

* fix: add typescript linting to lint command

* add comment for unsafe-eval, update webpack to use eval in development

* fix: feature flag typo

Co-authored-by: James M. Greene <JamesMGreene@github.com>
2021-05-05 15:23:46 +00:00
Sarah Schneider
757a5961cc delete no longer needed layout file and middleware 2021-04-26 15:36:08 -04:00
Sarah Schneider
a22691b082 update middleware/categories-for-support 2021-04-21 10:45:37 -04:00
Sarah Schneider
b5ffeb8e73 parse Liquid in titles in siteTree and use full titles in generic TOC but short titles in sidebar 2021-04-20 14:02:12 -04:00
Sarah Schneider
26c351f4ff Merge branch 'main' of github.com:github/docs-internal into update-new-site-tree-deps 2021-04-15 14:46:27 -04:00
Sarah Schneider
d1524b16a5 add feature flagged middleware 2021-04-15 14:46:16 -04:00
Sarah Schneider
18b91cd3b1 Merge branch 'main' into update-categories-json 2021-04-15 10:29:46 -04:00
Sarah Schneider
15ff2e2e98 update categories-for-support-team middleware 2021-04-14 10:34:49 -04:00
Sarah Schneider
1623191243 extract layout handling into separate middleware 2021-04-13 14:24:06 -04:00
Vanessa Yuen
bbd9f03f6e Populate product-landing "What's new" section using GitHub Changelog (#18328)
Co-authored-by: Jason Etcovitch <jasonetco@github.com>
Co-authored-by: Rachael Sewell <rachmari@github.com>
Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com>
2021-04-08 20:51:37 +00:00
James M. Greene
c940dcd98b Middleware overhaul! (#18218)
* Middleware overhaul!

- Remove unnecessary 'async' keywords from middleware functions
- Ensure all middleware functions we create have names
- Wrap the method contents of all async middleware functions in a try-catch+next(error) pattern

* Use asyncMiddleware wrapper instead of try-catch+next(error) pattern

* Remove unnecessary try-catch+next(error) pattern from context middleware
2021-03-11 01:12:41 +00:00
James M. Greene
92ac830a44 Do not timeout requests during testing (#18206)
* Do not load the timeout middleware during testing

* Run the link-check-server in testing mode to avoid loading the timeout middleware

* Revert the change to 'package.json'

* Also consider GITHUB_ACTIONS to be a testing environment to support the link checkers
2021-03-10 11:40:25 -06:00
James M. Greene
fd7d0eeb1a Add timeout and abort middleware and processing halts (#18177)
* Add middleware to timeout requests after a period

* Add halt-on-dropped-connection middleware to stop the middleware processing stack if the connection was already dropped

* Add a few strategic bail-out spots for dropped connections during the render-page middleware

* Handle 404s and HEAD requests earlier in the page rendering flow

* Add a few more strategic bail-out spots for dropped connections during the render-page middleware

* Add middleware to notice aborted requests

* Add a check for aborted requests into the isConnectionDropped logic

* Reformat comment for consistency

* Handle aborted requests correctly in the error handler

* Explicit returns for consistency
2021-03-09 19:14:02 +00:00
Sarah Schneider
063e22d151 re-combine release notes middleware 2021-03-08 15:03:34 -05:00
Sarah Schneider
8eb1e69586 separate the middleware for enterprise server vs. github-ae release notes 2021-03-01 17:03:33 -05:00
Kevin Heis
1918d2ea14 Inline CSRF token in HTML (#17748)
* Inline CSRF token

* Fix tests
2021-02-09 22:08:24 +00:00