1
0
mirror of synced 2025-12-21 02:46:50 -05:00
Commit Graph

341 Commits

Author SHA1 Message Date
Rachael Sewell
df16267a8f remove cached-index-names file and dry run sync used for Algolia (#21133) 2021-08-25 22:04:26 +00:00
James M. Greene
08db1c970c Refactor Staging deployment workflow to support open source PRs (#20459)
* Add a Staging build workflow

* Remove all commented out code from build workflow

It will be handled in https://github.com/github/docs-engineering/issues/726

* Use pinned version of upload-artifact action

* Tweaks to build

* Minor deployment script refactoring

* Update the Staging deployment workflow

* Missed refactoring tweak

* Add relevant comments

* Update Heroku app naming convention for Actions deploy to include 'gha-' prefix

* Update Heroku app ConfigVars and SourceBlob for optional prebuilt app

* Remove obsolete 'dist/' dir from PR build artifact

See https://github.com/github/docs-internal/pull/20405

* Ensure a new enough version of npm is used

* Switch to creating a tarball for upload

* Remove obsolete 'layouts' dir from file list

* Ditch the verbosity for 'tar'... too many files

* Add tarball support to deploy

* Add esm workaround to deploy script

See https://github.com/actions/github-script/issues/168

* Temporarily ignore staging deploy workflow from workflow linter

* Update deployment to use a Heroku Build Source instead of a GitHub Actions Artifact

* Update undeploy workflow to use ESM workaround

See https://github.com/actions/github-script/issues/168

* Add 'esm' package to optionalDependencies to better support workaround

See https://github.com/actions/github-script/issues/168

* Add Slack notifications for workflow failures

* Wrap AppSetup polling in try-catch

* Improve dyno monitoring

* Rename 'script/deploy' to have a .js extension #esm

* Update script references to include the extension

* Use non-deprecated Sources API for Heroku

* Use normal quotes

* Stub in a step to mark deployment inactive after timing out

* Apply suggestions from code review

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

Co-authored-by: Rachael Sewell <rachmari@github.com>
2021-08-25 20:45:51 +00:00
Rachael Sewell
9a96a2699f Deprecation workflow updates (#20962) 2021-08-18 23:05:04 +00:00
Rachael Sewell
8e7b1a0370 Remove 2.21 from the supported list of GHES versions (#20935) 2021-08-17 15:43:06 -07:00
Lucas Costi
ee29fedb4e Remove breaking commander functions (#20825)
.passCommandToAction() is undefined, and was removed in Commander 7.0.0. See release note: a9c9f17c7e/CHANGELOG.md (deleted)
2021-08-12 20:24:56 +00:00
Rachael Sewell
a92853e40d reapply some classes for lunr indexing (#20765) 2021-08-11 15:06:01 +00:00
Grace Park
2dbea3737a Removing algolia (#20633) 2021-08-05 13:10:51 -04:00
Kevin Heis
b29e37318a Remove import x statements (#20594)
* Clear out most import x

* Update rimraf use

* Move up readme blocks in scripts
2021-07-29 20:28:30 +00:00
Kevin Heis
1ed18e1448 Clear out some non-fn references to Algolia (#20592)
* Clear out some non-fn references to Algolia

* Update .github/workflows/dry-run-sync-search-indices.yml

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

* Update contributing/search.md

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

Co-authored-by: James M. Greene <JamesMGreene@github.com>
2021-07-29 20:20:55 +00:00
Kevin Heis
0b1ff73a46 Update some readFileSync to await readFile with top level await (#20525)
* Update some readFileSync to await readFile with top level await

* More updates

* Update all-products.js

* Use 'lib/readfile-async.js' in runtime files for better performance

* Remove unnecessary use of 'for await...of' loops

* Revert to importing 'fs/promises'

Co-authored-by: James M. Greene <jamesmgreene@github.com>
2021-07-29 16:45:46 +00:00
Kevin Heis
d68dde17d1 Upgrade pipeline with env COMMONMARK=1 npm start to see new, otherwise parse current (#20508)
* Update the trim nightmare

* Update create-processor.js

* Update other packages in the rendering pipeline

* A few more updates

* Fix tables

* Update lint-files.js

* Fix copy code blocks

* Update render-content.js

* remove whitespace from liquid conditionals

* We no longer need require eslint rules

* Neat, it worked

* Revert test change

* Update create-processor.js

* Without aliases

Co-authored-by: Chiedo John <2156688+chiedo@users.noreply.github.com>
Co-authored-by: Rachael Sewell <rachmari@github.com>
2021-07-29 14:24:26 +00:00
Kevin Heis
eddadb875e LFS the Lunr Indexes (#20521)
* LFS the Lunr Indexes

* Add a note about installing Git LFS

* Run "install" command

* Update indexes

* Index names
2021-07-27 22:06:31 +00:00
Mike Surowiec
9386571aa4 fix: use named export for all-versions (#20478)
* fix: use named export for all-versions

* run prettier
2021-07-22 19:29:00 +00:00
Rachael Sewell
d9b75d1e58 Deprecate 2.21 script updates (#20454) 2021-07-21 21:22:38 +00:00
James M. Greene
df301cb5da Remove all code related to Redis page caching (#20457)
Towards simplification for https://github.com/github/docs-engineering/issues/678
2021-07-21 20:44:00 +00:00
Kevin Heis
fa0fbd0db9 Delete unneeded script files (#20426)
* Delete convert-cjs-to-esm.mjs

* Delete commonmark-indent.js
2021-07-20 16:35:38 -07:00
Sarah Schneider
cc2d10d1b3 Rewrite Liquid deprecation script (#20225) 2021-07-19 22:36:15 +00:00
Kevin Heis
c451f3269e Script to update ol/ul indents from 2 to 4 spaces (#20384)
* Script to update ol/ul indents from 2 to 4 spaces

* Update commonmark-indent.js

* Update commonmark-indent.js
2021-07-19 15:04:22 +00: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
Rachael Sewell
3b32262786 ensure graphql workflow fails with non-zero exit code (#20332) 2021-07-14 08:04:58 -07:00
Rachael Sewell
87690bf634 revert to using static content type (#20319) 2021-07-13 09:54:09 -07:00
Kevin Heis
fed486f7d7 Script to automate 90% of CommonJS -> ESM (#20016)
* Create convert-cjs-to-esm.mjs

* Update convert-cjs-to-esm.mjs

* update script

* update script

* update script

* update script

* update script

* update script

* update script

* update script

* update script

* update script

* update script

* update script

* update script

* update script

* update script

* update script

* update script

* update script

* update script

* update script

* update script

* update script

* update script

* Address a goofy export

* Update convert-cjs-to-esm.mjs

* Fix more exports

* Revert "Merge branch 'goofy-export' into cjs-esm-script"

This reverts commit c23927b824916ee5bc1443849a0edc3a5765cec6, reversing
changes made to 4e760d33f63838b164bc95f18447945d173cc849.

* Apply suggestions from code review

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

Co-authored-by: James M. Greene <JamesMGreene@github.com>
2021-07-12 11:07:30 -07:00
Robert Sese
cda09b5b00 Use path from repo root for Actions (#20262) 2021-07-02 17:45:20 +00:00
Rachael Sewell
4f3761004b OpenAPI form data curl examples (#19507) 2021-06-30 17:33:20 -07:00
Robert Sese
b08d994de8 Use path from repo root for Actions (#20224)
Co-authored-by: James M. Greene <JamesMGreene@github.com>
2021-06-30 22:35:09 +00:00
Sarah Schneider
7de66fe4ef Merge branch 'main' of github.com:github/docs-internal into script-to-use-short-versions 2021-06-24 10:14:50 -04:00
Kevin Heis
a92d820888 Remove remaining JSON requires (#20110)
* Remove remaining JSON requires

* Lint

* Update feature-flags.js
2021-06-23 14:57:50 -07:00
Sarah Schneider
5e10cea9ac Merge branch 'main' of github.com:github/docs-internal into script-to-use-short-versions 2021-06-23 14:45:10 -04:00
Grace Park
fcf1fdd682 adding james feedback to add single app instance 2021-06-23 11:21:20 -07:00
Grace Park
cbdd722cac Merge branch 'main' into dynamic-esm 2021-06-23 10:46:25 -07:00
Grace Park
6c0b43a4bb updating libapp in one script and tests 2021-06-23 10:46:10 -07:00
Rachael Sewell
aa437c44c8 temp convenience scripts for short titles (#19939) 2021-06-23 04:03:06 +00: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
Sarah Schneider
e7bd9cb1f0 run script on early access 2021-06-22 13:27:00 -04:00
Sarah Schneider
47184804e2 allow the script to be run on files that already have short names 2021-06-22 13:03:19 -04:00
Sarah Schneider
f5b2590d62 update deprecated frontmatter as part of script run 2021-06-22 12:53:22 -04:00
Sarah Schneider
0c35c0233b Merge branch 'main' of github.com:github/docs-internal into script-to-use-short-versions 2021-06-22 12:50:47 -04:00
Grace Park
9401a8f13a Merge branch 'main' into upgrade-esm 2021-06-18 13:13:53 -07:00
Grace Park
7f6a277a8e clear out dynamic require 2021-06-18 13:08:28 -07:00
Sarah Schneider
ff1c304034 Merge branch 'main' into update-old-script 2021-06-18 10:10:26 -04:00
Grace Park
8154d3b701 adding mostly readfilesync of path updates to require 2021-06-17 20:22:04 -07:00
Grace Park
0762734b43 fixed easy global requires 2021-06-17 18:39:38 -07:00
Kevin Heis
55e7a69460 Update update-files.js (#19996) 2021-06-17 20:04:20 +00:00
Sarah Schneider
23af2508ff Merge branch 'main' into update-old-script 2021-06-17 16:03:30 -04:00
James M. Greene
50fbcc62d3 Deploy/undeploy PRs to/from staging via an Actions workflow (#19865)
* Add 'script/deploy' to enable manual deploys to Heroku

* Pass API tokens into 'deploy-to-staging' module usage

* Construct Octokit instance to pass in

* Get PR branch name and verify state

* Reorganize

* Rename option to 'octokit'

* Add missing option

* Actually use the convenience methods for convenience

* Simplify top-level script

* Top-level script revisions

* Add parse-pr-url module

* Add create-staging-app-name module

* Remove misplaced comment

* Pass in owner

* Use owner param

* More variables

* Pass owner along more

* Correct prNumber param reference

* Add WIP deploy-to-staging module

* Prevent 'scripts/' and '.github/actions-scripts/' files from being modified in open source repo

* Extract PR author earlier

* Add note about optionally supplying DOCUBOT_REPO_PAT env var

* Override Heroku env var during AppSetup creation instead of later to avoid triggering a second deploy

* Updates to deploy-to-staging module

* Lots of updates

* Add dyno start-up monitoring and warmup requests

* Ignore 'script/deploy' in the repository-references test

* Correct path to Octokit helper

* Temporarily add a 'gha-' prefix to environment names

* Log whole error if terminal. Good for Octokit errors!

* Correct Octokit preview configuration

* Add more logging around Heroku build and release

* Added more timings to log messages

* Monitor dyno states specifically from the dyno list view to avoid 404 oddities when Free dynos are dropped and non-Free dynos are added

* Don't wait for AppSetup status as it includes the Build time

* Updating logging since we don't see DeploymentStatus update messages in the UI =(

* Refactor to extract more properties from the PR object

* Add a workflow to deploy PRs to Staging

* Fix workflow description

* Add skeleton workflow and module for undeploying

* Remove commented out code

* Update undeployment module

* Add '--destroy' flag to 'script/deploy' options

* Add timeout and concurrency key for undeployment

* Add timeout and concurrency key for deployment

* Remove dangling unneeded function declaration

* Add ant-man preview for inactive deployment state setting

* Fix reference to pull request number

* Fix reference to pull request number

* Refactor to extract more properties from the PR object

* Fix reference to pull request number

* Remove workflow

* Add workflow to undeploy closed PRs from staging

* Add repository filters to jobs

* Update to using actions/github-script@4.0.2

* Pass more environment variables that affect deployments

* Add explicit .js extensions to local require in Actions workflow

* Check out the code and install deps first, of course

* Try local requires without the explicit .js extension

* Use our usual version of Octokit instead of the provided 'github' instance to avoid versioning discrepancies

* Explicitly pass in GITHUB_TOKEN to github-script

* Point to the workflow run page as a default log_url

* Exclude staging deployment workflows from the workflow linter until we can get support for the 'concurrency' key (https://github.com/cschleiden/actions-linter/issues/79)

* Remove 'gha-' prefix
2021-06-17 18:02:02 +00:00
Sarah Schneider
a04f3af1d9 Update script/move-category-to-product.js 2021-06-16 21:56:04 -04:00
Sarah Schneider
36c54ea05f update old script 2021-06-16 21:26:04 -04:00
Rachael Sewell
0ae4979f41 clean up openapi build errors (#19963) 2021-06-16 20:08:24 +00:00