Skip to content

Commit a88e845

Browse files
Merge branch '4.8' into 4.8
2 parents 1f9df05 + dc9c9f0 commit a88e845

57 files changed

Lines changed: 867 additions & 140 deletions

Some content is hidden

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

‎.github/carson.yml‎

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ version: 1
44
subscribers:
55
- auto-labeler
66
- conflicts-notifier
7+
- no-merge-commits
8+
- no-response-closer
79
- pr-title-linter
810
- signed-commits
11+
- template-enforcer
12+
- welcome
913
settings:
1014
auto-labeler:
1115
sync_labels: true
@@ -35,6 +39,30 @@ settings:
3539
You may want to sync :arrows_counterclockwise: your branch with upstream!
3640
3741
Ref: [Syncing Your Branch](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/workflow.md#updating-your-branch)
42+
no-merge-commits:
43+
name: 'Carson / no-merge-commits'
44+
treat_merge_commits_as: failure
45+
exempt_branches:
46+
- head: '^develop$'
47+
base: '^master$'
48+
- head: '^4\.\d+$'
49+
base: '^develop$'
50+
no-response-closer:
51+
rules:
52+
- label: needs template
53+
only: issues
54+
days_until_close: 2
55+
close_message: |-
56+
Closing this issue: the description still does not follow the bug report template after {{days_until_close}} days.
57+
58+
Please open a new issue using the [bug report form](https://github.com/codeigniter4/CodeIgniter4/issues/new?assignees=&labels=bug&projects=&template=bug_report.yml&title=Bug%3A+). For feature requests or support questions, please use the [forums](https://forum.codeigniter.com/forum-30.html).
59+
- label: waiting for info
60+
days_until_close: 14
61+
unlabel_on_response: true
62+
close_message: |-
63+
Closing this {{type}}: there has been no response for {{days_until_close}} days after more information was requested.
64+
65+
If you can provide the requested details, leave a comment and a maintainer can reopen it.
3866
pr-title-linter:
3967
name: 'Carson / pr-title-linter'
4068
rules:
@@ -44,3 +72,52 @@ settings:
4472
signed-commits:
4573
name: 'Carson / signed-commits'
4674
treat_unsigned_as: failure
75+
template-enforcer:
76+
label: needs template
77+
exempt_roles: [admin, maintain, write, triage]
78+
message: |-
79+
Hi there, @{{user}}! :wave:
80+
81+
It looks like this {{type}} does not follow our template:
82+
83+
{{violations}}
84+
85+
Please update the description to follow the template. The `{{label}}` label will be removed automatically once it does.
86+
issues:
87+
rules:
88+
- pattern: '### PHP Version[\s\S]*### CodeIgniter4 Version'
89+
description: 'Use the [bug report form](https://github.com/codeigniter4/CodeIgniter4/issues/new?assignees=&labels=bug&projects=&template=bug_report.yml&title=Bug%3A+), which asks for your PHP and CodeIgniter4 versions. For a feature request or support question, please use the [forums](https://forum.codeigniter.com/forum-30.html).'
90+
pull_requests:
91+
rules:
92+
- pattern: '\*\*Description\*\*'
93+
description: 'Keep the **Description** heading from the [pull request template](https://github.com/codeigniter4/CodeIgniter4/blob/develop/.github/PULL_REQUEST_TEMPLATE.md) and explain what you have changed, and why.'
94+
- pattern: '\*\*Checklist:?\*\*'
95+
description: 'Keep the **Checklist** from the pull request template and tick the items that apply. See [what we expect in a pull request](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md).'
96+
- pattern: 'Explain what you have changed, and why\.'
97+
description: 'Replace the placeholder text under **Description** with your own explanation.'
98+
mode: forbid
99+
welcome:
100+
first_time:
101+
pull_request: |-
102+
Hi there, @{{user}}! :wave:
103+
104+
Thank you for sending this PR!
105+
106+
We expect the following in all Pull Requests (PRs).
107+
- PRs must be sent to the [appropriate branch](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md#branching)
108+
- All git commits must be [GPG-signed](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md#signing)
109+
- Must follow our [style guide](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md#php-style)
110+
- Be [commented](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md#comments) in the PHP source file
111+
- Be documented in the [user guide](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md#user-guide)
112+
- Be [unit tested](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md#unit-testing)
113+
- Pass all checks in GitHub Actions
114+
115+
> [!IMPORTANT]
116+
> We expect all code changes or bug-fixes to be accompanied by one or more tests added to our test suite to prove the code works.
117+
118+
If pull requests do not comply with the above, they will likely be closed. Since we are a team of volunteers, we don't have any more time to work
119+
on the framework than you do. Please make it as painless for your contributions to be included as possible.
120+
121+
See https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md
122+
issue: false
123+
returning: false

‎.github/mergeable.yml‎

Lines changed: 0 additions & 69 deletions
This file was deleted.

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

Lines changed: 48 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ readonly BOLD='\033[1m'
4141
readonly RESET='\033[0m'
4242

4343
# Script paths
44-
readonly script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
45-
readonly project_root="$( cd "$script_dir/../.." && pwd )"
44+
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
45+
project_root="$( cd "$script_dir/../.." && pwd )"
46+
readonly script_dir project_root
4647
readonly config_file="$script_dir/random-tests-config.txt"
4748
readonly results_dir="$project_root/build/random-tests"
4849

@@ -166,7 +167,8 @@ inflect() {
166167
}
167168

168169
generate_phpunit_random_seed() {
169-
local seed=$(date +%s)
170+
local seed
171+
seed=$(date +%s)
170172

171173
if [[ ! "$seed" =~ ^[0-9]+$ ]]; then
172174
echo 1
@@ -233,7 +235,8 @@ get_failed_test_predecessor() {
233235

234236
print_result() {
235237
local type=$1 completed=$2 total=$3 component=$4 elapsed_str=$5
236-
local padded=$(printf "%${#total}d" "$completed")
238+
local padded
239+
padded=$(printf "%${#total}d" "$completed")
237240
local color symbol
238241

239242
case "$type" in
@@ -462,7 +465,8 @@ run_component_tests() {
462465
fi
463466

464467
local test_dir="tests/system/$component"
465-
local start_time=$(date +%s%N)
468+
local start_time
469+
start_time=$(date +%s%N)
466470

467471
print_debug "Running tests for: $component"
468472

@@ -527,7 +531,8 @@ run_component_tests() {
527531

528532
if kill -0 "$test_pid" 2>/dev/null; then
529533
touch "$timeout_marker"
530-
local pids_to_kill=$(pgrep -P "$test_pid" 2>/dev/null)
534+
local pids_to_kill
535+
pids_to_kill=$(pgrep -P "$test_pid" 2>/dev/null)
531536

532537
kill -TERM "$test_pid" 2>/dev/null || true
533538
if [[ -n "$pids_to_kill" ]]; then
@@ -607,7 +612,8 @@ run_component_tests() {
607612
if [[ $exit_code -eq 124 ]]; then
608613
predecessor_info+=$'\nFailed test: (timeout before PHPUnit emitted failure event)'
609614
if [[ -f "$events_file" ]]; then
610-
local last_prepared_test=$(extract_test_order "$events_file" | tail -n 1)
615+
local last_prepared_test
616+
last_prepared_test=$(extract_test_order "$events_file" | tail -n 1)
611617
if [[ -n "$last_prepared_test" ]]; then
612618
predecessor_info+=$'\nLast prepared test before timeout: '"${last_prepared_test}"
613619
else
@@ -619,7 +625,8 @@ run_component_tests() {
619625
predecessor_info+=$'\nPrevious test: (unavailable due to timeout)'
620626
else
621627
if [[ -f "$events_file" ]]; then
622-
local predecessor_result=$(get_failed_test_predecessor "$events_file")
628+
local predecessor_result
629+
predecessor_result=$(get_failed_test_predecessor "$events_file")
623630
if [[ -n "$predecessor_result" ]]; then
624631
local previous_test=${predecessor_result#*|}
625632
predecessor_info+=$'\nFailed test: '"${predecessor_result%%|*}"
@@ -639,7 +646,7 @@ run_component_tests() {
639646
fi
640647

641648
{
642-
echo "> ${phpunit_args[@]:0:7}"
649+
echo "> ${phpunit_args[*]:0:7}"
643650
echo ""
644651
echo "$output"
645652
echo "$predecessor_info"
@@ -691,8 +698,9 @@ process_result() {
691698
first_result=false
692699
fi
693700

694-
local status=$(grep "^Exit code:" "$result_file" | sed 's/Exit code: //')
695-
local elapsed_str=$(format_elapsed_time "$elapsed")
701+
local status elapsed_str
702+
status=$(grep "^Exit code:" "$result_file" | sed 's/Exit code: //')
703+
elapsed_str=$(format_elapsed_time "$elapsed")
696704

697705
case "$status" in
698706
0)
@@ -728,7 +736,8 @@ get_completed_components() {
728736

729737
while IFS= read -r file_path; do
730738
# Remove prefix: random_test_result_
731-
local temp=$(basename "$file_path")
739+
local temp
740+
temp=$(basename "$file_path")
732741
temp=${temp#random_test_result_}
733742

734743
# Extract elapsed time (everything before first underscore after number)
@@ -749,13 +758,35 @@ get_completed_components() {
749758
# Sort entries by elapsed time numerically
750759
printf '%s\n' "${entries[@]}" | sort -t'|' -k1,1n |
751760
while IFS='|' read -r elapsed listed_component; do
752-
if [[ ! " ${displayed_components[*]:-} " =~ " ${listed_component} " ]]; then
761+
if [[ " ${displayed_components[*]:-} " != *" ${listed_component} "* ]]; then
753762
echo "$listed_component|$elapsed"
754763
fi
755764
done
756765
}
757766

758767

768+
print_failed_component_details() {
769+
local component=$1
770+
local result_file=$2
771+
772+
# GitHub Actions renders ::group:: lines as collapsible log sections.
773+
if [[ -z "${GITHUB_ACTIONS:-}" || ! -f "$result_file" ]]; then
774+
return
775+
fi
776+
777+
echo "::group::${component}: test result"
778+
cat "$result_file"
779+
echo "::endgroup::"
780+
781+
local order_file="${result_file/random_test_result_/random_test_order_}"
782+
783+
if [[ -f "$order_file" ]]; then
784+
echo "::group::${component}: execution order"
785+
cat "$order_file"
786+
echo "::endgroup::"
787+
fi
788+
}
789+
759790
print_summary() {
760791
local run_number=$1
761792
local pass_percent=0.00
@@ -779,13 +810,15 @@ print_summary() {
779810
if [[ $failed -gt 0 ]]; then
780811
echo -e "\n${BOLD_RED}Failed $(inflect "$failed" "Component" "Components"):${RESET}"
781812
while IFS= read -r failed_component; do
782-
local result_file=$(find "$results_dir" -name "random_test_result_*_${failed_component}.txt" 2>/dev/null | head -n 1)
813+
local result_file
814+
result_file=$(find "$results_dir" -name "random_test_result_*_${failed_component}.txt" 2>/dev/null | head -n 1)
783815

784816
if [[ -z "$result_file" ]]; then
785817
result_file="$results_dir/random_test_result_*_${failed_component}.txt"
786818
fi
787819

788820
echo -e " ${RED}✗${RESET} ${BOLD}$failed_component${RESET} ($result_file)"
821+
print_failed_component_details "$failed_component" "$result_file"
789822
done < <(printf '%s\n' "${failed_components[@]}" | sort)
790823
fi
791824

@@ -830,7 +863,7 @@ main() {
830863
# Read components from config file
831864
verify_config
832865
print_success "Configuration file: $config_file\n"
833-
components_array=($(read_components))
866+
read -ra components_array <<< "$(read_components)"
834867
fi
835868

836869
total=${#components_array[@]}

‎.github/workflows/run-carson.yml‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,21 @@ on:
88
- synchronize
99
- reopened
1010
- labeled
11+
- ready_for_review
1112
issues:
1213
types:
1314
- opened
1415
- edited
1516
- labeled
17+
issue_comment:
18+
types:
19+
- created
1620
push:
1721
branches:
1822
- develop
1923
- '4.*'
24+
schedule:
25+
- cron: '0 0 * * *'
2026

2127
permissions: {}
2228

@@ -25,7 +31,7 @@ jobs:
2531
runs-on: ubuntu-24.04
2632
steps:
2733
- name: Run Carson
28-
uses: NexusPHP/carson@3973bbb86351a78861b75bbf504f53a83aede4dc # v1.4.2
34+
uses: NexusPHP/carson@cb35604ab330c2e44dba673fcef712c78e75f858 # v1.7.0
2935
with:
3036
app_id: ${{ secrets.CARSON_APP_ID }}
3137
private_key: ${{ secrets.CARSON_PRIVATE_KEY }}

‎composer.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@
1717
"psr/log": "^3.0"
1818
},
1919
"require-dev": {
20-
"boundwize/structarmed": "^0.17",
20+
"boundwize/structarmed": "^0.18",
2121
"codeigniter/phpstan-codeigniter": "^2.1",
2222
"fakerphp/faker": "^1.24",
2323
"kint-php/kint": "^6.1",
2424
"mikey179/vfsstream": "^1.6.12",
2525
"nexusphp/tachycardia": "^2.0",
2626
"phpstan/extension-installer": "^1.4",
27-
"phpstan/phpstan": "^2.2.1",
27+
"phpstan/phpstan": "^2.2.15",
2828
"phpstan/phpstan-strict-rules": "^2.0",
2929
"phpunit/phpcov": "^9.0.2 || ^10.0",
3030
"phpunit/phpunit": "^10.5.16 || ^11.2",
3131
"predis/predis": "^3.0",
32-
"rector/rector": "2.6.6",
32+
"rector/rector": "2.6.7",
3333
"shipmonk/phpstan-baseline-per-identifier": "^2.0"
3434
},
3535
"replace": {

‎system/Autoloader/FileLocatorCached.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ private function saveCache(): void
8484
*/
8585
public function deleteCache(): void
8686
{
87+
$this->cache = [];
8788
$this->cacheUpdated = false;
8889
$this->cacheHandler->delete($this->cacheKey);
8990
}

0 commit comments

Comments
 (0)