E586 Merge pull request #3523 from MicrosoftDocs/better-issue-description · MicrosoftDocs/edge-developer@a152ca6 · GitHub
[go: up one dir, main page]

Skip to content

Commit a152ca6

Browse files
Merge pull request #3523 from MicrosoftDocs/better-issue-description
Generate better issue title and description for new web platform release notes
1 parent 1f1d6f5 commit a152ca6

File tree

2 files changed

+30
-9
lines changed

2 files changed

+30
-9
lines changed

.github/workflows/webplat-relnotes.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
cd scripts
3333
token=${{ secrets.GITHUB_TOKEN }} node web-platform-release-notes.js
3434
35-
- name: Commit changes
35+
- name: Commit changes if needed
3636
run: |
3737
files=$(git ls-files --others --exclude-standard)
3838
if [ -n "$files" ]; then

scripts/web-platform-release-notes.js

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ const EDGE_OT_PAGE = `${EDGE_OT_ROOT}/microsoft-edge/origin-trials/trials`;
1010
// If Beta becomes stable within the next N coming days, generate the release notes for Canary.
1111
// This way, the release notes are ready for when Canary becomes Beta.
1212
const DAYS_NUMBER_BEFORE_RELNOTES_NOTICE = 15;
13+
// The Git branch name where the release notes will be generated.
14+
// Keep this in sync with thge webplat-releasenotes.yaml workflow file.
15+
const BRANCH_NAME = "web-platform-release-notes";
1316

1417
async function fetchChromeStatusAPI(url) {
1518
const response = await fetch(url);
@@ -28,6 +31,14 @@ function longDate(dateString) {
2831
});
2932
}
3033

34+
function getReleaseNoteMDFilePath(version) {
35+
return `https://github.com/MicrosoftDocs/edge-developer/blob/${BRANCH_NAME}/microsoft-edge/web-platform/release-notes/${version}.md`;
36+
}
37+
38+
function getReleaseNoteRawMDFilePath(version) {
39+
return `https://raw.githubusercontent.com/MicrosoftDocs/edge-developer/refs/heads/${BRANCH_NAME}/microsoft-edge/web-platform/release-notes/${version}.md`;
40+
}
41+
3142
async function getActiveEdgeOTs() {
3243
const scrapingBrowser = await playwright.chromium.launch({ headless: true });
3344
const context = await scrapingBrowser.newContext();
@@ -152,7 +163,17 @@ async function main() {
152163
);
153164

154165
// --------------------------------------------------
155-
// 2. Fetch Chrome Status features for the N+1 milestone.
166+
// 2. Check if there isn't already a release notes draft for the next beta version.
167+
// --------------------------------------------------
168+
169+
const rawFileResponse = await fetch(getReleaseNoteRawMDFilePath(nextBetaVersion));
170+
if (rawFileResponse.status === 200) {
171+
console.error(`A PR is already open for the next beta release notes. File exists: ${getReleaseNoteMDFilePath(nextBetaVersion)}.`);
172+
process.exit(0);
173+
}
174+
175+
// --------------------------------------------------
176+
// 3. Fetch Chrome Status features for the N+1 milestone.
156177
// --------------------------------------------------
157178

158179
console.log(
@@ -164,7 +185,7 @@ async function main() {
164185
const csFeatures = csMilestoneData.features_by_type;
165186

166187
// --------------------------------------------------
167-
// 3. Fetch Chrome Status new origin trials in N+1.
188+
// 4. Fetch Chrome Status new origin trials in N+1.
168189
// --------------------------------------------------
169190

170191
console.log(
@@ -190,7 +211,7 @@ async function main() {
190211
});
191212

192213
// --------------------------------------------------
193-
// 4. Fetch current Edge origin trials.
214+
// 5. Fetch current Edge origin trials.
194215
// --------------------------------------------------
195216

196217
console.log(
@@ -199,7 +220,7 @@ async function main() {
199220
const edgeOTs = await getActiveEdgeOTs();
200221

201222
// --------------------------------------------------
202-
// 5. Generate the release notes draft content.
223+
// 6. Generate the release notes draft content.
203224
// --------------------------------------------------
204225
// Write the fetched data locally for 11ty to use, run 11ty, and then delete the file.
205226

@@ -252,7 +273,7 @@ async function main() {
252273
await fs.rmdir("_data", { recursive: true, force: true });
253274

254275
// --------------------------------------------------
255-
// 6. Write the release notes draft content to a file.
276+
// 7. Write the release notes draft content to a file.
256277
// --------------------------------------------------
257278
// All release notes go into /microsoft-edge/web-platform/release-notes/.
258279
// The file name should be the next beta version number.
@@ -262,12 +283,12 @@ async function main() {
262283
await fs.writeFile(releaseNotesPath, releaseNotesContent);
263284

264285
// --------------------------------------------------
265-
// 7. Open an issue on the repo to notify the team about the new release notes draft.
286+
// 8. Open an issue on the repo to notify the team about the new release notes draft.
266287
// --------------------------------------------------
267288

268289
console.log("Opening an issue to notify the team about the new release notes draft.");
269-
const title = `New beta web platform release notes for ${nextBetaVersion}`;
270-
const body = `The release notes draft for the next beta version ${nextBetaVersion} has been generated in [${releaseNotesPath}](${releaseNotesPath}) on the web-platform-release-notes branch.\n\nPlease update the content as needed.`;
290+
const title = `Microsoft Edge Beta ${nextBetaVersion} web platform release notes ready for review`;
291+
const body = `The release notes draft for the next Microsoft Edge beta version ${nextBetaVersion} has been generated in [${nextBetaVersion}.md](${getReleaseNoteMDFilePath(nextBetaVersion)}) on the ${BRANCH_NAME} branch.\n\nPlease [create a pull request](https://github.com/MicrosoftDocs/edge-developer/compare/main...${BRANCH_NAME}), update the content as needed, and close this issue.`;
271292

272293
const octokit = github.getOctokit(process.env.token);
273294
const { data: issue } = await octokit.rest.issues.create({

0 commit comments

Comments
 (0)
0