Skip to content

Commit

Permalink
Merge pull request #8377 from codeigniter4/develop
Browse files Browse the repository at this point in the history
4.4.4 Ready code
  • Loading branch information
kenjis authored Dec 28, 2023
2 parents 4b71437 + 14c8609 commit eb252d2
Show file tree
Hide file tree
Showing 427 changed files with 4,492 additions and 2,498 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/deploy-distributables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
run: ./source/.github/scripts/deploy-framework ${GITHUB_WORKSPACE}/source ${GITHUB_WORKSPACE}/framework ${GITHUB_REF##*/}

- name: Release
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
github-token: ${{secrets.ACCESS_TOKEN}}
script: |
Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
run: ./source/.github/scripts/deploy-appstarter ${GITHUB_WORKSPACE}/source ${GITHUB_WORKSPACE}/appstarter ${GITHUB_REF##*/}

- name: Release
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
github-token: ${{secrets.ACCESS_TOKEN}}
script: |
Expand Down Expand Up @@ -172,7 +172,7 @@ jobs:
run: ./source/.github/scripts/deploy-userguide ${GITHUB_WORKSPACE}/source ${GITHUB_WORKSPACE}/userguide ${GITHUB_REF##*/}

- name: Release
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
github-token: ${{secrets.ACCESS_TOKEN}}
script: |
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/test-autoreview.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Automatic Code Review
name: AutoReview

on:
pull_request:
Expand All @@ -23,9 +23,10 @@ permissions:

jobs:
auto-review-tests:
name: Automatic Code Review
uses: ./.github/workflows/reusable-serviceless-phpunit-test.yml # @TODO Extract to codeigniter4/.github repo
with:
job-name: Automatic Code Review [PHP 8.1]
job-name: PHP 8.1
php-version: '8.1'
job-id: auto-review-tests
group-name: AutoReview
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-phpcpd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,5 @@ jobs:
--exclude system/Database/Postgre/Builder.php
--exclude system/Debug/Exceptions.php
--exclude system/HTTP/SiteURI.php
--exclude system/Validation/Rules.php
-- app/ public/ system/
12 changes: 8 additions & 4 deletions .github/workflows/test-phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
echo "version=8.1" >> $GITHUB_OUTPUT
sanity-tests:
name: Others
needs: coverage-php-version

strategy:
Expand Down Expand Up @@ -77,6 +78,7 @@ jobs:
extra-composer-options: ${{ matrix.composer-option }}

database-live-tests:
name: DatabaseLive
needs:
- coverage-php-version
- sanity-tests
Expand All @@ -97,17 +99,17 @@ jobs:
- SQLSRV
- SQLite3
mysql-version:
- '5.7'
- '8.0'
include:
- php-version: '7.4'
db-platform: MySQLi
mysql-version: '8.0'
mysql-version: '5.7'
- php-version: '8.3'
composer-option: '--ignore-platform-req=php'

uses: ./.github/workflows/reusable-phpunit-test.yml # @TODO Extract to codeigniter4/.github repo
with:
job-name: Database Live Tests
job-name: ''
php-version: ${{ matrix.php-version }}
job-id: database-live-tests
db-platform: ${{ matrix.db-platform }}
Expand All @@ -120,6 +122,7 @@ jobs:
extra-composer-options: ${{ matrix.composer-option }}

separate-process-tests:
name: SeparateProcess
needs:
- coverage-php-version
- sanity-tests
Expand All @@ -138,7 +141,7 @@ jobs:

uses: ./.github/workflows/reusable-phpunit-test.yml # @TODO Extract to codeigniter4/.github repo
with:
job-name: Separate Process Tests
job-name: ''
php-version: ${{ matrix.php-version }}
job-id: separate-process-tests
group-name: SeparateProcess
Expand All @@ -149,6 +152,7 @@ jobs:
extra-composer-options: ${{ matrix.composer-option }}

cache-live-tests:
name: CacheLive
needs:
- coverage-php-version
- sanity-tests
Expand Down
56 changes: 54 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,59 @@
# Changelog

## [v4.4.4](https://github.com/codeigniter4/CodeIgniter4/tree/v4.4.4) (2023-12-28)
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.4.3...v4.4.4)

### Breaking Changes

* fix: Validation rule with `*` gets incorrect values as dot array syntax by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8129
* fix: validation rule `matches` and `differs` by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8122
* fix: [CURLRequest] skip hostname checks if options 'verify' false by @NicolaeIotu in https://github.com/codeigniter4/CodeIgniter4/pull/8258
* fix: get_filenames() does not follow symlinks by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8298

### Fixed Bugs

* fix: change make:command default $group to `App` by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8109
* fix: typo in help message in `spark filter:check` by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8118
* fix: Hot reloading when session is enabled by @michalsn in https://github.com/codeigniter4/CodeIgniter4/pull/8112
* fix: make:cell help message by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8133
* fix: [DebugBar] dark mode timeline "Controller" by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8125
* fix: PHPDoc types in controller.tpl.php by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8144
* fix: `@return` in filter.tpl.php by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8145
* fix: when request body is `0`, $body will be null by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8161
* fix: `spark routes` outputs `<unknown>` only when {locale} with `useSupportedLocalesOnly(true)` by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8167
* fix: Undefined array key error in `spark db:table` by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8173
* fix: force_https() redirects to wrong URL when baseURL has subfolder by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8191
* fix: Validation raises TypeError when invalid JSON comes by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8153
* fix: FilterTestTrait Undefined variable $filterClasses by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8195
* fix: Image::save() causes error with webp by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8210
* fix issue where running FileLocator::getClassname() on a directory would cause a PHP error by @colethorsen in https://github.com/codeigniter4/CodeIgniter4/pull/8216
* fix: make Request::getEnv() deprecated by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8234
* fix: ExceptionHandler displays incorrect Exception classname by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8239
* fix: [Cache] Double prefix for increment in FileHandler by @il-coder in https://github.com/codeigniter4/CodeIgniter4/pull/8255
* docs: fix Database Utility Class `getXMLFromResult()` by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8276
* fix: autoload helpers in test bootstrap by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8275
* fix: Model handling of Entity $primaryKey casting by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8282
* fix: Handle non-array JSON in validation by @woodongwong in https://github.com/codeigniter4/CodeIgniter4/pull/8288
* fix: DEPRECATED error in Honeypot by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8316
* fix: [Auto Routing Improved] `spark routes` shows incorrect routes when translateURIDashes is enabled by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8320
* fix: migrations not using custom DB connection of migration runner by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/8221
* Always return a new instance of a Cell by @michalsn in https://github.com/codeigniter4/CodeIgniter4/pull/8330
* fix: DOMParser cannot see element with `id="0"` by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8360

### Refactoring

* [Rector] Apply SingleInArrayToCompareRector by @samsonasik in https://github.com/codeigniter4/CodeIgniter4/pull/8102
* refactor: RedisHandler ttl() calls by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8155
* [Testing] Use assertEqualsWithDelta() when possible by @samsonasik in https://github.com/codeigniter4/CodeIgniter4/pull/8158
* refactor: replace non-boolean if conditions in Model by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8193
* refactor: View classes to fix PHPStan errors by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8208
* refactor: Model by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8260
* replace -1 with E_ALL in error_reporting calls by @ThomasMeschke in https://github.com/codeigniter4/CodeIgniter4/pull/8212
* refactor: apply SimplifyEmptyCheckOnEmptyArrayRector by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8341
* refactor: apply DisallowedEmptyRuleFixerRector by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8344
* refactor: rely on $config property in ViewDecoratorTrait by @mostafakhudair in https://github.com/codeigniter4/CodeIgniter4/pull/8021
* refactor: replace empty() Part 1 by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8345

## [v4.4.3](https://github.com/codeigniter4/CodeIgniter4/tree/v4.4.3) (2023-10-26)
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.4.2...v4.4.3)

Expand Down Expand Up @@ -59,8 +113,6 @@
* refactor: delete duplicate code for Composer loading by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8004
* [Rector] Apply BooleanInIfConditionRuleFixerRector by @samsonasik in https://github.com/codeigniter4/CodeIgniter4/pull/7951

**Full Changelog**: https://github.com/codeigniter4/CodeIgniter4/compare/v4.4.1...v4.4.2

## [v4.4.1](https://github.com/codeigniter4/CodeIgniter4/tree/v4.4.1) (2023-09-05)
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.4.0...v4.4.1)

Expand Down
42 changes: 28 additions & 14 deletions admin/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

> Documentation guide based on the releases of `4.0.5` and `4.1.0` on January 31, 2021.
>
> Updated for `4.3.0` on January 10, 2023.
> Updated for `4.4.3` on October 27, 2023.
>
> -MGatner, kenjis
Expand Down Expand Up @@ -53,12 +53,18 @@ Work off direct clones of the repos so the release branches persist for a time.
* [ ] Clone both **codeigniter4/CodeIgniter4** and **codeigniter4/userguide** and
resolve any necessary PRs
```console
rm -rf CodeIgniter4.bk userguide.bk
mv CodeIgniter4 CodeIgniter4.bk
mv userguide userguide.bk
git clone [email protected]:codeigniter4/CodeIgniter4.git
git clone [email protected]:codeigniter4/userguide.git
```
* [ ] Vet the **admin/** folders for any removed hidden files (Action deploy scripts
*do not remove these*)
* git diff --name-status origin/master admin/
```console
cd CodeIgniter4
git diff --name-status origin/master admin/
```
* [ ] Merge any Security Advisory PRs in private forks

## Process
Expand All @@ -67,21 +73,26 @@ Work off direct clones of the repos so the release branches persist for a time.
> been included with their PR, so this process assumes you will not be
> generating much new content.

* [ ] Create a new branch `release-4.x.x`
* [ ] Update **system/CodeIgniter.php** with the new version number:
`const CI_VERSION = '4.x.x';`
* [ ] Update **user_guide_src/source/conf.py** with the new `version = '4.x'` (if applicable)
and `release = '4.x.x'`
* [ ] Replace **CHANGELOG.md** with the new version generated above
* [ ] Update **user_guide_src/source/changelogs/{version}.rst**
* Set the date to format `Release Date: January 31, 2021`
* Remove the section titles that have no items
* [ ] Update **user_guide_src/source/installation/upgrade_{ver}.rst**
* fill in the "All Changes" section, and add it to **upgrading.rst**
* git diff --name-status origin/master -- . ':!system'
* Remove the section titles that have no items
* [Minor version only] Update the "from" version in the title. E.g., `from 4.3.x` → `from 4.3.8`
* [ ] Commit the changes with `Prep for 4.x.x release` and push to origin
* [ ] Run `php admin/prepare-release.php 4.x.x` and push to origin
* The above command does the following:
* Create a new branch `release-4.x.x`
* Update **system/CodeIgniter.php** with the new version number:
`const CI_VERSION = '4.x.x';`
* Update **user_guide_src/source/conf.py** with the new `version = '4.x'` (if applicable)
and `release = '4.x.x'`
* Update **user_guide_src/source/changelogs/{version}.rst**
* Set the date to format `Release Date: January 31, 2021`
* Update **phpdoc.dist.xml** with the new `<title>CodeIgniter v4.x API</title>`
and `<version number="4.x.x">`
* Commit the changes with `Prep for 4.x.x release`
* [ ] Create a new PR from `release-4.x.x` to `develop`:
* Title: `Prep for 4.x.x release`
* Description:
Expand Down Expand Up @@ -119,6 +130,7 @@ Work off direct clones of the repos so the release branches persist for a time.
* [ ] Run the following commands to install and test `appstarter` and verify the new
version:
```console
rm -rf release-test
composer create-project codeigniter4/appstarter release-test
cd release-test
composer test && composer info codeigniter4/framework
Expand Down Expand Up @@ -152,19 +164,21 @@ Work off direct clones of the repos so the release branches persist for a time.
git switch -c 4.x
git push origin HEAD
```
* [ ] Publish any Security Advisories that were resolved from private forks
* [ ] Request CVEs and Publish any Security Advisories that were resolved from private forks
(note: publishing is restricted to administrators):
* [ ] Announce the release on the forums and Slack channel
(note: this forum is restricted to administrators):
* Make a new topic in the "News & Discussion" forums:
https://forum.codeigniter.com/forum-2.html
* The content is somewhat organic, but should include any major features and
changes as well as a link to the User Guide's changelog
* [ ] Run `php admin/create-new-changelog.php <current_version> <new_version>`
* The above command does the following:
* Create **user_guide_src/source/changelogs/{next_version}.rst** and add it to
**index.rst** (See **next-changelog-*.rst**)
* Create **user_guide_src/source/installation/upgrade_{next_version}.rst** and add it to
**upgrading.rst** (See **next-upgrading-guide.rst**)
* [ ] Create a PR for new changelog and upgrade for the next version
* Create **user_guide_src/source/changelogs/{next_version}.rst** and add it to
**index.rst** (See **next-changelog-*.rst**)
* Create **user_guide_src/source/installation/upgrade_{next_version}.rst** and add it to
**upgrading.rst** (See **next-upgrading-guide.rst**)

## Appendix

Expand Down
87 changes: 87 additions & 0 deletions admin/create-new-changelog.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?php

declare(strict_types=1);

function replace_file_content(string $path, string $pattern, string $replace): void
{
$file = file_get_contents($path);
$output = preg_replace($pattern, $replace, $file);
file_put_contents($path, $output);
}

// Main.
chdir(__DIR__ . '/..');

if ($argc !== 3) {
echo "Usage: php {$argv[0]} <current_version> <new_version>" . PHP_EOL;
echo "E.g.,: php {$argv[0]} 4.4.3 4.4.4" . PHP_EOL;

exit(1);
}

// Gets version number from argument.
$versionCurrent = $argv[1]; // e.g., '4.4.3'
$versionCurrentParts = explode('.', $versionCurrent);
$minorCurrent = $versionCurrentParts[0] . '.' . $versionCurrentParts[1];
$version = $argv[2]; // e.g., '4.4.4'
$versionParts = explode('.', $version);
$minor = $versionParts[0] . '.' . $versionParts[1];
$isMinorUpdate = ($minorCurrent !== $minor);

// Creates a branch for release.
system('git switch develop');
system('git switch -c docs-changelog-' . $version);
system('git switch docs-changelog-' . $version);

// Copy changelog
$changelog = "./user_guide_src/source/changelogs/v{$version}.rst";
$changelogIndex = './user_guide_src/source/changelogs/index.rst';
if ($isMinorUpdate) {
copy('./admin/next-changelog-minor.rst', $changelog);
} else {
copy('./admin/next-changelog-patch.rst', $changelog);
}
// Add changelog to index.rst.
replace_file_content(
$changelogIndex,
'/\.\. toctree::\n :titlesonly:\n/u',
".. toctree::\n :titlesonly:\n\n v{$version}"
);
// Replace {version}
$length = mb_strlen("Version {$version}");
$underline = str_repeat('#', $length);
replace_file_content(
$changelog,
'/#################\nVersion {version}\n#################/u',
"{$underline}\nVersion {$version}\n{$underline}"
);
replace_file_content(
$changelog,
'/{version}/u',
"{$version}"
);

// Copy upgrading
$versionWithoutDots = str_replace('.', '', $version);
$upgrading = "./user_guide_src/source/installation/upgrade_{$versionWithoutDots}.rst";
$upgradingIndex = './user_guide_src/source/installation/upgrading.rst';
copy('./admin/next-upgrading-guide.rst', $upgrading);
// Add upgrading to upgrading.rst.
replace_file_content(
$upgradingIndex,
'/ backward_compatibility_notes\n/u',
" backward_compatibility_notes\n\n upgrade_{$versionWithoutDots}"
);
// Replace {version}
$length = mb_strlen("Upgrading from {$versionCurrent} to {$version}");
$underline = str_repeat('#', $length);
replace_file_content(
$upgrading,
'/##############################\nUpgrading from {version} to {version}\n##############################/u',
"{$underline}\nUpgrading from {$versionCurrent} to {$version}\n{$underline}"
);

// Commits
system("git add {$changelog} {$changelogIndex}");
system("git add {$upgrading} {$upgradingIndex}");
system('git commit -m "docs: add changelog and upgrade for v' . $version . '"');
4 changes: 0 additions & 4 deletions admin/css/debug-toolbar/_theme-dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,6 @@
.timer {
background-color: $g-orange;
}

.timeline-parent-open td {
color: $t-dark;
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion admin/framework/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"require-dev": {
"codeigniter/coding-standard": "^1.5",
"fakerphp/faker": "^1.9",
"friendsofphp/php-cs-fixer": "3.13.0",
"friendsofphp/php-cs-fixer": "~3.41.0",
"kint-php/kint": "^5.0.4",
"mikey179/vfsstream": "^1.6",
"nexusphp/cs-config": "^3.6",
Expand All @@ -43,6 +43,7 @@
"ext-readline": "Improves CLI::input() usability",
"ext-redis": "If you use Cache class RedisHandler",
"ext-simplexml": "If you format XML",
"ext-sodium": "If you use Encryption SodiumHandler",
"ext-sqlite3": "If you use SQLite3",
"ext-sqlsrv": "If you use SQL Server",
"ext-xdebug": "If you use CIUnitTestCase::assertHeaderEmitted()"
Expand Down
Loading

0 comments on commit eb252d2

Please sign in to comment.