Skip to content

Commit

Permalink
repo-gardening: Remove guessing of release dates
Browse files Browse the repository at this point in the history
We added this guessing back when Jetpack was the only plugin, and we
still did a week-long testing week. That just got carried forward as we
added additional plugins and so on.

For Jetpack we should be safe relying on the milestone, it's on the
release checklist to create the new milestone. For most of the other
plugins, if there's no milestone then we may as well just say there's no
scheduled release. The exceptions to that are wpcomsh and
mu-wpcom-plugin, which get custom messaging if no milestone exists.
  • Loading branch information
anomiex committed Jul 22, 2024
1 parent a6a641f commit e56b591
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: removed

Check description task: Remove general guessing of release dates and code freezes. Add special casing for wpcomsh and mu-wpcom-plugin.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ async function hasProgressLabel( octokit, owner, repo, number ) {
* @returns {Promise<string>} Promise resolving to info about the release (code freeze, release date).
*/
async function getMilestoneDates( plugin, nextMilestone ) {
let releaseDate;
let releaseDate = 'none scheduled';
let codeFreezeDate;
if ( nextMilestone && nextMilestone.hasOwnProperty( 'due_on' ) && nextMilestone.due_on ) {
releaseDate = moment( nextMilestone.due_on ).format( 'LL' );
Expand All @@ -77,19 +77,11 @@ async function getMilestoneDates( plugin, nextMilestone ) {
// If we have a date and it is valid, use it, otherwise set code freeze to a week before the release.
if ( freezeDateDescription && moment( freezeDateDescription[ 1 ] ).isValid() ) {
codeFreezeDate = moment( freezeDateDescription[ 1 ] ).format( 'LL' );
} else {
codeFreezeDate = moment( nextMilestone.due_on ).subtract( 7, 'd' ).format( 'LL' );
}
} else {
// Fallback to raw math calculation
// Calculate next release date
const firstTuesdayOfMonth = moment().add( 1, 'months' ).startOf( 'month' );
while ( firstTuesdayOfMonth.day() !== 2 ) {
firstTuesdayOfMonth.add( 1, 'day' );
}
releaseDate = firstTuesdayOfMonth.format( 'LL' );
// Calculate next code freeze date
codeFreezeDate = firstTuesdayOfMonth.subtract( 8, 'd' ).format( 'LL' );
} else if ( plugin === 'wpcomsh' ) {
releaseDate = 'on demand (usually Mondays if not sooner)';
} else if ( plugin === 'mu-wpcom-plugin' ) {
releaseDate = 'WordPress.com Simple releases happen daily';
}

const capitalizedName = plugin
Expand All @@ -113,8 +105,7 @@ ${
- Releases to self-hosted sites happen monthly. The next release is scheduled for _${ releaseDate }_ (scheduled code freeze on _${ codeFreezeDate }_).`
: `
- Next scheduled release: _${ releaseDate }_.
- Scheduled code freeze: _${ codeFreezeDate }_.
`
${ codeFreezeDate ? `- Scheduled code freeze: _${ codeFreezeDate }_.\n` : '' }`
}
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.
Expand Down

0 comments on commit e56b591

Please sign in to comment.