Skip to content

Commit 7231622

Browse files
paulbalandanmichalsntotoprayogo1916robsonjonathasdependabot[bot]
authored
4.7.3 Ready code (#10229)
* docs: add changelog and upgrade for v4.7.3 (#10068) * chore: migrate SCSS from deprecated `@import` usage (#10066) * docs: clarify `Model::find()` note for null argument (#10072) * chore: upload as artifacts the debug files of failing random execution tests (#10074) * test: indicate components that already pass random execution tests (#10073) * chore: fix wrong trigger name for manually runnable workflow (#10077) * chore: upgrade to `gvenzl/oracle-free` (#10075) * docs: fix formatting in Time library guide (#10078) * docs: update 014.php (#10083) * chore: resolve PHPStan nullCoalesce and isset errors on Config properties (#10081) * chore: resolve PHPStan nullCoalesce and isset errors on Config properties * fix tests * fix: make Autoloader composer path injectable to fix parallel test race condition (#10082) * chore(deps-dev): update rector/rector requirement Updates the requirements on [rector/rector](https://github.com/rectorphp/rector) to permit the latest version. Updates `rector/rector` to 2.4.0 - [Release notes](https://github.com/rectorphp/rector/releases) - [Commits](rectorphp/rector@2.3.9...2.4.0) --- updated-dependencies: - dependency-name: rector/rector dependency-version: 2.4.0 dependency-type: direct:development dependency-group: composer-dependencies ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps-dev): update rector/rector requirement Updates the requirements on [rector/rector](https://github.com/rectorphp/rector) to permit the latest version. Updates `rector/rector` to 2.4.1 - [Release notes](https://github.com/rectorphp/rector/releases) - [Commits](rectorphp/rector@2.4.0...2.4.1) --- updated-dependencies: - dependency-name: rector/rector dependency-version: 2.4.1 dependency-type: direct:development dependency-group: composer-dependencies ... Signed-off-by: dependabot[bot] <support@github.com> * chore: remove useless @var * refactor: add full testing to `logs:clear` command (#10090) * fix: store SPL closures in register() so unregister() can remove them (#10097) * refactor: add full testing for `debugbar:clear` command (#10093) * refactor: pass `--do-not-cache-result` to prevent shared cache corruption (#10098) Co-authored-by: John Paul E Balandan <paulbalandan@gmail.com> * refactor: add full testing for `cache:clear` command (#10094) * chore: re-comment transiently failing component tests (#10095) * test: group commands tests similar to `system/Commands/` (#10096) * chore(deps): bump actions/github-script in / (#10100) Bumps [actions/github-script](https://github.com/actions/github-script) in `/` from 8.0.0 to 9.0.0. Updates `actions/github-script` from 8.0.0 to 9.0.0 - [Release notes](https://github.com/actions/github-script/releases) - [Commits](actions/github-script@ed59741...3a2844b) --- updated-dependencies: - dependency-name: actions/github-script dependency-version: 9.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: github_actions ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: ensure output buffer is closed after use of `command()` (#10099) * chore: fix labeler workflow (#10104) * chore: fix labeler workflow * revert now to use pull_request_target * chore: refactor phpunit config file (#10102) * chore: fixes for php-cs-fixer and psalm (#10105) * fix: preserve null values in Validation::getValidated() (#10101) * test: refactor tests on `BaseCommand` and `Commands` (#10103) * fix: Rename phpunit.xml.dist (#10111) * fix: refactor inconsistent behavior on `CLI::write()` and `CLI::error()` (#10106) * test: fix command tests that may hang on linux due to sudo (#10107) * refactor: rename `-h` option of `routes` command as `--handler` (#10113) * fix: ensure calling `env` command with options only would not throw (#10114) * docs: Improve guide (#10109) * docs: Update "Managing your Applications" * docs: Update "Composer Installation" * docs: Update "Worker Mode" * docs: Update "Testing" * fix: Move next line * refactor: start only required services (#10115) * chore(deps): bump actions/upload-artifact in / (#10116) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) in `/` from 7.0.0 to 7.0.1. Updates `actions/upload-artifact` from 7.0.0 to 7.0.1 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](actions/upload-artifact@bbbca2d...043fb46) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: 7.0.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github_actions ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump actions/cache in / (#10117) Bumps [actions/cache](https://github.com/actions/cache) in `/` from 5.0.4 to 5.0.5. Updates `actions/cache` from 5.0.4 to 5.0.5 - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](actions/cache@6682284...27d5ce7) --- updated-dependencies: - dependency-name: actions/cache dependency-version: 5.0.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github_actions ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: fix label-pr verification step (#10118) * chore: fix label-pr verification step * revert to pull request target * chore(deps-dev): update rector/rector requirement Updates the requirements on [rector/rector](https://github.com/rectorphp/rector) to permit the latest version. Updates `rector/rector` to 2.4.2 - [Release notes](https://github.com/rectorphp/rector/releases) - [Commits](rectorphp/rector@2.4.1...2.4.2) --- updated-dependencies: - dependency-name: rector/rector dependency-version: 2.4.2 dependency-type: direct:development dependency-group: composer-dependencies ... Signed-off-by: dependabot[bot] <support@github.com> * chore: fix transient random test failures (#10122) * chore(deps): bump actions/setup-node in / (#10123) Bumps [actions/setup-node](https://github.com/actions/setup-node) in `/` from 6.3.0 to 6.4.0. Updates `actions/setup-node` from 6.3.0 to 6.4.0 - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](actions/setup-node@53b8394...48b55a0) --- updated-dependencies: - dependency-name: actions/setup-node dependency-version: 6.4.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github_actions ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: suppress stty stderr leak in `CLI::generateDimensions()` when stdin is not a TTY (#10124) * refactor: further rename `--handler` to `--sort-by-handler` for `routes` (#10125) * test: optimize AutoReview tests (#10127) * refactor: UX: `ClearLogs::execute()` error message is misleading after interactive `'n'` (#10126) * docs: document Axios header configuration for AJAX (#10069) Added Axios information regarding the X-Requested-With header. * docs: refactor AJAX request and clarify framework examples (#10129) * docs: fix indentation on `4.7.2` and `4.7.3` changelogs (#10131) * docs: add version switcher to docs page (#10135) * fix: reset Kint CSP state in worker mode (#10139) Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com> * refactor: simplify `FileLocator::listFiles()` (#10142) * fix: make Time::createFromTimestamp locale-independent (#10151) * chore(deps): bump actions/labeler in / (#10161) Bumps [actions/labeler](https://github.com/actions/labeler) in `/` from 6.0.1 to 6.1.0. Updates `actions/labeler` from 6.0.1 to 6.1.0 - [Release notes](https://github.com/actions/labeler/releases) - [Commits](actions/labeler@634933e...f27b608) --- updated-dependencies: - dependency-name: actions/labeler dependency-version: 6.1.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github_actions ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: SQLSRV driver's `decrement()` method (#10155) Co-authored-by: Michal Sniatala <michal@sniatala.pl> Co-authored-by: John Paul E. Balandan, CPA <paulbalandan@gmail.com> * fix: suppress tput stderr leak when TERM is not present (#10167) * fix: support third-party loggers in toolbar logs collector (#10173) * fix: PostgreSQL Builder's `increment()` and `decrement()` methods not working for numeric columns (#10172) * test: fix random-order failures in Config, Honeypot, and Test (#10168) * chore: use single class per file when possible on tests/ directory * chore: add return array iterable doc and regenerate baseline * refactor: reduce PHPStan child return type baseline (#10165) Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com> * refactor: remove PHPStan callable signature baseline (#10166) Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com> * fix: preserve cached table list shape (#10179) * fix: preserve cached table list shape * docs: add changelog entry for cached table list fix Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com> --------- Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com> * fix: harden regex matching on `key:generate` command (#10183) * chore: apply `withRootFiles()` on rector config (#10188) * chore: apply withRootFiles() on rector config * chore: run cs fix * test: make random component execution safer (#10169) * test: make random component execution safer * test: remove unnecessary normalization Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com> * fix: stabilize cached table names for random tests Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com> * test: address review feedbacks Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com> * fix: log factories cache write failures Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com> * fix: document best-effort log chmod Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com> --------- Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com> * chore: add Structarmed to QA (#10180) * chore: Add Structarmed to QA * chore: use latest structarmed 0.3.1 * chore: bump structarmed to 0.3.2 * bump structarmed to 0.3.3 to properly fix cache on CI * chore: bump to structarmed 0.3.4 to fix very long list progressbar * chore: bump to structarmed 0.3.5 * chore: bump structarmed to 0.4.0 * chore: remove ignore platform php 8.5 on test-structarmed workflow * chore: use php 8.5 in php-versions * use tools: composer under Setup PHP * docs: fix Bitnami link (#10190) * fix: restore deep dot-notation traversal in `Language::getLine()` (#10189) * fix: make frankenphp-worker.php template idempotent on watcher restart (#10191) * chore: bump structarmed to 0.4.5 * chore: skip system/ThirdParty * fix: `Entity::normalizeValue()` must handle `UnitEnum` before `toArray()` (#10137) * chore: remove checkout step for base branch (#10194) * chore(deps-dev): update rector/rector requirement Updates the requirements on [rector/rector](https://github.com/rectorphp/rector) to permit the latest version. Updates `rector/rector` to 2.4.3 - [Release notes](https://github.com/rectorphp/rector/releases) - [Commits](rectorphp/rector@2.4.2...2.4.3) --- updated-dependencies: - dependency-name: rector/rector dependency-version: 2.4.3 dependency-type: direct:development dependency-group: composer-dependencies ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps): bump shivammathur/setup-php in / (#10201) Bumps [shivammathur/setup-php](https://github.com/shivammathur/setup-php) in `/` from 2.37.0 to 2.37.1. Updates `shivammathur/setup-php` from 2.37.0 to 2.37.1 - [Release notes](https://github.com/shivammathur/setup-php/releases) - [Commits](shivammathur/setup-php@accd612...7c071df) --- updated-dependencies: - dependency-name: shivammathur/setup-php dependency-version: 2.37.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github_actions ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Merge pull request #10198 from samsonasik/migrate-deptrac-to-structarmed chore: migrate from `deptrac` to `structarmed` * chore(deps-dev): update boundwize/structarmed requirement (#10202) Updates the requirements on [boundwize/structarmed](https://github.com/boundwize/structarmed) to permit the latest version. Updates `boundwize/structarmed` to 0.5.5 - [Release notes](https://github.com/boundwize/structarmed/releases) - [Commits](boundwize/structarmed@0.5.4...0.5.5) --- updated-dependencies: - dependency-name: boundwize/structarmed dependency-version: 0.5.5 dependency-type: direct:development dependency-group: composer-dependencies ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix(config): recognize disabled zlib compression values (#10193) * fix: escape `--host` option in `serve` command (#10203) * chore: bump phpstan to ^2.1.55 and fix callable docblock notice (#10219) * chore(deps-dev): update boundwize/structarmed requirement (#10218) Updates the requirements on [boundwize/structarmed](https://github.com/boundwize/structarmed) to permit the latest version. Updates `boundwize/structarmed` to 0.6.8 - [Release notes](https://github.com/boundwize/structarmed/releases) - [Commits](boundwize/structarmed@0.5.5...0.6.8) --- updated-dependencies: - dependency-name: boundwize/structarmed dependency-version: 0.6.8 dependency-type: direct:development dependency-group: composer-dependencies ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Merge commit from fork * fix: validate client extension in ext_in upload rule * add changelog and upgrade notes * chore(deps-dev): bump the composer-dependencies group with 2 updates (#10224) Updates the requirements on [boundwize/structarmed](https://github.com/boundwize/structarmed) and [rector/rector](https://github.com/rectorphp/rector) to permit the latest version. Updates `boundwize/structarmed` to 0.6.15 - [Release notes](https://github.com/boundwize/structarmed/releases) - [Commits](boundwize/structarmed@0.6.8...0.6.15) Updates `rector/rector` to 2.4.4 - [Release notes](https://github.com/rectorphp/rector/releases) - [Commits](rectorphp/rector@2.4.3...2.4.4) --- updated-dependencies: - dependency-name: boundwize/structarmed dependency-version: 0.6.15 dependency-type: direct:development dependency-group: composer-dependencies - dependency-name: rector/rector dependency-version: 2.4.4 dependency-type: direct:development dependency-group: composer-dependencies ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Prep for 4.7.3 release (#10227) --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com> Co-authored-by: Michal Sniatala <michal@sniatala.pl> Co-authored-by: Toto <totoprayogo1916@gmail.com> Co-authored-by: Robson Jonathas <68930311+robsonjonathas@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Abdul Malik Ikhsan <samsonasik@gmail.com> Co-authored-by: neznaika0 <ozornick.ks@gmail.com> Co-authored-by: Asad <asadkhan4230@gmail.com> Co-authored-by: memleakd <121398829+memleakd@users.noreply.github.com> Co-authored-by: Vansh Patel <developer.patelvansh@gmail.com> Co-authored-by: maniaba <61078470+maniaba@users.noreply.github.com>
2 parents cdf18e8 + 3db54a9 commit 7231622

244 files changed

Lines changed: 3485 additions & 2274 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ utils/ export-ignore
2222
.php-cs-fixer.no-header.php export-ignore
2323
.php-cs-fixer.tests.php export-ignore
2424
.php-cs-fixer.user-guide.php export-ignore
25-
deptrac.yaml export-ignore
25+
structarmed.php export-ignore
2626
phpmetrics.json export-ignore
2727
phpstan-baseline.php export-ignore
2828
phpstan-bootstrap.php export-ignore
2929
phpstan.neon.dist export-ignore
30-
phpunit.xml.dist export-ignore
30+
phpunit.dist.xml export-ignore
3131
psalm-baseline.xml export-ignore
3232
psalm.xml export-ignore
3333
psalm_autoload.php export-ignore

.github/labeler.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
- any-glob-to-any-file:
1111
- '.github/workflows/*'
1212

13-
# Add the `documentation` label to PRs that change any file in the `user_guide_src/source/` directory.
13+
# Add the `documentation` label to PRs for documentation only.
1414
'documentation':
1515
- changed-files:
1616
- any-glob-to-all-files:
17-
- 'user_guide_src/source/*'
17+
- 'user_guide_src/source/**'
1818

19-
# Add the `testing` label to PRs that change files in the `tests/` directory ONLY.
19+
# Add the `testing` label to PRs that changes tests only.
2020
'testing':
2121
- changed-files:
2222
- any-glob-to-all-files:
23-
- 'tests/*'
23+
- 'tests/**'

.github/scripts/random-tests-config.txt

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,41 +9,41 @@
99
# Reference: https://github.com/codeigniter4/CodeIgniter4/issues/9968
1010

1111
API
12-
# AutoReview
13-
# Autoloader
12+
AutoReview
13+
Autoloader
1414
# Cache
1515
CLI
16-
# Commands
17-
# Config
18-
# Cookie
16+
Commands
17+
Config
18+
Cookie
1919
# DataCaster
2020
# DataConverter
2121
# Database
2222
# Debug
2323
# Email
2424
# Encryption
2525
# Entity
26-
# Events
27-
# Files
26+
Events
27+
Files
2828
# Filters
29-
# Format
29+
Format
3030
# HTTP
3131
# Helpers
32-
# Honeypot
33-
# HotReloader
32+
Honeypot
33+
HotReloader
3434
# I18n
3535
# Images
36-
# Language
37-
# Log
36+
Language
37+
Log
3838
# Models
39-
# Pager
40-
# Publisher
41-
# RESTful
39+
Pager
40+
Publisher
41+
RESTful
4242
# Router
43-
# Security
43+
Security
4444
# Session
45-
# Test
46-
# Throttle
47-
# Typography
45+
Test
46+
Throttle
47+
Typography
4848
# Validation
49-
# View
49+
View

.github/scripts/run-random-tests.sh

Lines changed: 91 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
################################################################################
2424

2525
set -u
26+
export LC_NUMERIC=C
2627
trap 'kill "${bg_pids[@]:-}" 2>/dev/null; wait 2>/dev/null' EXIT INT TERM
2728

2829
################################################################################
@@ -476,77 +477,105 @@ run_component_tests() {
476477

477478
local output_file="$results_dir/random_test_output_${component}_$$.log"
478479
local events_file="$results_dir/random_test_events_${component}_$$.log"
479-
local random_seed=$(generate_phpunit_random_seed)
480480
local exit_code=0
481-
482-
# Security: Use array to avoid eval and prevent command injection
483-
local -a phpunit_args=(
484-
"vendor/bin/phpunit"
485-
"$test_dir"
486-
"--colors=never"
487-
"--no-coverage"
488-
"--order-by=random"
489-
"--random-order-seed=${random_seed}"
490-
"--log-events-text"
491-
"$events_file"
492-
)
493-
494-
if [[ $timeout_seconds -gt 0 ]] && command -v timeout >/dev/null 2>&1; then
495-
(cd "$project_root" && timeout --kill-after=2s "${timeout_seconds}s" "${phpunit_args[@]}") > "$output_file" 2>&1
496-
exit_code=$?
497-
elif [[ $timeout_seconds -gt 0 ]] && command -v gtimeout >/dev/null 2>&1; then
498-
(cd "$project_root" && gtimeout --kill-after=2s "${timeout_seconds}s" "${phpunit_args[@]}") > "$output_file" 2>&1
499-
exit_code=$?
500-
else
501-
local timeout_marker="$output_file.timeout"
502-
(cd "$project_root" && "${phpunit_args[@]}") > "$output_file" 2>&1 &
503-
local test_pid=$!
504-
505-
if [[ $timeout_seconds -gt 0 ]]; then
506-
# Watchdog: monitors test process and kills it after timeout
507-
# Uses 1-second sleep intervals to respond quickly when test finishes early
508-
(
509-
local elapsed=0
510-
while [[ $elapsed -lt $timeout_seconds ]]; do
511-
sleep 1
512-
elapsed=$((elapsed + 1))
513-
kill -0 "$test_pid" 2>/dev/null || exit 0
514-
done
515-
516-
if kill -0 "$test_pid" 2>/dev/null; then
517-
touch "$timeout_marker"
518-
local pids_to_kill=$(pgrep -P "$test_pid" 2>/dev/null)
519-
520-
kill -TERM "$test_pid" 2>/dev/null || true
521-
if [[ -n "$pids_to_kill" ]]; then
522-
echo "$pids_to_kill" | xargs kill -TERM 2>/dev/null || true
523-
fi
524-
525-
sleep 2
481+
local attempt=1
482+
local -r max_attempts=2
483+
local random_seed
484+
local -a phpunit_args
485+
486+
# Retry loop: the Composer classmap autoloader occasionally fails to load
487+
# CodeIgniter\CodeIgniter under parallel CI load — a transient infra race,
488+
# not a real test failure. Retry once on that signature with a fresh random
489+
# seed; a second miss is reported as genuine failure.
490+
while true; do
491+
random_seed=$(generate_phpunit_random_seed)
492+
493+
# Security: Use array to avoid eval and prevent command injection
494+
phpunit_args=(
495+
"vendor/bin/phpunit"
496+
"$test_dir"
497+
"--colors=never"
498+
"--no-coverage"
499+
"--do-not-cache-result"
500+
"--order-by=random"
501+
"--random-order-seed=${random_seed}"
502+
"--log-events-text"
503+
"$events_file"
504+
)
505+
506+
if [[ $timeout_seconds -gt 0 ]] && command -v timeout >/dev/null 2>&1; then
507+
(cd "$project_root" && timeout --kill-after=2s "${timeout_seconds}s" "${phpunit_args[@]}") > "$output_file" 2>&1
508+
exit_code=$?
509+
elif [[ $timeout_seconds -gt 0 ]] && command -v gtimeout >/dev/null 2>&1; then
510+
(cd "$project_root" && gtimeout --kill-after=2s "${timeout_seconds}s" "${phpunit_args[@]}") > "$output_file" 2>&1
511+
exit_code=$?
512+
else
513+
local timeout_marker="$output_file.timeout"
514+
(cd "$project_root" && "${phpunit_args[@]}") > "$output_file" 2>&1 &
515+
local test_pid=$!
516+
517+
if [[ $timeout_seconds -gt 0 ]]; then
518+
# Watchdog: monitors test process and kills it after timeout
519+
# Uses 1-second sleep intervals to respond quickly when test finishes early
520+
(
521+
local elapsed=0
522+
while [[ $elapsed -lt $timeout_seconds ]]; do
523+
sleep 1
524+
elapsed=$((elapsed + 1))
525+
kill -0 "$test_pid" 2>/dev/null || exit 0
526+
done
526527

527528
if kill -0 "$test_pid" 2>/dev/null; then
528-
kill -KILL "$test_pid" 2>/dev/null || true
529+
touch "$timeout_marker"
530+
local pids_to_kill=$(pgrep -P "$test_pid" 2>/dev/null)
531+
532+
kill -TERM "$test_pid" 2>/dev/null || true
529533
if [[ -n "$pids_to_kill" ]]; then
530-
echo "$pids_to_kill" | xargs kill -KILL 2>/dev/null || true
534+
echo "$pids_to_kill" | xargs kill -TERM 2>/dev/null || true
535+
fi
536+
537+
sleep 2
538+
539+
if kill -0 "$test_pid" 2>/dev/null; then
540+
kill -KILL "$test_pid" 2>/dev/null || true
541+
if [[ -n "$pids_to_kill" ]]; then
542+
echo "$pids_to_kill" | xargs kill -KILL 2>/dev/null || true
543+
fi
544+
# Security: Quote and escape test_dir for safe pattern matching
545+
pkill -KILL -f "phpunit.*${test_dir//\//\\/}" 2>/dev/null || true
531546
fi
532-
# Security: Quote and escape test_dir for safe pattern matching
533-
pkill -KILL -f "phpunit.*${test_dir//\//\\/}" 2>/dev/null || true
534547
fi
535-
fi
536-
) &
537-
disown $! 2>/dev/null || true
548+
) &
549+
disown $! 2>/dev/null || true
550+
fi
551+
552+
wait "$test_pid" 2>/dev/null
553+
exit_code=$?
554+
555+
if [[ -f "$timeout_marker" ]]; then
556+
exit_code=124
557+
rm -f "$timeout_marker"
558+
elif [[ $exit_code -eq 143 || $exit_code -eq 137 ]]; then
559+
exit_code=124
560+
fi
538561
fi
539562

540-
wait "$test_pid" 2>/dev/null
541-
exit_code=$?
563+
# Success, exhausted attempts, or a non-infra failure: stop retrying.
564+
if [[ $exit_code -eq 0 ]] || [[ $attempt -ge $max_attempts ]]; then
565+
break
566+
fi
542567

543-
if [[ -f "$timeout_marker" ]]; then
544-
exit_code=124
545-
rm -f "$timeout_marker"
546-
elif [[ $exit_code -eq 143 || $exit_code -eq 137 ]]; then
547-
exit_code=124
568+
# Only retry on the known transient autoload race signatures.
569+
# Matching on error messages (not line numbers) so the pattern survives
570+
# unrelated edits to MockCodeIgniter/CIUnitTestCase.
571+
if ! grep -qE 'Failed to open stream: No such file or directory|Class "CodeIgniter.CodeIgniter" not found' "$output_file" 2>/dev/null; then
572+
break
548573
fi
549-
fi
574+
575+
print_debug "Transient autoload failure detected in $component; retrying (attempt $((attempt + 1))/${max_attempts})"
576+
((attempt++))
577+
rm -f "$events_file"
578+
done
550579

551580
local elapsed=$((($(date +%s%N) - $start_time) / 1000000))
552581
local result_file="$results_dir/random_test_result_${elapsed}_${component}.txt"
@@ -610,7 +639,7 @@ run_component_tests() {
610639
fi
611640

612641
{
613-
echo "> ${phpunit_args[@]:0:6}"
642+
echo "> ${phpunit_args[@]:0:7}"
614643
echo ""
615644
echo "$output"
616645
echo "$predecessor_info"

.github/workflows/deploy-apidocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
persist-credentials: false
4545

4646
- name: Setup PHP
47-
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # 2.37.0
47+
uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # 2.37.1
4848
with:
4949
php-version: '8.2'
5050
tools: phive

.github/workflows/deploy-distributables.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
run: ./source/.github/scripts/deploy-framework ${GITHUB_WORKSPACE}/source ${GITHUB_WORKSPACE}/framework ${GITHUB_REF##*/}
7373

7474
- name: Release
75-
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
75+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
7676
with:
7777
github-token: ${{secrets.ACCESS_TOKEN}}
7878
script: |
@@ -126,7 +126,7 @@ jobs:
126126
run: ./source/.github/scripts/deploy-appstarter ${GITHUB_WORKSPACE}/source ${GITHUB_WORKSPACE}/appstarter ${GITHUB_REF##*/}
127127

128128
- name: Release
129-
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
129+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
130130
with:
131131
github-token: ${{secrets.ACCESS_TOKEN}}
132132
script: |
@@ -190,7 +190,7 @@ jobs:
190190
run: ./source/.github/scripts/deploy-userguide ${GITHUB_WORKSPACE}/source ${GITHUB_WORKSPACE}/userguide ${GITHUB_REF##*/}
191191

192192
- name: Release
193-
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
193+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
194194
with:
195195
github-token: ${{secrets.ACCESS_TOKEN}}
196196
script: |

.github/workflows/deploy-userguide-latest.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
persist-credentials: false
3131

3232
- name: Setup PHP
33-
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # 2.37.0
33+
uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # 2.37.1
3434
with:
3535
php-version: '8.2'
3636
coverage: none
@@ -59,7 +59,7 @@ jobs:
5959
6060
# Create an artifact of the html output
6161
- name: Upload artifact
62-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
62+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
6363
with:
6464
name: HTML Documentation
6565
path: user_guide_src/build/html/

.github/workflows/label-pr.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,34 @@ jobs:
1414
runs-on: ubuntu-24.04
1515

1616
steps:
17+
- name: Checkout
18+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
19+
with:
20+
persist-credentials: false
21+
22+
- name: Verify PR source for workflow file changes
23+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
24+
with:
25+
script: |
26+
const prFiles = await github.paginate(github.rest.pulls.listFiles.endpoint.merge({
27+
owner: context.repo.owner,
28+
repo: context.repo.repo,
29+
pull_number: context.payload.pull_request.number,
30+
}));
31+
const workflowFileChanged = prFiles.some(file => file.filename === '.github/workflows/label-pr.yml');
32+
33+
if (workflowFileChanged) {
34+
if (context.payload.pull_request.head.repo.full_name !== 'codeigniter4/CodeIgniter4') {
35+
throw new Error('Changes to label-pr.yml are not allowed from forks.');
36+
}
37+
38+
console.log('Workflow file changed, but PR is from the main repository. Proceeding with label addition.');
39+
return;
40+
}
41+
42+
console.log('No changes to workflow file detected, proceeding with label addition.');
43+
1744
- name: Add labels
18-
uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b # v6.0.1
45+
uses: actions/labeler@f27b608878404679385c85cfa523b85ccb86e213 # v6.1.0
1946
with:
2047
sync-labels: true # Remove labels when matching files are reverted

0 commit comments

Comments
 (0)