Skip to content

Commit

Permalink
ci: Check for missing non-dev deps in plugins (#38337)
Browse files Browse the repository at this point in the history
Our build process by default ignores any files in `.gitignore`. If you
want to include such files, you have to set `production-include` in
`.gitattributes`.

For plugins, we want non-dev Composer deps to be included in the zip.
For the most part we do this by individually "production-including" the
appropriate dirs, mainly so we can keep an eye on if anything happens to
suddenly bring in an unexpected new dependency.

This adds a linting check to flag when a non-dev dependency isn't being
production-included, and fixes some missing entries.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/10010512509

Upstream-Ref: Automattic/jetpack@01f01f5
  • Loading branch information
anomiex authored and matticbot committed Jul 19, 2024
1 parent 3162c47 commit 6200170
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 12 deletions.
6 changes: 4 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ package.json export-ignore
# Remember to end all directories with `/**` to properly tag every file.
# /src/js/example.min.js production-include

/jetpack_vendor/** production-include
/vendor/** production-include
/jetpack_vendor/** production-include
/vendor/autoload.php production-include
/vendor/composer/** production-include
/vendor/automattic/jetpack-device-detection/** production-include

# Files to exclude from the mirror repo, but included in the monorepo.
# Remember to end all directories with `/**` to properly tag every file.
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.12.5-alpha] - unreleased

This is an alpha version! The changes listed here are not final.

## [1.12.4] - 2024-07-17
### Removed
- General: update WordPress version requirements to WordPress 6.5. [#38382]
Expand Down Expand Up @@ -764,6 +768,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

Misc fixes

[1.12.5-alpha]: https://github.com/Automattic/wp-super-cache/compare/v1.12.4...v1.12.5-alpha
[1.12.4]: https://github.com/Automattic/wp-super-cache/compare/v1.12.3...v1.12.4
[1.12.3]: https://github.com/Automattic/wp-super-cache/compare/v1.12.2...v1.12.3
[1.12.2]: https://github.com/Automattic/wp-super-cache/compare/v1.12.1...v1.12.2
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@
"wp-svn-autopublish": true
},
"config": {
"autoloader-suffix": "6fe342bc02f0b440f7b3c8d8ade42286_super_cacheⓥ1_12_4"
"autoloader-suffix": "6fe342bc02f0b440f7b3c8d8ade42286_super_cacheⓥ1_12_5_alpha"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@automattic/jetpack-super-cache",
"version": "1.12.4",
"version": "1.12.5-alpha",
"description": "A very fast caching engine for WordPress that produces static html files.",
"homepage": "https://jetpack.com",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInit6fe342bc02f0b440f7b3c8d8ade42286_super_cacheⓥ1_12_4::getLoader();
return ComposerAutoloaderInit6fe342bc02f0b440f7b3c8d8ade42286_super_cacheⓥ1_12_5_alpha::getLoader();
8 changes: 4 additions & 4 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInit6fe342bc02f0b440f7b3c8d8ade42286_super_cacheⓥ1_12_4
class ComposerAutoloaderInit6fe342bc02f0b440f7b3c8d8ade42286_super_cacheⓥ1_12_5_alpha
{
private static $loader;

Expand All @@ -24,12 +24,12 @@ public static function getLoader()

require __DIR__ . '/platform_check.php';

spl_autoload_register(array('ComposerAutoloaderInit6fe342bc02f0b440f7b3c8d8ade42286_super_cacheⓥ1_12_4', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit6fe342bc02f0b440f7b3c8d8ade42286_super_cacheⓥ1_12_5_alpha', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit6fe342bc02f0b440f7b3c8d8ade42286_super_cacheⓥ1_12_4', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit6fe342bc02f0b440f7b3c8d8ade42286_super_cacheⓥ1_12_5_alpha', 'loadClassLoader'));

require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit6fe342bc02f0b440f7b3c8d8ade42286_super_cacheⓥ1_12_4::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit6fe342bc02f0b440f7b3c8d8ade42286_super_cacheⓥ1_12_5_alpha::getInitializer($loader));

$loader->setClassMapAuthoritative(true);
$loader->register(true);
Expand Down
4 changes: 2 additions & 2 deletions vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Composer\Autoload;

class ComposerStaticInit6fe342bc02f0b440f7b3c8d8ade42286_super_cacheⓥ1_12_4
class ComposerStaticInit6fe342bc02f0b440f7b3c8d8ade42286_super_cacheⓥ1_12_5_alpha
{
public static $classMap = array (
'Automattic\\Jetpack\\Device_Detection' => __DIR__ . '/..' . '/automattic/jetpack-device-detection/src/class-device-detection.php',
Expand All @@ -15,7 +15,7 @@ class ComposerStaticInit6fe342bc02f0b440f7b3c8d8ade42286_super_cacheⓥ1_12_4
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->classMap = ComposerStaticInit6fe342bc02f0b440f7b3c8d8ade42286_super_cacheⓥ1_12_4::$classMap;
$loader->classMap = ComposerStaticInit6fe342bc02f0b440f7b3c8d8ade42286_super_cacheⓥ1_12_5_alpha::$classMap;

}, null, ClassLoader::class);
}
Expand Down
2 changes: 1 addition & 1 deletion wp-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: WP Super Cache
* Plugin URI: https://wordpress.org/plugins/wp-super-cache/
* Description: Very fast caching plugin for WordPress.
* Version: 1.12.4
* Version: 1.12.5-alpha
* Author: Automattic
* Author URI: https://automattic.com/
* License: GPL2+
Expand Down

0 comments on commit 6200170

Please sign in to comment.