From 42d75a9fca74175a346af9bb41b798b76a74e60d Mon Sep 17 00:00:00 2001 From: John Paul E Balandan Date: Mon, 21 Sep 2026 00:09:34 +0800 Subject: [PATCH 1/2] chore: replace Mergeable with Carson's welcome, template-enforcer, and no-response-closer (#10572) --- .github/carson.yml | 55 +++++++++++++++++++++++++ .github/mergeable.yml | 69 -------------------------------- .github/workflows/run-carson.yml | 5 ++- 3 files changed, 59 insertions(+), 70 deletions(-) delete mode 100644 .github/mergeable.yml diff --git a/.github/carson.yml b/.github/carson.yml index 7a4dd7fa2689..37cf003c5e9c 100644 --- a/.github/carson.yml +++ b/.github/carson.yml @@ -4,8 +4,11 @@ version: 1 subscribers: - auto-labeler - conflicts-notifier + - no-response-closer - pr-title-linter - signed-commits + - template-enforcer + - welcome settings: auto-labeler: sync_labels: true @@ -35,6 +38,15 @@ settings: You may want to sync :arrows_counterclockwise: your branch with upstream! Ref: [Syncing Your Branch](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/workflow.md#updating-your-branch) + no-response-closer: + rules: + - label: needs template + only: issues + days_until_close: 2 + close_message: |- + Closing this issue: the description still does not follow the bug report template after {{days_until_close}} days. + + 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). pr-title-linter: name: 'Carson / pr-title-linter' rules: @@ -44,3 +56,46 @@ settings: signed-commits: name: 'Carson / signed-commits' treat_unsigned_as: failure + template-enforcer: + label: needs template + exempt_roles: [admin, maintain, write, triage] + message: |- + Hi there, @{{user}}! :wave: + + It looks like you opened an issue without following the bug report template: + + {{violations}} + + * Bug report ([open an issue](https://github.com/codeigniter4/CodeIgniter4/issues/new?assignees=&labels=bug&projects=&template=bug_report.yml&title=Bug%3A+)) + * For feature request or support question, please use the [forums](https://forum.codeigniter.com/forum-30.html). + + Please update the description to follow the template. The `{{label}}` label will be removed automatically once it does. + issues: + required_sections: + - '### PHP Version' + - '### CodeIgniter4 Version' + welcome: + first_time: + pull_request: |- + Hi there, @{{user}}! :wave: + + Thank you for sending this PR! + + We expect the following in all Pull Requests (PRs). + - PRs must be sent to the [appropriate branch](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md#branching) + - All git commits must be [GPG-signed](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md#signing) + - Must follow our [style guide](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md#php-style) + - Be [commented](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md#comments) in the PHP source file + - Be documented in the [user guide](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md#user-guide) + - Be [unit tested](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md#unit-testing) + - Pass all checks in GitHub Actions + + > [!IMPORTANT] + > 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. + + 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 + on the framework than you do. Please make it as painless for your contributions to be included as possible. + + See https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md + issue: false + returning: false diff --git a/.github/mergeable.yml b/.github/mergeable.yml deleted file mode 100644 index 2e58526188aa..000000000000 --- a/.github/mergeable.yml +++ /dev/null @@ -1,69 +0,0 @@ -# https://mergeable.readthedocs.io/en/latest/configuration.html - -version: 2 -mergeable: - - when: issues.opened, issues.reopened - validate: - - do: or - validate: - - do: and - validate: - - do: description - must_include: - regex: '### PHP Version' - - do: description - must_include: - regex: '### CodeIgniter4 Version' - - do: author - must_include: - regex: ^kenjis|lonnieezell|MGatner|michalsn|paulbalandan|samsonasik|ddevsr$ - fail: - - do: comment - payload: - body: | - Hi there, @@author! :wave: - - It looks like you opened an issue without following the bug report template: - - * Bug report ([open an issue](https://github.com/codeigniter4/CodeIgniter4/issues/new?assignees=&labels=bug&projects=&template=bug_report.yml&title=Bug%3A+)) - * For feature request or support question, please use the [forums](https://forum.codeigniter.com/forum-30.html). - - The current issue will be closed. This is a precaution to save maintainers' time, I hope you'll understand. - - Sincerely, the mergeable bot 🤖 - - do: close - - - when: pull_request.opened, pull_request.ready_for_review - filter: - - do: payload - pull_request: - author_association: - must_include: - regex: ^NONE|FIRST_TIME_CONTRIBUTOR|FIRST_TIMER$ - validate: [] - pass: - - do: comment - payload: - body: | - Hi there, @@author! :wave: - - Thank you for sending this PR! - - We expect the following in all Pull Requests (PRs). - - PRs must be sent to the [appropriate branch](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md#branching) - - All git commits must be [GPG-signed](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md#signing) - - Must follow our [style guide](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md#php-style) - - Be [commented](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md#comments) in the PHP source file - - Be documented in the [user guide](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md#user-guide) - - Be [unit tested](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md#unit-testing) - - Pass all checks in GitHub Actions - - > [!IMPORTANT] - > 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. - - 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 - on the framework than you do. Please make it as painless for your contributions to be included as possible. - - See https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md - - Sincerely, the mergeable bot 🤖 diff --git a/.github/workflows/run-carson.yml b/.github/workflows/run-carson.yml index 13f997730bfc..1f404d1d2a33 100644 --- a/.github/workflows/run-carson.yml +++ b/.github/workflows/run-carson.yml @@ -8,6 +8,7 @@ on: - synchronize - reopened - labeled + - ready_for_review issues: types: - opened @@ -17,6 +18,8 @@ on: branches: - develop - '4.*' + schedule: + - cron: '0 0 * * *' permissions: {} @@ -25,7 +28,7 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Run Carson - uses: NexusPHP/carson@44db1c01ff55b596cabec251fec6307dabd0852e # v1.4.3 + uses: NexusPHP/carson@e4b2fde33f32c47455df218cf1765702c15c3b8b # v1.6.0 with: app_id: ${{ secrets.CARSON_APP_ID }} private_key: ${{ secrets.CARSON_PRIVATE_KEY }} From c21d575dce91eb3c322e3651c36f32109667c959 Mon Sep 17 00:00:00 2001 From: Bogdan Lambarski Date: Sun, 20 Sep 2026 18:10:45 +0200 Subject: [PATCH 2/2] fix(Debug): treat zero time as valid timer start (#10569) * fix(Debug): treat zero time as valid timer start * test: use assertEqualsWithDelta for timer start value in TimerTest * docs: sort v4.7.5 changelog alphabetically --- system/Debug/Timer.php | 2 +- tests/system/Debug/TimerTest.php | 10 ++++++++++ user_guide_src/source/changelogs/v4.7.5.rst | 7 ++++--- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/system/Debug/Timer.php b/system/Debug/Timer.php index 9b6af4d4bcd0..4c383a743413 100644 --- a/system/Debug/Timer.php +++ b/system/Debug/Timer.php @@ -46,7 +46,7 @@ class Timer public function start(string $name, ?float $time = null) { $this->timers[strtolower($name)] = [ - 'start' => $time === null || $time === 0.0 ? microtime(true) : $time, + 'start' => $time ?? microtime(true), 'end' => null, ]; diff --git a/tests/system/Debug/TimerTest.php b/tests/system/Debug/TimerTest.php index 0f28e7dba69b..8ec9a3602c2b 100644 --- a/tests/system/Debug/TimerTest.php +++ b/tests/system/Debug/TimerTest.php @@ -86,6 +86,16 @@ public function testElapsedTimeGivesSameResultAsTimersArray(): void $this->assertSame($expected, $timer->getElapsedTime('test1')); } + public function testStartWithZeroTime(): void + { + $timer = new Timer(); + $timer->start('test1', 0.0); + + $timers = $timer->getTimers(); + + $this->assertEqualsWithDelta(0.0, $timers['test1']['start'], PHP_FLOAT_EPSILON); + } + public function testThrowsExceptionStoppingNonTimer(): void { $this->expectException('RunTimeException'); diff --git a/user_guide_src/source/changelogs/v4.7.5.rst b/user_guide_src/source/changelogs/v4.7.5.rst index 83e0bf47742a..5fc0cfce5578 100644 --- a/user_guide_src/source/changelogs/v4.7.5.rst +++ b/user_guide_src/source/changelogs/v4.7.5.rst @@ -19,9 +19,9 @@ Message Changes *************** - Added the ``CLI.generator.undefinedDatabaseGroup`` and ``CLI.generator.unsupportedSessionDriver`` language strings. -- Added the ``Cookie.invalidCookieValue`` language string. -- Added the ``Cookie.invalidCookiePath`` language string. - Added the ``Cookie.invalidCookieDomain`` language string. +- Added the ``Cookie.invalidCookiePath`` language string. +- Added the ``Cookie.invalidCookieValue`` language string. ******* Changes @@ -41,6 +41,7 @@ Bugs Fixed - **Autoloader:** Fixed a bug where ``FileLocatorCached::deleteCache()`` left the deleted data in memory, so it could be written back to the cache file on shutdown. ``spark optimize`` and ``spark cache:clear`` now clear the shared locator's cache instead of a separate instance. - **BaseModel:** Fixed a bug where auto-generated ``created_at``/``updated_at`` timestamps always rendered ``.000000`` for a ``'datetime'`` ``$dateFormat`` whose connection ``dateFormat`` mask includes ``.v``/``.u``, instead of the real sub-second value. +- **Cache:** Fixed ``MemcachedHandler::decrement()`` initializing a non-existent counter to the positive offset. Missing counters are now initialized to ``0``, reflecting Memcached's unsigned, saturating counter semantics. - **CLI:** Fixed a bug where pressing backspace in a ``CLI::prompt()`` erased the prompt text when the ``readline`` extension is enabled. The prompt is now passed to ``readline()`` so line redraws repaint it. ANSI color codes in the prompt (e.g., option defaults) are wrapped in readline's non-printing markers under GNU readline so cursor positioning stays accurate. On Windows, where the ``readline`` extension is built on WinEditLine, the prompt is written to STDOUT first because WinEditLine reports no library version and prints ANSI sequences literally. @@ -52,12 +53,12 @@ Bugs Fixed - **Cookie:** Fixed a bug where ``Cookie`` instances created with ``raw: true`` allowed invalid characters in cookie values rejected by ``setrawcookie()``. - **Cookie:** Fixed a bug where ``Cookie`` instances allowed invalid characters in path, domain, and prefix attributes rejected by ``setcookie()`` and ``setrawcookie()``. - **Database:** Fixed a bug where rebuilding a SQLite3 table (e.g., ``Forge::dropColumn()``, ``Forge::modifyColumn()``, ``Forge::dropForeignKey()`` and ``Forge::dropPrimaryKey()``) corrupted the table names referenced by its foreign keys when ``DBPrefix`` was set. +- **Debug:** Fixed a bug where ``Timer::start()`` treated ``0.0`` as an empty value and substituted the current time. - **Files:** Fixed a bug where ``File::move()`` and ``UploadedFile::move()`` set executable and overly permissive file permissions (``0777 & ~umask()`` instead of ``0666 & ~umask()``), and ``UploadedFile::move()`` targeted the parent directory instead of the destination file for ``chmod()``. - **Helpers:** Fixed a bug where ``get_dir_file_info()`` returned incomplete entries for subdirectories and missing files instead of omitting them. - **Honeypot:** Fixed a bug where bot detection returned an HTTP 500 response instead of 403 (Forbidden). - **I18n:** Fixed a bug where ``Time::today()``, ``Time::yesterday()``, and ``Time::tomorrow()`` ignored the specified ``$timezone`` and ``setTestNow()`` when calculating the day. - **Logger:** Fixed a bug where interpolating a log message with array or non-stringable context values could raise PHP warnings or errors. -- **Cache:** Fixed ``MemcachedHandler::decrement()`` initializing a non-existent counter to the positive offset. Missing counters are now initialized to ``0``, reflecting Memcached's unsigned, saturating counter semantics. See the repo's `CHANGELOG.md `_