Skip to content

Commit 4fba546

Browse files
committed
Introduce QA/Release Candidate Builds on main website
1 parent 9550e11 commit 4fba546

File tree

3 files changed

+258
-4
lines changed

3 files changed

+258
-4
lines changed

downloads.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@
1818
</div>
1919
</div>
2020
21-
<p class="panel"><a href="download-docs.php">Documentation download</a></p>
22-
<p class="panel"><a href="download-logos.php">PHP logos</a></p>
21+
<p class="panel"><a href="download-docs.php">Documentation Download</a></p>
22+
<p class="panel"><a href="download-logos.php">PHP Logos</a></p>
2323
24-
<p class="panel"><a href="/git.php">Development sources (git)</a></p>
25-
<p class="panel"><a href="/releases/">Old archives</a></p>
24+
<p class="panel"><a href="/release-candidates.php">Release Candidates</a></p>
25+
<p class="panel"><a href="/git.php">Development Sources (git)</a></p>
26+
<p class="panel"><a href="/releases/">Old Archives</a></p>
2627
';
2728

2829
site_header("Downloads",

include/release-qa.php

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
<?php
2+
3+
/*
4+
What this file does:
5+
- Generates the download links found at qa.php.net
6+
- Determines which test results are emailed to news.php.net/php.qa.reports
7+
- Defines $QA_RELEASES for internal and external (api.php) use, contains all qa related information for future PHP releases
8+
9+
Documentation:
10+
$QA_RELEASES documentation:
11+
Configuration:
12+
- Key is future PHP version number
13+
- Example: If 5.3.6 is the latest stable release, then use 5.3.7 because 5.3.7-dev is our qa version
14+
- Typically, this is the only part needing changed
15+
- active (bool):
16+
- It's active and being tested here
17+
- Meaning, the version will be reported to the qa.reports list, and be linked at qa.php.net
18+
- File extensions .tar.gz and .tar.bz2 are assumed to be available
19+
- release (array):
20+
- type: RC, alpha, and beta are examples (case should match filename case)
21+
- version: 0 if no such release exists, otherwise an integer of the rc/alpha/beta number
22+
- sha256_bz2: sha256 checksum of this downloadable .tar.bz2 file
23+
- sha256_gz: sha256 checksum of this downloadable .tar.gz file
24+
- sha256_xz: sha256 checksum of this downloadble .xz file
25+
- date: date of release e.g., 21 May 2011
26+
- baseurl: base url of where these downloads are located
27+
- Multiple checksums can be available, see the $QA_CHECKSUM_TYPES array below
28+
Other variables within $QA_RELEASES are later defined including:
29+
- reported: versions that make it to the qa.reports mailing list
30+
- release: all current qa releases, including paths to dl urls (w/ sha256 info)
31+
- dev_version: dev version
32+
- $QA_RELEASES is made available at qa.php.net/api.php
33+
34+
TODO:
35+
- Save all reports (on qa server) for all tests, categorize by PHP version (see buildtest-process.php)
36+
- Consider storing rc downloads at one location, independent of release master
37+
- Determine best way to handle rc baseurl, currently assumes .tar.gz/tar.bz2 will exist
38+
- Determine if $QA_RELEASES is compatible with all current, and most future configurations
39+
- Determine if $QA_RELEASES can be simplified
40+
- Determine if alpha/beta options are desired
41+
- Unify then create defaults for most settings
42+
- Add option to allow current releases (e.g., retrieve current release info via daily cron, cache, check, configure ~ALLOW_CURRENT_RELEASES)
43+
*/
44+
45+
46+
$QA_RELEASES = [
47+
48+
'8.1.27' => [
49+
'active' => true,
50+
'release' => [
51+
'type' => 'RC',
52+
'number' => 0,
53+
'sha256_gz' => '',
54+
'sha256_bz2' => '',
55+
'sha256_xz' => '',
56+
'date' => '07 Nov 2023',
57+
'baseurl' => 'https://downloads.php.net/',
58+
],
59+
],
60+
61+
'8.2.27' => [
62+
'active' => true,
63+
'release' => [
64+
'type' => 'RC',
65+
'number' => 0,
66+
'sha256_bz2' => '',
67+
'sha256_gz' => '',
68+
'sha256_xz' => '',
69+
'date' => '05 Dec 2024',
70+
'baseurl' => 'https://downloads.php.net/',
71+
],
72+
],
73+
74+
'8.3.20' => [
75+
'active' => true,
76+
'release' => [
77+
'type' => 'RC',
78+
'number' => 0,
79+
'sha256_bz2' => '',
80+
'sha256_gz' => '',
81+
'sha256_xz' => '',
82+
'date' => '27 Mar 2025',
83+
'baseurl' => 'https://downloads.php.net/',
84+
],
85+
],
86+
87+
'8.4.7' => [
88+
'active' => true,
89+
'release' => [
90+
'type' => 'RC',
91+
'number' => 1,
92+
'sha256_bz2' => 'acddb1da1b128f984df01347c907a64939f316d7d9bd138b49106f4179b7776f',
93+
'sha256_gz' => 'b12d97767aeda4624ea1904c1d93303efe4ffe1ba91970a3c5774ad556918e93',
94+
'sha256_xz' => '6cb37632eb65ee311cb4427ad070b6ab27fdaf13e8f0103701b2b78907326c93',
95+
'date' => '24 Apr 2025',
96+
'baseurl' => 'https://downloads.php.net/~saki',
97+
],
98+
],
99+
];
100+
101+
/*** End Configuration *******************************************************************/
102+
103+
// This is a list of the possible checksum values that can be supplied with a QA release. Any
104+
// new algorithm is read from the $QA_RELEASES array under the 'release' index for each version
105+
// in the form of "$algorithm_$filetype".
106+
//
107+
// For example, if SHA512 were to be supported, the following indices would have to be added:
108+
//
109+
// 'sha512_bz2' => 'xxx',
110+
// 'sha512_gz' => 'xxx',
111+
// 'sha512_xz' => 'xxx',
112+
$QA_CHECKSUM_TYPES = ['sha256'];
113+
114+
// $QA_RELEASES eventually contains just about everything, also for external use
115+
// release : These are encouraged for use (e.g., linked at qa.php.net)
116+
// reported : These are allowed to report @ the php.qa.reports mailing list
117+
118+
(function(&$QA_RELEASES) use ($QA_CHECKSUM_TYPES) {
119+
foreach ($QA_RELEASES as $pversion => $info) {
120+
121+
if (isset($info['active']) && $info['active']) {
122+
123+
// Allow -dev versions of all active types
124+
// Example: 5.3.6-dev
125+
$QA_RELEASES['reported'][] = "{$pversion}-dev";
126+
$QA_RELEASES[$pversion]['dev_version'] = "{$pversion}-dev";
127+
128+
// Allow -dev version of upcoming qa releases (rc/alpha/beta)
129+
// @todo confirm this php version format for all dev versions
130+
if ((int)$info['release']['number'] > 0) {
131+
$QA_RELEASES['reported'][] = "{$pversion}{$info['release']['type']}{$info['release']['number']}";
132+
if (!empty($info['release']['baseurl'])) {
133+
134+
// php.net filename format for qa releases
135+
// example: php-5.3.0RC2
136+
$fn_base = 'php-' . $pversion . $info['release']['type'] . $info['release']['number'];
137+
138+
$QA_RELEASES[$pversion]['release']['version'] = $pversion . $info['release']['type'] . $info['release']['number'];
139+
foreach ([ 'bz2', 'gz', 'xz' ] as $file_type) {
140+
foreach ($QA_CHECKSUM_TYPES as $algo) {
141+
if (isset($info['release'][$algo . '_' . $file_type])) {
142+
$QA_RELEASES[$pversion]['release']['files'][$file_type][$algo] = $info['release'][$algo . '_' . $file_type];
143+
}
144+
}
145+
if (!empty($QA_RELEASES[$pversion]['release']['files'][$file_type])) {
146+
$QA_RELEASES[$pversion]['release']['files'][$file_type]['path']= $info['release']['baseurl'] . $fn_base . '.tar.' . $file_type;
147+
}
148+
}
149+
150+
if (empty($QA_RELEASES[$pversion]['release']['files'])) {
151+
$QA_RELEASES[$pversion]['release']['enabled'] = false;
152+
}
153+
}
154+
} else {
155+
$QA_RELEASES[$pversion]['release']['enabled'] = false;
156+
}
157+
158+
}
159+
}
160+
161+
// Sorted information for later use
162+
// @todo need these?
163+
// $QA_RELEASES['releases'] : All current versions with active qa releases
164+
foreach ($QA_RELEASES as $pversion => $info) {
165+
if (isset($info['active']) && $info['active'] && !empty($info['release']['number'])) {
166+
$QA_RELEASES['releases'][$pversion] = $info['release'];
167+
}
168+
}
169+
170+
})($QA_RELEASES);

release-candidates.php

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
<?php
2+
$_SERVER['BASE_PAGE'] = 'qa.php';
3+
include_once __DIR__ . '/include/prepend.inc';
4+
include_once __DIR__ . '/include/release-qa.php';
5+
6+
$SITE_UPDATE = date("D M d H:i:s Y T", filectime(__FILE__));
7+
8+
site_header("Release Candidates", [
9+
'current' => 'downloads',
10+
]);
11+
12+
?>
13+
<h1>Release Candidate Builds</h1>
14+
<p>
15+
This page contains links to the Release Candidate builds that the release
16+
managers create before each actual release. These builds are meant for the
17+
community to test whether no inadvertent changes have been made, and
18+
whether no regressions have been introduced.
19+
</p>
20+
21+
<h3>Available QA Releases:</h3>
22+
<?php show_release_qa($QA_RELEASES); ?>
23+
<p>
24+
<br>
25+
<strong>Windows users:</strong>
26+
See <a href="https://windows.php.net/qa/">here</a> for the Windows QA builds.
27+
</p>
28+
<?php
29+
30+
site_footer();
31+
32+
function show_release_qa($QA_RELEASES) {
33+
// The checksum configuration array
34+
global $QA_CHECKSUM_TYPES;
35+
36+
echo "<!-- RELEASE QA -->\n";
37+
38+
if (!empty($QA_RELEASES['releases'])) {
39+
40+
$plural = count($QA_RELEASES['releases']) > 1 ? 's' : '';
41+
42+
// QA Releases
43+
echo "<span class='lihack'>\n";
44+
echo "Providing QA for the following <a href='/rc.php'>test release{$plural}</a>:<br> <br>\n";
45+
echo "</span>\n";
46+
echo "<table>\n";
47+
48+
foreach ($QA_RELEASES['releases'] as $pversion => $info) {
49+
50+
echo "<tr>\n";
51+
echo "<td colspan=\"" . (sizeof($QA_CHECKSUM_TYPES) + 1) . "\">\n";
52+
echo "<h3 style=\"margin: 0px;\">{$info['version']}</h3>\n";
53+
echo "</td>\n";
54+
echo "</tr>\n";
55+
56+
foreach ($info['files'] as $file_type => $file_info) {
57+
echo "<tr>\n";
58+
echo "<td width=\"20%\"><a href=\"{$file_info['path']}\">php-{$info['version']}.tar.{$file_type}</a></td>\n";
59+
60+
foreach ($QA_CHECKSUM_TYPES as $algo) {
61+
echo '<td>';
62+
echo '<strong>' . strtoupper($algo) . ':</strong> ';
63+
64+
if (isset($file_info[$algo]) && strlen($file_info[$algo])) {
65+
echo $file_info[$algo];
66+
} else {
67+
echo '(<em><small>No checksum value available</small></em>)&nbsp;';
68+
}
69+
70+
echo "</td>\n";
71+
}
72+
73+
echo "</tr>\n";
74+
}
75+
}
76+
77+
echo "</table>\n";
78+
} else {
79+
echo "<span class='lihack'>There are no QA releases available at the moment to test.</span>";
80+
}
81+
82+
echo "<!-- END -->\n";
83+
}

0 commit comments

Comments
 (0)