From df18c9a6171abb5f79d329cad4fa98e673ce1a6e Mon Sep 17 00:00:00 2001 From: Mathias Bynens Date: Tue, 8 Sep 2020 11:08:42 +0200 Subject: [PATCH 1/2] doc(contributing): add info on bisecting upstream changes --- CONTRIBUTING.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f49a7eb4b3e8f..1f9eab3988216 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -281,6 +281,14 @@ The following steps are needed to update the Chromium version. If it fails, update `package.json` with the expected `devtools-protocol` version. 1. Run `npm run tsc` and `npm install` and ensure that all tests pass. If a test fails, bisect the upstream cause of the failure, and either update the test expectations accordingly (if it was an intended change) or work around the changes in Puppeteer (if it’s not desirable to change Puppeteer’s observable behavior). +### Bisecting upstream changes + +Sometimes, performing a Chromium roll causes tests to fail. To figure out the cause, you need to bisect Chromium revisions to figure out the earliest possible revision that changed the behavior. The script in `utils/bisect.js` can be helpful here. Given a Node.js script that calls `process.exit(1)` for bad revisions, run this from the Puppeteer repository’s root directory: + +```sh +node utils/bisect.js --good 686378 --bad 706915 script.js +``` + ## Releasing to npm Releasing to npm consists of the following phases: From ab8851fe0c3403974b42e188421815a083ab7dd1 Mon Sep 17 00:00:00 2001 From: Mathias Bynens Date: Tue, 8 Sep 2020 15:18:55 +0200 Subject: [PATCH 2/2] Update CONTRIBUTING.md Co-authored-by: Johan Bay --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1f9eab3988216..b14b46f806cc2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -279,7 +279,7 @@ The following steps are needed to update the Chromium version. 1. Update `src/revisions.ts` with the found revision number. 1. Run `npm run ensure-correct-devtools-protocol-revision`. If it fails, update `package.json` with the expected `devtools-protocol` version. -1. Run `npm run tsc` and `npm install` and ensure that all tests pass. If a test fails, bisect the upstream cause of the failure, and either update the test expectations accordingly (if it was an intended change) or work around the changes in Puppeteer (if it’s not desirable to change Puppeteer’s observable behavior). +1. Run `npm run tsc` and `npm install` and ensure that all tests pass. If a test fails, [bisect](#bisecting-upstream-changes) the upstream cause of the failure, and either update the test expectations accordingly (if it was an intended change) or work around the changes in Puppeteer (if it’s not desirable to change Puppeteer’s observable behavior). ### Bisecting upstream changes