Refactor workflows, fix bugs, and update dependencies in CI/CD#10
Conversation
Removed comments and cleaned up the release workflow file.
This workflow integrates Codacy security scans with GitHub Actions, checking code on push and pull requests to the master branch, and scheduling scans weekly.
This workflow runs PHPMD to analyze PHP code for potential issues and uploads the results to GitHub.
…17 bug kritis
Bug yang diperbaiki:
- DebugToolbarMiddleware::inject() memanggil render() yang tidak ada → gunakan prepare()
- Config::display() menerima 0 arg tapi dipanggil dengan arg → tambah param opsional
- Config extends BaseCollector menyebabkan static method conflict → hapus extends
- History: constructor tanpa param tapi dipanggil new History($config) → tambah constructor
- History::setFiles() menggunakan WRITEPATH (CI4 constant) → gunakan historyPath dari config
- Database.php: seluruh file masih CI4 (Query, config(), is_cli(), \Config\Database, Time) → tulis ulang menggunakan DatabaseAdapterInterface
- Timers.php: service('timer') CI4 → static start()/stop() agnostik
- Events.php: \CodeIgniter\Events\Events → static trigger() agnostik
- Logs.php: service('logger') CI4 → static addLog() agnostik
- Views.php: service('renderer') CI4 → static logView() agnostik
- Files.php: clean_path() CI4 → normalizePath() + isCoreFile() native PHP
- Routes.php: service('routes/router') + DefinedRouteCollector CI4 → RouterInterface
- BaseCollector::cleanPath() memanggil clean_path() CI4 → str_replace native
- toolbar.tpl.php: use CodeIgniter\..., site_url(), $CI_VERSION, $parser → dihapus/diganti
- Semua .tpl: CI4 parser syntax ({key}, {loop}...{/loop}) → plain PHP foreach/if
- phpunit.dist.xml: bootstrap CI4 system/Test/bootstrap.php → vendor/autoload.php
- AdodbDatabaseAdapter::logQuery() tambah parameter $startTime untuk data timeline
- Database::reset() dibuat static agar dapat dipanggil dari tearDown test
Ditambahkan: 3 test file (42 tests, 2595 assertions — semua lulus)
https://claude.ai/code/session_01QevTXiGqzvPkwfj8YeEmB8
…ate_from_format Menghilangkan warning "Avoid using static access to class \DateTime" dari PHPMD/PHPStan. Hasil DateTime disimpan ke variabel $dt agar tidak memanggil factory method dua kali. https://claude.ai/code/session_01QevTXiGqzvPkwfj8YeEmB8
fix: audit & dry run — hapus semua dependensi CodeIgniter4, perbaiki 17 bug kritis
…n none build-mode
…ter' (actual default branch)
fix(ci): update release workflow to run on main/master and stabilize Node/npm steps
Update release workflow: support `main`, enable manual dispatch, generate `.releaserc.json`, use Node 20
…dzhms Update release workflow: support `main`, pin Node 22, and add `.releaserc.json`
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ccc894ed27
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" | ||
| bootstrap="system/Test/bootstrap.php" | ||
| bootstrap="vendor/autoload.php" |
There was a problem hiding this comment.
Point PHPUnit at Composer's configured vendor dir
Because this commit sets Composer's vendor-dir to library (composer config vendor-dir --absolute --source resolves to /workspace/DebugToolbar/library), a fresh install will create library/autoload.php, not vendor/autoload.php. With this bootstrap PHPUnit exits before loading tests in any environment that uses the checked-in Composer config; update the bootstrap path (and the schema path) or remove the custom vendor dir.
Useful? React with 👍 / 👎.
| # 4. Jalankan semantic-release | ||
| # Environment variable GITHUB_TOKEN sudah otomatis tersedia | ||
| - name: Jalankan semantic-release | ||
| run: npx semantic-release |
There was a problem hiding this comment.
Remove the duplicate semantic-release workflow
This new codeql.yml workflow is not CodeQL; it runs npx semantic-release on every push to master, while .github/workflows/release.yml also triggers on master and runs semantic-release. In the inspected master-push workflow set, each push will start two publishers using the same GITHUB_TOKEN, so they can race to create the same tag/GitHub release or fail one of the workflows. Remove the duplicate or replace it with the intended CodeQL scan.
Useful? React with 👍 / 👎.
| public static function reset(): void | ||
| { | ||
| static::$queries = []; | ||
| self::$adapter = null; | ||
| } |
There was a problem hiding this comment.
Keep the database adapter registered across resets
In worker mode or tests that call DebugToolbar::reset(), this static reset() now clears the adapter that the docs say is registered once at bootstrap with Database::setAdapter(...). The next request then sees self::$adapter === null and the Database collector stays empty unless the app re-registers the adapter every request; meanwhile the adapter's own query accumulator is not cleared. Keep the adapter registration and reset the collected query data instead.
Useful? React with 👍 / 👎.
| @@ -263,372 +83,97 @@ $dbAdapter = new AdodbDatabaseAdapter(); | |||
| $toolbar->addCollector(new DatabaseCollector($dbAdapter)); | |||
There was a problem hiding this comment.
Document the actual database collector API
The README now tells users to import WizdamDebugToolbar\Collectors\DatabaseCollector and call $toolbar->addCollector(...), but I searched the repo and the collector class is WizdamDebugToolbar\Collectors\Database and DebugToolbar has no addCollector() method; the new collector API uses Database::setAdapter(...). Users following this integration snippet will hit a class/method-not-found fatal before any queries are recorded.
Useful? React with 👍 / 👎.
Update release workflow: support `main`, pin Node 22, and add `.releaserc.json`
No description provided.