Update for framework 0.7 and Tempest 3 - #3
Open
mikield wants to merge 1 commit into
Open
Conversation
The skeleton could not boot. PHP was constrained to ^8.2 where the framework needs ^8.5, the framework itself was pinned to dev-master, and the development dependencies were a Tempest 2 era set — phpunit ^10 alongside pest ^2, which pins phpunit ^10 and so cannot sit beside the ^13 the framework tests against. Pest is dropped rather than upgraded, since nothing here uses it. Two things broke on Tempest 3 itself. LogConfig became an interface, so log.config.php was instantiating an interface and dying before anything else ran; it now builds a MultipleChannelsLogConfig. And phpunit.xml pointed at the 10.5 schema and demanded coverage metadata, which fails on a skeleton whose test directories are empty. A missing DISCORD_TOKEN produced a TypeError from inside the framework's config object, which tells a newcomer nothing. The config now says what to do about it. PingCommand had a real bug. setFlags takes a decimal bit field and Bitwise::getBitSet() returns the binary representation, so asking for EPHEMERAL sent 1000000 rather than 64. It happened to still be ephemeral, because 64 divides 1000000 exactly, but it also set five bits nobody asked for. It uses get() now. Since this file is the first thing anyone reads, it also shows an option constraint, which the framework has supported all along without the skeleton demonstrating it. Verified by installing the framework and running ./tempcord boot --register: the application boots, registers, reports `Command "ping" listened.` and opens the gateway.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The skeleton could not boot. Depends on Tempcord/framework#8; constraint is
tempcord/framework: ^0.7.Verified by installing the framework and running
./tempcord boot --register— the application boots, registers, reportsCommand "ping" listened.and opens the gateway.Version constraints
php^8.2^8.5— what the framework requirestempcord/frameworkdev-master^0.7phpunit/phpunit^10.0^13.0phpstan/phpstan^1.10^2.1pestphp/pest^2.0Pest is dropped rather than upgraded: it pins
phpunit ^10, so it cannot sit beside the^13the framework tests against, and nothing here uses it.Tempest 3 breakages
LogConfigbecame an interface.log.config.phpwas doingnew LogConfig(...), so the application died instantiating an interface before anything else ran. It now builds aMultipleChannelsLogConfig.phpunit.xmlpointed at the 10.5 schema and setrequireCoverageMetadata="true", which fails on a skeleton whose test directories are empty.A real bug in the example command
setFlagstakes a decimal bit field;getBitSet()returns the binary representation. So asking forEPHEMERAL(64) sent1000000. It happened to still be ephemeral — 64 divides 1000000 exactly — but it also set five bits nobody asked for. Now uses->get().This is the same class of bug as dc-Ragnarok/Fenrir#134, which fixes three payloads in Fenrir itself that send binary where Discord reads decimal.
Since
PingCommandis the first thing anyone reads, it now also shows an option constraint (minValue/maxValue) — something the framework has always supported without the skeleton demonstrating it.Better first-run experience
A missing
DISCORD_TOKENproduced aTypeErrorfrom inside the framework's config object, which tells a newcomer nothing:The config now says what to do about it instead.
Note
The three workflows still target PHP 8.2/8.3 and would fail against a framework needing 8.5. I could not update them — my token lacks the
workflowscope, so the push was rejected. They needphp-version: '8.5'inrun-tests.yml,static-analysis.ymlandfix-php-code-style-issues.yml.