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

Release version 1.0.4 #86

Merged
merged 30 commits into from
Nov 16, 2022
Merged

Release version 1.0.4 #86

merged 30 commits into from
Nov 16, 2022

Conversation

jrfnl
Copy link
Collaborator

@jrfnl jrfnl commented Nov 16, 2022

Functional:

  • Confirm that the most recent PHPUnit changelogs have been checked and that the library is still feature complete for those versions supported within the PHPUnit version constraints.
  • Update the VERSION constant in the phpunitpolyfills-autoload.php file. - PR Changelog for release 1.0.4 #85
  • Composer: check if any dependencies/version constraints need updating.

Release:

  • Add changelog for the release - PR Changelog for release 1.0.4 #85
    Verify that a release link at the bottom of the CHANGELOG.md file has been added.
  • Merge this PR.
  • Make sure all CI builds are green.
  • Tag the release (careful, GH defaults to develop!).
  • Create a release from the tag (careful, GH defaults to develop!) & copy & paste the changelog to it.
    Make sure to copy the links to the issues and the links to the GH usernames from the bottom of the changelog!
  • Close the milestone.
  • Open a new milestone for the next release.
  • If any open PRs/issues which were milestoned for the release did not make it into the release, update their milestone.

Announce:

  • Tweet about the release.

jrfnl and others added 30 commits December 23, 2021 06:49
Dynamic (non-explicitly declared) property usage is expected to be deprecated as of PHP 8.2 and will become a fatal error in PHP 9.0.

There are a number of ways to mitigate this:
* If it's an accidental typo for a declared property: fix the typo.
* For known properties: declare them on the class.
* For unknown properties: add the magic `__get()`, `__set()` et al methods to the class or let the class extend `stdClass` which has highly optimized versions of these magic methods build in.
* For unknown _use of_ dynamic properties, the `#[AllowDynamicProperties]` attribute can be added to the class. The attribute will automatically be inherited by child classes.

In this case, the test is intentionally setting a dynamic property, so using the attribute is the best way to safeguard the handling of this functionality.

Refs:
* https://wiki.php.net/rfc/deprecate_dynamic_properties
…on-test-case

PHP 8.2: allow dynamic property on test fixture
The `dealerdirect/phpcodesniffer-composer-installer` Composer plugin is used to register external PHPCS standards with PHPCS.

As of Composer 2.2.0, Composer plugins need to be explicitly allowed to run. This adds the necessary configuration for that.

Refs:
* https://blog.packagist.com/composer-2-2/#more-secure-plugin-execution
The action used to install Composer packages and handle the caching has released a new major (and some follow-up patch releases), which means, the action reference needs to be updated to benefit from it.

Includes adding `--no-interaction` to "plain" Composer commands to potentially prevent CI hanging if, for whatever reason, interaction would be needed in the future.

Refs:
* https://github.com/ramsey/composer-install/releases/tag/2.0.0
* https://github.com/ramsey/composer-install/releases/tag/2.0.1
* https://github.com/ramsey/composer-install/releases/tag/2.0.2
…ction

GH Actions: version update for `ramsey/composer-install`
* Update the YoastCS dependency.
    Ref: https://github.com/Yoast/yoastcs/releases/tag/2.2.1
* Adjust the PHP linting scripts to include deprecations (in as far as those are available during linting).
A number of predefined actions have had major release, which warrant an update the workflow(s).

These updates don't actually contain any changed functionality, they are mostly just a change of the Node version used by the action itself (from Node 14 to Node 16).

Refs:
* https://github.com/actions/checkout/releases
…tions

GH Actions: version update for various predefined actions
The minimum PHP requirement for PHPUnit 10 has been changed to PHP 8.1.

Ref: sebastianbergmann/phpunit@95b6158
…test-run

GH Actions/test: PHPUnit 10 needs PHP 8.1
The `TestResult::errorCount()` and `TestResult::failureCount()` methods have been removed in PHPUnit 10.x.

Ref: sebastianbergmann/phpunit@152b952
…hanged-testresult-class

ExpectExceptionTest: make tests compatible with PHPUnit 10.x
Apparently the `stable` build for the docs has been renamed to `main` for the PHPUnit docs website, which broke all the links.

Fixed now.
This automatically enabled Dependabot to:
* Submit pull requests for security updates and version updates for Composer dependencies.
* Submit pull requests for security updates and version updates for GH Action runner dependencies.

For Composer dependencies, a preference is given to _widen_ the version restrictions instead of updating them to a new minimum.
This is a deliberate choice as this package is a library, not an application.

The configuration has been set up to:
* Run once a week.
* Submit a maximum of 5 pull requests at a time.
    If additional pull requests are needed, these will subsequently be submitted the next time Dependabot runs after one or more of the open pull requests have been merged.
* The commit messages for PRs submitted by Dependabot will be prefixed according the unofficial conventions used in this repo up to now.
* The PRs will automatically be labelled with an appropriate label as already in use in this repo.
If there is a ruleset error, the `cs2pr` action doesn't receive an `xml` report and exits with a `0` error code, even though the PHPCS run failed (though not on CS errors, but on a ruleset error).

This changes the GH Actions workflow to allow for that situation and still fail the build in that case.
Includes:
* Removing the `composer install` toggle for PHP 8.2.
* Adding a build against PHP 8.2 for PHPUnit 10.0.0.
Caches used in GH Actions do not get updated, they can only be replaced by a different cache with a different cache key.

Now the predefined Composer install action we are using already creates a pretty comprehensive cache key:

> `ramsey/composer-install` will auto-generate a cache key which is composed of
the following elements:
> * The OS image name, like `ubuntu-latest`.
> * The exact PHP version, like `8.1.11`.
> * The options passed via `composer-options`.
> * The dependency version setting as per `dependency-versions`.
> * The working directory as per `working-directory`.
> * A hash of the `composer.json` and/or `composer.lock` files.

This means that aside from other factors, the cache will always be busted when changes are made to the (committed) `composer.json` or the `composer.lock` file (if the latter exists in the repo).

For packages running on recent versions of PHP, it also means that the cache will automatically be busted once a month when a new PHP version comes out.

### The problem

For runs on older PHP versions which don't receive updates anymore, the cache will not be busted via new PHP version releases, so effectively, the cache will only be busted when a change is made to the `composer.json`/`composer.lock` file - which may not happen that frequently on low-traffic repos.

But... packages _in use_ on those older PHP versions - especially dependencies of declared dependencies - may still release new versions and those new versions will not exist in the cache and will need to be downloaded each time the action is run and over time the cache gets less and less relevant as more and more packages will need to be downloaded for each run.

### The solution

To combat this issue, a new `custom-cache-suffix` option has been added to the Composer install action in version 2.2.0.
This new option allows for providing some extra information to add to the cache key, which allows for busting the cache based on your own additional criteria.

This commit implements the use of this `custom-cache-suffix` option for all relevant workflows in this repo.

Refs:
* https://github.com/ramsey/composer-install/#custom-cache-suffix
* https://github.com/ramsey/composer-install/releases/tag/2.2.0
* composer-install 234
* composer-install 239
GH Actions: bust the cache semi-regularly
Includes updating the `VERSION` constant in the `Autoload` class.

Includes minor tweaks to the README to clear up some confusion.
@jrfnl jrfnl added this to the 1.0.4 milestone Nov 16, 2022
@jrfnl jrfnl merged commit 3c621ff into main Nov 16, 2022
@jrfnl
Copy link
Collaborator Author

jrfnl commented Nov 16, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant