From de7d02af930ad232ce6e2b2b4025a53f716b180d Mon Sep 17 00:00:00 2001 From: Sarah Schneider Date: Mon, 24 May 2021 11:59:55 -0400 Subject: [PATCH] more merge-related updates --- content/admin/index.md | 11 ----------- .../release-notes/{ => enterprise-server}/2-21/16.yml | 0 .../release-notes/{ => enterprise-server}/2-21/17.yml | 0 .../release-notes/{ => enterprise-server}/2-21/18.yml | 0 .../release-notes/{ => enterprise-server}/2-21/19.yml | 0 .../release-notes/{ => enterprise-server}/2-21/20.yml | 0 .../release-notes/{ => enterprise-server}/2-21/21.yml | 0 .../release-notes/{ => enterprise-server}/2-22/10.yml | 0 .../release-notes/{ => enterprise-server}/2-22/11.yml | 0 .../release-notes/{ => enterprise-server}/2-22/12.yml | 0 .../release-notes/{ => enterprise-server}/2-22/13.yml | 0 data/release-notes/{ => enterprise-server}/2-22/8.yml | 0 data/release-notes/{ => enterprise-server}/2-22/9.yml | 0 data/release-notes/{ => enterprise-server}/3-0/2.yml | 0 data/release-notes/{ => enterprise-server}/3-0/3.yml | 0 data/release-notes/{ => enterprise-server}/3-0/4.yml | 0 data/release-notes/{ => enterprise-server}/3-0/5.yml | 0 data/release-notes/{ => enterprise-server}/3-0/6.yml | 0 data/release-notes/{ => enterprise-server}/3-0/7.yml | 0 .../{ => enterprise-server}/3-1/0-rc1.yml | 0 middleware/contextualizers/release-notes.js | 9 ++++++--- 21 files changed, 6 insertions(+), 14 deletions(-) rename data/release-notes/{ => enterprise-server}/2-21/16.yml (100%) rename data/release-notes/{ => enterprise-server}/2-21/17.yml (100%) rename data/release-notes/{ => enterprise-server}/2-21/18.yml (100%) rename data/release-notes/{ => enterprise-server}/2-21/19.yml (100%) rename data/release-notes/{ => enterprise-server}/2-21/20.yml (100%) rename data/release-notes/{ => enterprise-server}/2-21/21.yml (100%) rename data/release-notes/{ => enterprise-server}/2-22/10.yml (100%) rename data/release-notes/{ => enterprise-server}/2-22/11.yml (100%) rename data/release-notes/{ => enterprise-server}/2-22/12.yml (100%) rename data/release-notes/{ => enterprise-server}/2-22/13.yml (100%) rename data/release-notes/{ => enterprise-server}/2-22/8.yml (100%) rename data/release-notes/{ => enterprise-server}/2-22/9.yml (100%) rename data/release-notes/{ => enterprise-server}/3-0/2.yml (100%) rename data/release-notes/{ => enterprise-server}/3-0/3.yml (100%) rename data/release-notes/{ => enterprise-server}/3-0/4.yml (100%) rename data/release-notes/{ => enterprise-server}/3-0/5.yml (100%) rename data/release-notes/{ => enterprise-server}/3-0/6.yml (100%) rename data/release-notes/{ => enterprise-server}/3-0/7.yml (100%) rename data/release-notes/{ => enterprise-server}/3-1/0-rc1.yml (100%) diff --git a/content/admin/index.md b/content/admin/index.md index 8bc62e9e4b..f59c4615c4 100644 --- a/content/admin/index.md +++ b/content/admin/index.md @@ -50,14 +50,3 @@ children: - /release-notes - /all-releases --- - - - - - - - - - - - diff --git a/data/release-notes/2-21/16.yml b/data/release-notes/enterprise-server/2-21/16.yml similarity index 100% rename from data/release-notes/2-21/16.yml rename to data/release-notes/enterprise-server/2-21/16.yml diff --git a/data/release-notes/2-21/17.yml b/data/release-notes/enterprise-server/2-21/17.yml similarity index 100% rename from data/release-notes/2-21/17.yml rename to data/release-notes/enterprise-server/2-21/17.yml diff --git a/data/release-notes/2-21/18.yml b/data/release-notes/enterprise-server/2-21/18.yml similarity index 100% rename from data/release-notes/2-21/18.yml rename to data/release-notes/enterprise-server/2-21/18.yml diff --git a/data/release-notes/2-21/19.yml b/data/release-notes/enterprise-server/2-21/19.yml similarity index 100% rename from data/release-notes/2-21/19.yml rename to data/release-notes/enterprise-server/2-21/19.yml diff --git a/data/release-notes/2-21/20.yml b/data/release-notes/enterprise-server/2-21/20.yml similarity index 100% rename from data/release-notes/2-21/20.yml rename to data/release-notes/enterprise-server/2-21/20.yml diff --git a/data/release-notes/2-21/21.yml b/data/release-notes/enterprise-server/2-21/21.yml similarity index 100% rename from data/release-notes/2-21/21.yml rename to data/release-notes/enterprise-server/2-21/21.yml diff --git a/data/release-notes/2-22/10.yml b/data/release-notes/enterprise-server/2-22/10.yml similarity index 100% rename from data/release-notes/2-22/10.yml rename to data/release-notes/enterprise-server/2-22/10.yml diff --git a/data/release-notes/2-22/11.yml b/data/release-notes/enterprise-server/2-22/11.yml similarity index 100% rename from data/release-notes/2-22/11.yml rename to data/release-notes/enterprise-server/2-22/11.yml diff --git a/data/release-notes/2-22/12.yml b/data/release-notes/enterprise-server/2-22/12.yml similarity index 100% rename from data/release-notes/2-22/12.yml rename to data/release-notes/enterprise-server/2-22/12.yml diff --git a/data/release-notes/2-22/13.yml b/data/release-notes/enterprise-server/2-22/13.yml similarity index 100% rename from data/release-notes/2-22/13.yml rename to data/release-notes/enterprise-server/2-22/13.yml diff --git a/data/release-notes/2-22/8.yml b/data/release-notes/enterprise-server/2-22/8.yml similarity index 100% rename from data/release-notes/2-22/8.yml rename to data/release-notes/enterprise-server/2-22/8.yml diff --git a/data/release-notes/2-22/9.yml b/data/release-notes/enterprise-server/2-22/9.yml similarity index 100% rename from data/release-notes/2-22/9.yml rename to data/release-notes/enterprise-server/2-22/9.yml diff --git a/data/release-notes/3-0/2.yml b/data/release-notes/enterprise-server/3-0/2.yml similarity index 100% rename from data/release-notes/3-0/2.yml rename to data/release-notes/enterprise-server/3-0/2.yml diff --git a/data/release-notes/3-0/3.yml b/data/release-notes/enterprise-server/3-0/3.yml similarity index 100% rename from data/release-notes/3-0/3.yml rename to data/release-notes/enterprise-server/3-0/3.yml diff --git a/data/release-notes/3-0/4.yml b/data/release-notes/enterprise-server/3-0/4.yml similarity index 100% rename from data/release-notes/3-0/4.yml rename to data/release-notes/enterprise-server/3-0/4.yml diff --git a/data/release-notes/3-0/5.yml b/data/release-notes/enterprise-server/3-0/5.yml similarity index 100% rename from data/release-notes/3-0/5.yml rename to data/release-notes/enterprise-server/3-0/5.yml diff --git a/data/release-notes/3-0/6.yml b/data/release-notes/enterprise-server/3-0/6.yml similarity index 100% rename from data/release-notes/3-0/6.yml rename to data/release-notes/enterprise-server/3-0/6.yml diff --git a/data/release-notes/3-0/7.yml b/data/release-notes/enterprise-server/3-0/7.yml similarity index 100% rename from data/release-notes/3-0/7.yml rename to data/release-notes/enterprise-server/3-0/7.yml diff --git a/data/release-notes/3-1/0-rc1.yml b/data/release-notes/enterprise-server/3-1/0-rc1.yml similarity index 100% rename from data/release-notes/3-1/0-rc1.yml rename to data/release-notes/enterprise-server/3-1/0-rc1.yml diff --git a/middleware/contextualizers/release-notes.js b/middleware/contextualizers/release-notes.js index 351341aafa..724d780d79 100644 --- a/middleware/contextualizers/release-notes.js +++ b/middleware/contextualizers/release-notes.js @@ -18,7 +18,7 @@ module.exports = async (req, res, next) => { if (hasNumberedReleases) { const currentReleaseNotes = releaseNotesPerPlan[`${requestedRelease.replace(/\./g, '-')}`] - if (!currentReleaseNotes) { + if (!currentReleaseNotes && req.path.endsWith('/release-notes')) { // If the GHES version doesn't have any release notes, let's be helpful and redirect to `enterprise.github.com` return requestedPlan === 'enterprise-server' ? res.redirect(`https://enterprise.github.com/releases/${requestedRelease}.0/notes`) @@ -29,8 +29,11 @@ module.exports = async (req, res, next) => { req.context.releaseNotes = await Promise.all(patches.map(async patch => renderPatchNotes(patch, req.context))) req.context.releases = getAllReleases(supported, releaseNotesPerPlan, hasNumberedReleases) - req.context.releases.firstPreviousRelease = all[all.findIndex(v => v === version) + 1] - req.context.releases.secondPreviousRelease = all[all.findIndex(v => v === req.context.releases.firstPreviousRelease) + 1] + // Add firstPreviousRelease and secondPreviousRelease convenience props for use in includes/product-releases.html + req.context.releases.forEach(release => { + release.firstPreviousRelease = all[all.findIndex(v => v === release.version) + 1] + release.secondPreviousRelease = all[all.findIndex(v => v === release.firstPreviousRelease) + 1] + }) const releaseIndex = supported.findIndex(release => release === requestedRelease) req.context.nextRelease = supported[releaseIndex - 1]