Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Releases Archive: Link releases to microsites #345

Merged
merged 3 commits into from
Nov 12, 2023

Conversation

adamwoodnz
Copy link
Contributor

@adamwoodnz adamwoodnz commented Nov 8, 2023

See #344

Adds a link to the version number column to the relevant release microsite if it exists.

Screenshot 2023-11-08 at 2 21 09 PM

Release microsites only exist for 6.3 and 6.4 so far. We'll need to update this array each time a new one is built for a release.

How to test the changes in this Pull Request:

  1. Ensure you have this page locally and navigate to it http://localhost:8888/download/releases/
  2. The 6.3 and 6.4 releases should have links on the version number, taking you to the relevant local microsite
  3. Other release numbers should not be linked

NOTE: you may need to add local release data in a file at source/wp-content/mu-plugins/1-sandbox.php:

<?php
namespace WordPressdotorg\Releases;

/**
 * Mock the a release.
 */
function generate_release_array( $version, $timestamp = 0 ) {
	return [
		'version'   => $version,
		'builton'   => $timestamp,
		'zip_url'   => "https://wordpress.org/wordpress-{$version}.zip",
		'targz_url' => "https://wordpress.org/wordpress-{$version}.tar.gz",
		'iis_url'   => "https://wordpress.org/wordpress-{$version}-IIS.zip",
	];
}

/**
 * Mock the release breakdown.
 */
function get_breakdown() {
	return array(
		'betas' => [
			generate_release_array( '6.1-beta3', 1664913600 ),
			generate_release_array( '6.1-beta2', 1664308800 ),
			generate_release_array( '6.1-beta1', 1663790400 ),
			generate_release_array( '6.0.2-RC1', 1661284800 ),
			generate_release_array( '6.0.1-RC1', 1657051200 ),
			generate_release_array( '6.0-RC4', 1653076800 ),
		],
		'branches' => [
			'6.4' => [
				generate_release_array( '6.4', 1661889600 ),
			],
			'6.3' => [
				generate_release_array( '6.3.2', 1664308800 ),
				generate_release_array( '6.3.1', 1663790400 ),
				generate_release_array( '6.3', 1661889600 ),
			],
			'6.0' => [
				generate_release_array( '6.0.2', 1661889600 ),
				generate_release_array( '6.0.1', 1657656000 ),
				generate_release_array( '6.0', 1653422400 ),
			],
			'5.9' => [
				generate_release_array( '5.9.4', 1661889600 ),
				generate_release_array( '5.9.3', 1649188800 ),
				generate_release_array( '5.9.2', 1647032400 ),
				generate_release_array( '5.9.1', 1645563600 ),
				generate_release_array( '5.9', 1643144400 ),
			],
			'5.8' => [
				generate_release_array( '5.8.5', 1661889600 ),
				generate_release_array( '5.8.4', 1647032400 ),
				generate_release_array( '5.8.3', 1641502800 ),
				generate_release_array( '5.8.2', 1636578000 ),
				generate_release_array( '5.8.1', 1631217600 ),
				generate_release_array( '5.8', 1626811200 ),
			],
			'5.7' => [
				generate_release_array( '5.7.7', 1661889600 ),
				generate_release_array( '5.7.6', 1647032400 ),
				generate_release_array( '5.7.5', 1641502800 ),
				generate_release_array( '5.7.4', 1636578000 ),
				generate_release_array( '5.7.3', 1631217600 ),
				generate_release_array( '5.7.2', 1620849600 ),
				generate_release_array( '5.7.1', 1618516800 ),
				generate_release_array( '5.7', 1615323600 ),
			],
		],
		'latest' => generate_release_array( '6.4', 1661889600 ),
		'mu' => [
			[
				'version'   => 'mu-3.1',
				'builton'   => 1299877200,
				'zip_url'   => 'https://wordpress.org/wordpress-mu-3.1.zip',
				'targz_url' => false,
				'iis_url'   => false,
			],
		],
	);
}

@adamwoodnz adamwoodnz added [Component] Theme Templates, patterns, CSS [Component] Content Bugs or issues related to the page content labels Nov 8, 2023
@adamwoodnz adamwoodnz self-assigned this Nov 8, 2023
@adamwoodnz adamwoodnz changed the title Releases Archive: Link the version number column to the microsite if it exists Releases Archive: Link releases to microsites Nov 8, 2023
@adamwoodnz adamwoodnz merged commit 0ca1621 into trunk Nov 12, 2023
2 checks passed
@adamwoodnz adamwoodnz deleted the add/344-link-releases-to-microsites branch November 12, 2023 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Component] Content Bugs or issues related to the page content [Component] Theme Templates, patterns, CSS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants