Skip to content

Refactor workflows, fix bugs, and update dependencies in CI/CD#10

Merged
mokesano merged 40 commits into
productionfrom
master
May 27, 2026
Merged

Refactor workflows, fix bugs, and update dependencies in CI/CD#10
mokesano merged 40 commits into
productionfrom
master

Conversation

@mokesano

Copy link
Copy Markdown
Owner

No description provided.

mokesano and others added 30 commits April 25, 2026 19:47
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
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
@mokesano mokesano self-assigned this May 27, 2026
@mokesano mokesano added bug Something isn't working enhancement New feature or request labels May 27, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread phpunit.dist.xml
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"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread .github/workflows/codeql.yml Outdated
# 4. Jalankan semantic-release
# Environment variable GITHUB_TOKEN sudah otomatis tersedia
- name: Jalankan semantic-release
run: npx semantic-release

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +184 to 187
public static function reset(): void
{
static::$queries = [];
self::$adapter = null;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread README.md
@@ -263,372 +83,97 @@ $dbAdapter = new AdodbDatabaseAdapter();
$toolbar->addCollector(new DatabaseCollector($dbAdapter));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@mokesano mokesano merged commit af8e6d5 into production May 27, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants