|
1 | | -// Script runs daily. |
| 1 | +// This script generates the web platform release notes draft for the next Microsoft Edge Beta version. |
| 2 | +// This script runs daily. |
2 | 3 |
|
3 | 4 | import github from '@actions/github'; |
4 | 5 | import Eleventy from "@11ty/eleventy"; |
5 | 6 | import fs from "fs/promises"; |
6 | 7 | import playwright from "playwright"; |
7 | 8 | import { execSync } from 'child_process'; |
8 | 9 |
|
| 10 | +// Where to find Edge-only origin trials info. |
9 | 11 | const EDGE_OT_ROOT = "https://developer.microsoft.com/en-us"; |
10 | 12 | const EDGE_OT_PAGE = `${EDGE_OT_ROOT}/microsoft-edge/origin-trials/trials`; |
11 | 13 | // If Beta becomes stable within the next N coming days, generate the release notes for Canary. |
12 | 14 | // This way, the release notes are ready for when Canary becomes Beta. |
13 | 15 | const DAYS_NUMBER_BEFORE_RELNOTES_NOTICE = 15; |
| 16 | +// The prefix to use when creating a new git branch for the release notes draft. |
14 | 17 | const BRANCH_NAME_PREFIX = "web-platform-release-notes-"; |
15 | 18 |
|
16 | 19 | async function fetchChromeStatusAPI(url) { |
@@ -82,12 +85,21 @@ async function getActiveEdgeOTs() { |
82 | 85 | // Wait for the OTs to have loaded. We check for the existence of a trial-card |
83 | 86 | // that has a __tags element in it. This element is used to display the |
84 | 87 | // "Microsoft Edge Only" tag. |
85 | | - await page.waitForSelector(".trial-card .trial-card__tags"); |
| 88 | + const tagsLocator = page.locator(".trial-card .trial-card__tags"); |
| 89 | + try { |
| 90 | + await tagsLocator.waitFor({ timeout: 15000 }); |
| 91 | + console.log("Edge-only OT tags are present, proceeding."); |
| 92 | + } catch (e) { |
| 93 | + console.error("Timed out waiting for Edge-only OT tags to appear."); |
| 94 | + await page.close(); |
| 95 | + await scrapingBrowser.close(); |
| 96 | + return []; |
| 97 | + } |
86 | 98 |
|
87 | 99 | // Get the list of all origin trial elements |
88 | 100 | const microsoftOriginTrialEls = await page.locator("css=.trial-card", { hasText: "Microsoft Edge Only" }); |
89 | 101 | const otCards = await microsoftOriginTrialEls.all(); |
90 | | - console.log(`Found ${otCards.length} MS-only origin trials`); |
| 102 | + console.log(`Found ${otCards.length} Edge-only OTs.`); |
91 | 103 |
|
92 | 104 | const otLinks = []; |
93 | 105 | for (const otCard of otCards) { |
|
0 commit comments