fix: CI test isolation, audio-tts path, and version bump flow#14
Merged
Conversation
composer.json: change repository URL from hardcoded absolute dev path to ./packages/nbucic/audio-tts so it resolves correctly in any checkout. run-tests.yml: replace the jq patching step with a single `composer update nbucic/audio-tts --no-install` which re-locks the package from the relative path before install. No jq calls needed.
prepare-pr.yml: fires on PR open/sync targeting master, compares version.json on PR branch vs master and bumps patch if unchanged. Commits to the unprotected PR branch so no bypass of master protection is needed. The actor check (github-actions[bot]) plus the version comparison provide two independent guards against infinite loops. bump-version.yml: demoted to workflow_dispatch only. Now creates a PR instead of pushing directly, so it is also compatible with branch protection rules.
composer update fires post-update-cmd (artisan vendor:publish) which needs a bootstrapped app. Add --no-scripts so the hook is skipped.
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
Three independent fixes accumulated on this branch after the previous PR (#13) was merged.
1. Test isolation failures (
SettingsTest,TimerProgramTest)Root cause:
2026_04_16_081129_initial_program_seed.phpis a seed migration that ran duringmigrate:freshand pre-populated thesettingsandprogramstables. Transaction rollback (used byRefreshDatabasefor file-based SQLite) only undoes test-created rows — migration-seeded rows survived across tests, causing spurious count mismatches.Fix:
app()->environment('testing')— tables start empty for every testSetting::current()changed fromself::first()tofirstOrCreate([], [...defaults...])to match its docblock ("creating it with defaults on first run") and the test that asserts count 0→1phpunit.xmluses/tmp/laravel-test.sqlite(file-based) soRefreshDatabasecan use real transaction rollback rather than the broken PDO-reference snapshot used for:memory:tests/Pest.phpdrops the redundantRefreshDatabase::classfromuses()(TestCase already carries it)2.
nbucic/audio-ttshardcoded dev pathRoot cause:
composer.jsonpointed the path repository to an absolute local path (/home/nikola/projects/.../packages/nbucic/audio-tts). CI couldn't resolve it, requiring ajqpatching step to strip the package beforecomposer install.Fix:
./packages/nbucic/audio-tts(relative, works in any checkout)jqpatching step removed fromrun-tests.ymlcomposer update nbucic/audio-tts --no-install --no-interaction --quietwhich re-locks the package from the relative path before install — one legitimate Composer operation, no shell munging3. Version bump blocked by protected master branch
Root cause:
bump-version.ymlchecked out master, bumpedversion.json, andgit push-ed directly to master.GITHUB_TOKENcannot bypass branch protection rules, so the push was always rejected.Fix — shift the bump upstream into the PR:
prepare-pr.ymlfires onpull_request(opened / synchronize / reopened) targeting masterversion.jsonon the PR branch vs master; if unchanged, bumps patch version and commits to the PR branch (unprotected — no bypass needed)if: github.actor != 'github-actions[bot]'on the job + the version-comparison check in the stepbump-version.ymldemoted toworkflow_dispatchonly (emergency manual escape hatch); it now opens a PR instead of pushing directly, so it also respects branch protectionNo changes to branch protection rules.
Generated by Claude Code