Skip to content

Commit

Permalink
chore: generate version range for deprecated versions (#7927)
Browse files Browse the repository at this point in the history
  • Loading branch information
OrKoN committed Jan 26, 2022
1 parent be3fce5 commit acac3b3
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Expand Up @@ -282,7 +282,7 @@ The following steps are needed to update the Chromium version.
Not all revisions have builds for all platforms, so we need to find one that does.
To do so, run `utils/check_availability.js -rd` to find the latest suitable `dev` Chromium revision (see `utils/check_availability.js -help` for more options).
1. Update `src/revisions.ts` with the found revision number.
1. Update `versions.js` with the new Chromium-to-Puppeteer version mapping.
1. Update `versions.js` with the new Chromium-to-Puppeteer version mapping and update `lastMaintainedChromiumVersion` with the latest stable Chrome version.
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`.
Expand Down
2 changes: 1 addition & 1 deletion utils/doclint/cli.js
Expand Up @@ -38,7 +38,7 @@ async function run() {
let changedFiles = false;

if (IS_RELEASE) {
const versions = await Source.readFile(
const { versionsPerRelease: versions } = await Source.readFile(
path.join(PROJECT_DIR, 'versions.js')
);
versions.setText(
Expand Down
2 changes: 1 addition & 1 deletion utils/doclint/preprocessor/index.js
Expand Up @@ -151,7 +151,7 @@ function generateTableOfContents(mdText) {
}

const generateVersionsPerRelease = () => {
const versionsPerRelease = require('../../../versions.js');
const { versionsPerRelease } = require('../../../versions.js');
const buffer = ['- Releases per Chromium version:'];
for (const [chromiumVersion, puppeteerVersion] of versionsPerRelease) {
if (puppeteerVersion === 'NEXT') continue;
Expand Down
27 changes: 27 additions & 0 deletions utils/get_deprecated_version_range.js
@@ -0,0 +1,27 @@
/**
* Copyright 2022 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

const {
versionsPerRelease,
lastMaintainedChromiumVersion,
} = require('../versions.js');
const version = versionsPerRelease.get(lastMaintainedChromiumVersion);
if (version.toLowerCase() === 'next') {
console.error('Unexpected NEXT Puppeteer version in versions.js');
process.exit(1);
}
console.log('< ' + version);
process.exit(0);
14 changes: 13 additions & 1 deletion versions.js
Expand Up @@ -42,4 +42,16 @@ const versionsPerRelease = new Map([
['73.0.3679.0', 'v1.12.2'],
]);

module.exports = versionsPerRelease;
// The same major version as the current Chrome Stable per https://chromestatus.com/roadmap.
const lastMaintainedChromiumVersion = '97.0.4692.0';

if (!versionsPerRelease.has(lastMaintainedChromiumVersion)) {
throw new Error(
'lastMaintainedChromiumVersion is missing from versionsPerRelease'
);
}

module.exports = {
versionsPerRelease,
lastMaintainedChromiumVersion,
};

0 comments on commit acac3b3

Please sign in to comment.